* [PATCH] staging: comedi: Remove variable runflags
@ 2019-05-30 20:51 Nishka Dasgupta
2019-05-31 10:25 ` Ian Abbott
0 siblings, 1 reply; 4+ messages in thread
From: Nishka Dasgupta @ 2019-05-30 20:51 UTC (permalink / raw)
To: abbotti, hsweeten, gregkh, olsonse, jkhasdev, giulio.benetti,
nishadkamdar, kas.sandesh, devel, linux-kernel
Cc: Nishka Dasgupta
Remove variable runflags and use its value directly. Issue found with
checkpatch.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
drivers/staging/comedi/comedi_fops.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index f6d1287c7b83..b84ee9293903 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -676,16 +676,12 @@ EXPORT_SYMBOL_GPL(comedi_is_subdevice_running);
static bool __comedi_is_subdevice_running(struct comedi_subdevice *s)
{
- unsigned int runflags = __comedi_get_subdevice_runflags(s);
-
- return comedi_is_runflags_running(runflags);
+ return comedi_is_runflags_running(__comedi_get_subdevice_runflags(s));
}
bool comedi_can_auto_free_spriv(struct comedi_subdevice *s)
{
- unsigned int runflags = __comedi_get_subdevice_runflags(s);
-
- return runflags & COMEDI_SRF_FREE_SPRIV;
+ return __comedi_get_subdevice_runflags(s) & COMEDI_SRF_FREE_SPRIV;
}
/**
--
2.19.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: comedi: Remove variable runflags
2019-05-30 20:51 [PATCH] staging: comedi: Remove variable runflags Nishka Dasgupta
@ 2019-05-31 10:25 ` Ian Abbott
2019-05-31 12:47 ` Nishka Dasgupta
0 siblings, 1 reply; 4+ messages in thread
From: Ian Abbott @ 2019-05-31 10:25 UTC (permalink / raw)
To: Nishka Dasgupta, hsweeten, gregkh, olsonse, jkhasdev,
giulio.benetti, nishadkamdar, kas.sandesh, devel, linux-kernel
On 30/05/2019 21:51, Nishka Dasgupta wrote:
> Remove variable runflags and use its value directly. Issue found with
> checkpatch.
>
> Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
> ---
> drivers/staging/comedi/comedi_fops.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index f6d1287c7b83..b84ee9293903 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -676,16 +676,12 @@ EXPORT_SYMBOL_GPL(comedi_is_subdevice_running);
>
> static bool __comedi_is_subdevice_running(struct comedi_subdevice *s)
> {
> - unsigned int runflags = __comedi_get_subdevice_runflags(s);
> -
> - return comedi_is_runflags_running(runflags);
> + return comedi_is_runflags_running(__comedi_get_subdevice_runflags(s));
> }
>
> bool comedi_can_auto_free_spriv(struct comedi_subdevice *s)
> {
> - unsigned int runflags = __comedi_get_subdevice_runflags(s);
> -
> - return runflags & COMEDI_SRF_FREE_SPRIV;
> + return __comedi_get_subdevice_runflags(s) & COMEDI_SRF_FREE_SPRIV;
> }
>
> /**
>
I couldn't reproduce this checkpatch issue, even with '--subjective'.
--
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268. Registered address: )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: comedi: Remove variable runflags
2019-05-31 10:25 ` Ian Abbott
@ 2019-05-31 12:47 ` Nishka Dasgupta
2019-05-31 13:31 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Nishka Dasgupta @ 2019-05-31 12:47 UTC (permalink / raw)
To: Ian Abbott, hsweeten, gregkh, olsonse, jkhasdev, giulio.benetti,
nishadkamdar, kas.sandesh, devel, linux-kernel
On 31/05/19 3:55 PM, Ian Abbott wrote:
> On 30/05/2019 21:51, Nishka Dasgupta wrote:
>> Remove variable runflags and use its value directly. Issue found with
>> checkpatch.
>>
>> Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
>> ---
>> drivers/staging/comedi/comedi_fops.c | 8 ++------
>> 1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/comedi_fops.c
>> b/drivers/staging/comedi/comedi_fops.c
>> index f6d1287c7b83..b84ee9293903 100644
>> --- a/drivers/staging/comedi/comedi_fops.c
>> +++ b/drivers/staging/comedi/comedi_fops.c
>> @@ -676,16 +676,12 @@ EXPORT_SYMBOL_GPL(comedi_is_subdevice_running);
>> static bool __comedi_is_subdevice_running(struct comedi_subdevice *s)
>> {
>> - unsigned int runflags = __comedi_get_subdevice_runflags(s);
>> -
>> - return comedi_is_runflags_running(runflags);
>> + return
>> comedi_is_runflags_running(__comedi_get_subdevice_runflags(s));
>> }
>> bool comedi_can_auto_free_spriv(struct comedi_subdevice *s)
>> {
>> - unsigned int runflags = __comedi_get_subdevice_runflags(s);
>> -
>> - return runflags & COMEDI_SRF_FREE_SPRIV;
>> + return __comedi_get_subdevice_runflags(s) & COMEDI_SRF_FREE_SPRIV;
>> }
>> /**
>>
>
> I couldn't reproduce this checkpatch issue, even with '--subjective'.
I'm sorry, that was extremely careless of me. I used Coccinelle to find
this, not Checkpatch.
Here is the Coccinelle script I used:
@@identifier i1, i2, f1, f2; type T; expression e1, e2; statement S1, S2;@@
(
- T i1 = f1(...);
|
- T i1 = e1;
)
... when != e2 = <+...i1...+>
when != if (<+...i1...+>) S1 else S2
when != f2(...,<+...i1...+>,...)
when != i1->i2
when != i2[<+...i1...+>]
when != while(<+...i1...+>) S1
when != for(...;<+...i1...+>;...) S1
Again, I'm sorry for the confusion; I don't know why it happened, but it
won't happen again.
Nishka
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: comedi: Remove variable runflags
2019-05-31 12:47 ` Nishka Dasgupta
@ 2019-05-31 13:31 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-05-31 13:31 UTC (permalink / raw)
To: Nishka Dasgupta
Cc: Ian Abbott, hsweeten, gregkh, olsonse, jkhasdev, giulio.benetti,
nishadkamdar, kas.sandesh, devel, linux-kernel
Anyway, Greg was never going to apply this so it's not worth worrying
about too much.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-05-31 13:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30 20:51 [PATCH] staging: comedi: Remove variable runflags Nishka Dasgupta
2019-05-31 10:25 ` Ian Abbott
2019-05-31 12:47 ` Nishka Dasgupta
2019-05-31 13:31 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox