staging: lustre: fix checkpatch problems in llite/lloop.c
cover staging: lustre: fix checkpatch problems in llite/lloop.c
Fix 3 checkpatch problems in drivers/staging/lustre/lustre/llite/lloop.c [PATCH 1/3] staging: lustre: Do not init global to NULL [PATCH 2/3] staging: lustre: Add blank line after variable declaration [PATCH 3/3] staging: lustre: Remove the space before \n
PATCH 1/3 staging: lustre: Do not init global to NULL
Remove "= NULL" in global variable
--- drivers/staging/lustre/lustre/llite/lloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/lloop.c +1 -1
@@ -162,7 +162,7 @@ static int max_loop = MAX_LOOP_DEFAULT;static struct lloop_device *loop_dev;static struct gendisk **disks;static struct mutex lloop_mutex; -static void *ll_iocontrol_magic =NULL ; +static void *ll_iocontrol_magic;static loff_t get_loop_size (struct lloop_device *lo,struct file *file) {
Signature · 1 line
2.1.4
PATCH 2/3 staging: lustre: Add blank line after variable declaration
In reply to Swee Hua LawAdd blank line after variable declaration
--- drivers/staging/lustre/lustre/llite/lloop.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/lustre/lustre/llite/lloop.c +3 -0
@@ -372,9 +372,11 @@ err:static inline void loop_handle_bio (struct lloop_device *lo,struct bio *bio) {int ret; + ret =do_bio_lustrebacked (lo, bio);while (bio) {struct bio *tmp = bio->bi_next; + bio->bi_next =NULL ;bio_endio (bio); bio = tmp;
@@ -427,6 +429,7 @@ static int loop_thread(void *data)wait_event (lo->lo_bh_wait,loop_active (lo));if (!atomic_read (&lo->lo_pending)) {int exiting =0 ; +spin_lock_irq (&lo->lo_lock); exiting = (lo->lo_state ==LLOOP_RUNDOWN );spin_unlock_irq (&lo->lo_lock);
Signature · 1 line
2.1.4
Re: [PATCH 2/3] staging: lustre: Add blank line after variable declaration
Quoted 12 lines · Swee Hua Law
Add blank line after variable declaration
Signed-off-by Swee Hua Law <[email protected]>--- drivers/staging/lustre/lustre/llite/lloop.c | 3 +++ 1 file changed, 3 insertions(+)drivers/staging/lustre/lustre/llite/lloop.c +0
-0
drivers/staging/lustre/lustre/llite/lloop.c err: · line 381
Quoted 10 lines
drivers/staging/lustre/lustre/llite/lloop.c +2
-0@@ -372,9 +372,11 @@ err:static inline void loop_handle_bio (struct lloop_device *lo,struct bio *bio) {int ret; + ret =do_bio_lustrebacked (lo, bio);while (bio) {struct bio *tmp = bio->bi_next; + bio->bi_next =NULL ;bio_endio (bio);
This patch will not apply. I am not sure how your tree got bio_endio(bio) but in the staging tree this line is bio_endio(bio, ret);
regards
sudip
Re: [PATCH 2/3] staging: lustre: Add blank line after variable declaration
Quoted 2 lines · Sudip Mukherjee
Quoted 1 line · Swee Hua Law
Add blank line after variable declaration
[]
Quoted 1 line
drivers/staging/lustre/lustre/llite/lloop.c
Quoted 1 line
drivers/staging/lustre/lustre/llite/lloop.c +0
-0
[]
Quoted 5 lines
Quoted 5 lines
drivers/staging/lustre/lustre/llite/lloop.c +1
-0@@ -372,9 +372,11 @@ err:static inline void loop_handle_bio (struct lloop_device *lo,struct bio *bio) {int ret; +
Quoted 8 lines
drivers/staging/lustre/lustre/llite/lloop.c err: · line 381
Quoted 6 lines
drivers/staging/lustre/lustre/llite/lloop.c +1
-0ret =do_bio_lustrebacked (lo, bio);while (bio) {struct bio *tmp = bio->bi_next; + bio->bi_next =NULL ;bio_endio (bio);This patch will not apply. I am not sure how your tree got
bio_endio(bio)but in the staging tree this line isbio_endio(bio, ret);
And besides that, why do only this file/location?
There are several hundred possible in lustre.
Using:
$ git ls-files -- "drivers/staging/lustre/*.[ch]" | \ xargs ./scripts/checkpatch.pl -f --fix-inplace --types=line_spacing
would fix just about all of them.
$ git diff --shortstat drivers/staging/lustre/ 172 files changed, 267 insertions(+), 316 deletions(-)
PATCH 3/3 staging: lustre: Remove the space before \n
In reply to Swee Hua LawRemove the extra space character right before \n in the string
--- drivers/staging/lustre/lustre/llite/lloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/lloop.c +1 -1
@@ -308,7 +308,7 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req) rw = first->bi_rw; bio = &lo->lo_bio;while (*bio && (*bio)->bi_rw == rw) { -CDEBUG (D_INFO ,"bio sector %llu size %u count %u vcnt%u \n" , +CDEBUG (D_INFO ,"bio sector %llu size %u count %u vcnt%u\n" , (unsigned long long )(*bio)->bi_iter.bi_sector, (*bio)->bi_iter.bi_size, page_count, (*bio)->bi_vcnt);
Signature · 1 line
2.1.4
Re: [PATCH 3/3] staging: lustre: Remove the space before \n
Quoted 1 line · Swee Hua Law
Remove the extra space character right before \n in the string
[]
drivers/staging/lustre/lustre/llite/lloop.c
Quoted 1 line
drivers/staging/lustre/lustre/llite/lloop.c +0
-0
[]
drivers/staging/lustre/lustre/llite/lloop.c static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req) · line 311
Quoted 6 lines
drivers/staging/lustre/lustre/llite/lloop.c +1
-1@@ -308,7 +308,7 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req) rw = first->bi_rw; bio = &lo->lo_bio;while (*bio && (*bio)->bi_rw == rw) { - CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u \n", + CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u\n",
More likely the space is misplaced and it should be:
CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt %u\n"