Skip to content

Commit

Permalink
ocfs2-clear-zero-in-unaligned-direct-io-checkpatch-fixes
Browse files Browse the repository at this point in the history
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
linux-sunxi#42: FILE: fs/ocfs2/aops.c:2155:
+	unsigned i_blkbits = inode->i_sb->s_blocksize_bits;

ERROR: code indent should use tabs where possible
linux-sunxi#53: FILE: fs/ocfs2/aops.c:2166:
+ ^I * "pos" and "end", we need map twice to return different buffer state:$

WARNING: please, no space before tabs
linux-sunxi#53: FILE: fs/ocfs2/aops.c:2166:
+ ^I * "pos" and "end", we need map twice to return different buffer state:$

ERROR: code indent should use tabs where possible
linux-sunxi#54: FILE: fs/ocfs2/aops.c:2167:
+ ^I * 1. area in file size, not set NEW;$

WARNING: please, no space before tabs
linux-sunxi#54: FILE: fs/ocfs2/aops.c:2167:
+ ^I * 1. area in file size, not set NEW;$

ERROR: code indent should use tabs where possible
linux-sunxi#55: FILE: fs/ocfs2/aops.c:2168:
+ ^I * 2. area out file size, set  NEW.$

WARNING: please, no space before tabs
linux-sunxi#55: FILE: fs/ocfs2/aops.c:2168:
+ ^I * 2. area out file size, set  NEW.$

ERROR: code indent should use tabs where possible
linux-sunxi#56: FILE: fs/ocfs2/aops.c:2169:
+ ^I *$

WARNING: please, no space before tabs
linux-sunxi#56: FILE: fs/ocfs2/aops.c:2169:
+ ^I *$

ERROR: code indent should use tabs where possible
linux-sunxi#57: FILE: fs/ocfs2/aops.c:2170:
+ ^I *^I^I   iblock    endblk$

WARNING: please, no space before tabs
linux-sunxi#57: FILE: fs/ocfs2/aops.c:2170:
+ ^I *^I^I   iblock    endblk$

ERROR: code indent should use tabs where possible
linux-sunxi#58: FILE: fs/ocfs2/aops.c:2171:
+ ^I * |--------|---------|---------|---------$

WARNING: please, no space before tabs
linux-sunxi#58: FILE: fs/ocfs2/aops.c:2171:
+ ^I * |--------|---------|---------|---------$

ERROR: code indent should use tabs where possible
linux-sunxi#59: FILE: fs/ocfs2/aops.c:2172:
+ ^I * |<-------area in file------->|$

WARNING: please, no space before tabs
linux-sunxi#59: FILE: fs/ocfs2/aops.c:2172:
+ ^I * |<-------area in file------->|$

ERROR: code indent should use tabs where possible
linux-sunxi#60: FILE: fs/ocfs2/aops.c:2173:
+ ^I */$

WARNING: please, no space before tabs
linux-sunxi#60: FILE: fs/ocfs2/aops.c:2173:
+ ^I */$

total: 8 errors, 9 warnings, 40 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

NOTE: Whitespace errors detected.
      You may wish to use scripts/cleanpatch or scripts/cleanfile

./patches/ocfs2-clear-zero-in-unaligned-direct-io.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Jia Guo <guojia12@huawei.com>
Cc: Yiwen Jiang <jiangyiwen@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
akpm00 authored and sfrothwell committed Jul 27, 2019
1 parent a4349b6 commit 58bbdfa
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
struct ocfs2_dio_write_ctxt *dwc = NULL;
struct buffer_head *di_bh = NULL;
u64 p_blkno;
unsigned i_blkbits = inode->i_sb->s_blocksize_bits;
unsigned int i_blkbits = inode->i_sb->s_blocksize_bits;
loff_t pos = iblock << i_blkbits;
sector_t endblk = (i_size_read(inode) - 1) >> i_blkbits;
unsigned len, total_len = bh_result->b_size;
Expand All @@ -2157,14 +2157,14 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,

/*
* bh_result->b_size is count in get_more_blocks according to write
* "pos" and "end", we need map twice to return different buffer state:
* 1. area in file size, not set NEW;
* 2. area out file size, set NEW.
*
* iblock endblk
* |--------|---------|---------|---------
* |<-------area in file------->|
*/
* "pos" and "end", we need map twice to return different buffer state:
* 1. area in file size, not set NEW;
* 2. area out file size, set NEW.
*
* iblock endblk
* |--------|---------|---------|---------
* |<-------area in file------->|
*/

if ((iblock <= endblk) &&
((iblock + ((len - 1) >> i_blkbits)) > endblk))
Expand Down

0 comments on commit 58bbdfa

Please sign in to comment.