staging: comedi: Remove variable runflags
PATCH 1/1 staging: comedi: Remove variable runflags
Remove variable runflags and use its value directly. Issue found with checkpatch.
--- drivers/staging/comedi/comedi_fops.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/comedi/comedi_fops.c +2 -6
@@ -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 ; }/**
Signature · 1 line
2.19.1
Quoted 22 lines · Nishka Dasgupta
Remove variable runflags and use its value directly. Issue found with checkpatch.
Signed-off-by Nishka Dasgupta <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/staging/comedi/comedi_fops.c +1
-3@@ -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)); }
drivers/staging/comedi/comedi_fops.c EXPORT_SYMBOL_GPL(comedi_is_subdevice_running); · line 687
Quoted 10 lines
drivers/staging/comedi/comedi_fops.c +1
-3bool 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'.
Signature · 4 lines
-=( Ian Abbott <[email protected]> || 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. )=-
Quoted 25 lines · Ian Abbott
Quoted 24 lines · Nishka Dasgupta
Remove variable runflags and use its value directly. Issue found with checkpatch.
Signed-off-by Nishka Dasgupta <[email protected]>---
drivers/staging/comedi/comedi_fops.c| 8 ++------1 file changed, 2 insertions(+), 6 deletions(-)drivers/staging/comedi/comedi_fops.c +1
-4@@ -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); + returncomedi_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);
Quoted 8 lines
drivers/staging/comedi/comedi_fops.c EXPORT_SYMBOL_GPL(comedi_is_subdevice_running);
Quoted 6 lines
drivers/staging/comedi/comedi_fops.c +1
-2- - 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...+>;...) S1Again, I'm sorry for the confusion; I don't know why it happened, but it won't happen again.
Nishka
Anyway, Greg was never going to apply this so it's not worth worrying about too much.
regards,
dan carpenter