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'
rockchip-linux#42: FILE: fs/ocfs2/aops.c:2155:
+	unsigned i_blkbits = inode->i_sb->s_blocksize_bits;

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

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

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

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

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

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

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

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

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

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

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

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

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

WARNING: please, no space before tabs
rockchip-linux#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 <[email protected]>
Cc: Yiwen Jiang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
  • Loading branch information
akpm00 authored and sfrothwell committed Aug 28, 2019
1 parent d545df9 commit 2ce34e7
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 2ce34e7

Please sign in to comment.