drivers/bch: fix nxstyle errors

This commit is contained in:
Pelle Windestam 2020-03-11 06:44:32 +01:00 committed by Xiang Xiao
parent 14d037b8d5
commit 5afee5cbd1
5 changed files with 20 additions and 15 deletions

View File

@ -85,7 +85,8 @@ struct bchlib_s
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif

View File

@ -259,15 +259,16 @@ static off_t bch_seek(FAR struct file *filep, off_t offset, int whence)
/* Opengroup.org:
*
* "The lseek() function shall allow the file offset to be set beyond the end
* of the existing data in the file. If data is later written at this point,
* subsequent reads of data in the gap shall return bytes with the value 0
* until data is actually written into the gap."
* "The lseek() function shall allow the file offset to be set beyond the
* end of the existing data in the file. If data is later written at this
* point, subsequent reads of data in the gap shall return bytes with the
* value 0 until data is actually written into the gap."
*
* We can conform to the first part, but not the second. But return EINVAL if
* We can conform to the first part, but not the second. But return EINVAL
* if:
*
* "...the resulting file offset would be negative for a regular file, block
* special file, or directory."
* "...the resulting file offset would be negative for a regular file,
* block special file, or directory."
*/
if (newpos >= 0)
@ -312,7 +313,8 @@ static ssize_t bch_read(FAR struct file *filep, FAR char *buffer, size_t len)
* Name: bch_write
****************************************************************************/
static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer, size_t len)
static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct bchlib_s *bch;

View File

@ -72,12 +72,13 @@
* Name: bchlib_read
*
* Description:
* Read from the block device set-up by bchlib_setup as if it were a character
* device.
* Read from the block device set-up by bchlib_setup as if it were a
* character device.
*
****************************************************************************/
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t len)
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
size_t len)
{
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;
size_t nsectors;

View File

@ -93,7 +93,8 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
goto errout_with_bch;
}
DEBUGASSERT(bch->inode && bch->inode->u.i_bops && bch->inode->u.i_bops->geometry);
DEBUGASSERT(bch->inode && bch->inode->u.i_bops &&
bch->inode->u.i_bops->geometry);
ret = bch->inode->u.i_bops->geometry(bch->inode, &geo);
if (ret < 0)

View File

@ -59,8 +59,8 @@
* Name: bchlib_write
*
* Description:
* Write to the block device set-up by bchlib_setup as if it were a character
* device.
* Write to the block device set-up by bchlib_setup as if it were a
* character device.
*
****************************************************************************/