Skip to content

Commit

Permalink
mpage-add-argument-structure-for-do_mpage_readpage-checkpatch-fixes
Browse files Browse the repository at this point in the history
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
torvalds#49: FILE: fs/mpage.c:139:
+	unsigned nr_pages;

WARNING: line over 80 characters
torvalds#96: FILE: fs/mpage.c:190:
+	if (buffer_mapped(map_bh) && block_in_file > args->first_logical_block &&

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
torvalds#98: FILE: fs/mpage.c:192:
+		unsigned map_offset = block_in_file - args->first_logical_block;

WARNING: line over 80 characters
torvalds#135: FILE: fs/mpage.c:296:
+				min_t(int, args->nr_pages, BIO_MAX_PAGES), args->gfp);

ERROR: code indent should use tabs where possible
torvalds#169: FILE: fs/mpage.c:321:
+^I        block_read_full_page(page, args->get_block);$

total: 1 errors, 4 warnings, 196 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/mpage-add-argument-structure-for-do_mpage_readpage.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


Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 authored and hnaz committed Aug 15, 2018
1 parent 46ae85f commit 2e8bc40
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fs/mpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ map_buffer_to_page(struct page *page, struct buffer_head *bh, int page_block)
struct mpage_readpage_args {
struct bio *bio;
struct page *page;
unsigned nr_pages;
unsigned int nr_pages;
sector_t last_block_in_bio;
struct buffer_head map_bh;
unsigned long first_logical_block;
Expand Down Expand Up @@ -187,7 +187,8 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
* Map blocks using the result from the previous get_blocks call first.
*/
nblocks = map_bh->b_size >> blkbits;
if (buffer_mapped(map_bh) && block_in_file > args->first_logical_block &&
if (buffer_mapped(map_bh) &&
block_in_file > args->first_logical_block &&
block_in_file < (args->first_logical_block + nblocks)) {
unsigned map_offset = block_in_file - args->first_logical_block;
unsigned last = nblocks - map_offset;
Expand Down Expand Up @@ -293,7 +294,9 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
goto out;
}
args->bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
min_t(int, args->nr_pages, BIO_MAX_PAGES), args->gfp);
min_t(int, args->nr_pages,
BIO_MAX_PAGES),
args->gfp);
if (args->bio == NULL)
goto confused;
}
Expand All @@ -318,7 +321,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
if (args->bio)
args->bio = mpage_bio_submit(REQ_OP_READ, 0, args->bio);
if (!PageUptodate(page))
block_read_full_page(page, args->get_block);
block_read_full_page(page, args->get_block);
else
unlock_page(page);
goto out;
Expand Down

0 comments on commit 2e8bc40

Please sign in to comment.