* [PATCH] block: fix returnvar.cocci warnings
@ 2015-05-26 19:59 Julia Lawall
2015-05-26 20:10 ` Jens Axboe
2015-05-28 1:36 ` Rik van Riel
0 siblings, 2 replies; 4+ messages in thread
From: Julia Lawall @ 2015-05-26 19:59 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Jeff Moyer, Alexander Viro, linux-fsdevel, linux-kernel
Remove unneeded variable used to store return value.
Generated by: scripts/coccinelle/misc/returnvar.cocci
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---
One could check whether the ret variable was intended to be used for
anything.
fs/buffer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2996,7 +2996,6 @@ void guard_bio_eod(int rw, struct bio *b
int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags)
{
struct bio *bio;
- int ret = 0;
BUG_ON(!buffer_locked(bh));
BUG_ON(!buffer_mapped(bh));
@@ -3038,7 +3037,7 @@ int _submit_bh(int rw, struct buffer_hea
rw |= REQ_PRIO;
submit_bio(rw, bio);
- return ret;
+ return 0;
}
EXPORT_SYMBOL_GPL(_submit_bh);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: fix returnvar.cocci warnings
2015-05-26 19:59 [PATCH] block: fix returnvar.cocci warnings Julia Lawall
@ 2015-05-26 20:10 ` Jens Axboe
2015-05-28 1:36 ` Rik van Riel
1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2015-05-26 20:10 UTC (permalink / raw)
To: Julia Lawall, Christoph Hellwig
Cc: Jeff Moyer, Alexander Viro, linux-fsdevel, linux-kernel
On 05/26/2015 01:59 PM, Julia Lawall wrote:
> Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
Applied, thanks.--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: fix returnvar.cocci warnings
2015-05-26 19:59 [PATCH] block: fix returnvar.cocci warnings Julia Lawall
2015-05-26 20:10 ` Jens Axboe
@ 2015-05-28 1:36 ` Rik van Riel
2015-05-28 1:38 ` Jens Axboe
1 sibling, 1 reply; 4+ messages in thread
From: Rik van Riel @ 2015-05-28 1:36 UTC (permalink / raw)
To: Julia Lawall, Christoph Hellwig
Cc: Jens Axboe, Jeff Moyer, Alexander Viro, linux-fsdevel, linux-kernel
On 05/26/2015 03:59 PM, Julia Lawall wrote:
> Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
>
> One could check whether the ret variable was intended to be used for
> anything.
Which tree is this against?
Linus's latest tree still has this in _submit_bh
(unless git didn't pull the latest updates right):
if (buffer_meta(bh))
rw |= REQ_META;
if (buffer_prio(bh))
rw |= REQ_PRIO;
bio_get(bio);
submit_bio(rw, bio);
if (bio_flagged(bio, BIO_EOPNOTSUPP))
ret = -EOPNOTSUPP;
bio_put(bio);
return ret;
}
--
All rights reversed
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: fix returnvar.cocci warnings
2015-05-28 1:36 ` Rik van Riel
@ 2015-05-28 1:38 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2015-05-28 1:38 UTC (permalink / raw)
To: Rik van Riel, Julia Lawall, Christoph Hellwig
Cc: Jeff Moyer, Alexander Viro, linux-fsdevel, linux-kernel
On 05/27/2015 07:36 PM, Rik van Riel wrote:
> On 05/26/2015 03:59 PM, Julia Lawall wrote:
>> Remove unneeded variable used to store return value.
>>
>> Generated by: scripts/coccinelle/misc/returnvar.cocci
>>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>> ---
>>
>> One could check whether the ret variable was intended to be used for
>> anything.
>
> Which tree is this against?
>
> Linus's latest tree still has this in _submit_bh
> (unless git didn't pull the latest updates right):
>
> if (buffer_meta(bh))
> rw |= REQ_META;
> if (buffer_prio(bh))
> rw |= REQ_PRIO;
>
> bio_get(bio);
> submit_bio(rw, bio);
>
> if (bio_flagged(bio, BIO_EOPNOTSUPP))
> ret = -EOPNOTSUPP;
>
> bio_put(bio);
> return ret;
for-4.2/core has dropped the EOPNOTSUPP parts, that's where Julia found
the issue of the now unused 'ret'.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-28 1:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 19:59 [PATCH] block: fix returnvar.cocci warnings Julia Lawall
2015-05-26 20:10 ` Jens Axboe
2015-05-28 1:36 ` Rik van Riel
2015-05-28 1:38 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).