All of lore.kernel.org
 help / color / mirror / Atom feed
* [4.9.1] Compiler warnings in bcache
@ 2017-01-09 18:34 Kai Krakow
  2017-01-10  5:41 ` Coly Li
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Krakow @ 2017-01-09 18:34 UTC (permalink / raw)
  To: linux-bcache

When compiling kernel 4.9.1, I'm seeing the following warnings:

In file included from ./include/linux/bio.h:23:0,
                 from drivers/md/bcache/bcache.h:181,
                 from drivers/md/bcache/writeback.c:9:
drivers/md/bcache/writeback.c: In Funktion »bch_cached_dev_writeback_init«:
./include/linux/ioprio.h:15:73: Warnung: Klammern um Arithmetik in Operand von »|« empfohlen [-Wparentheses]
 #define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
                                                                         ^
drivers/md/bcache/writeback.c:515:25: Anmerkung: bei Substitution des Makros »IOPRIO_PRIO_VALUE«
  dc->ioprio_bypass    = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NR-1);
                         ^

It suggests to put parentheses around the expression with the "|"
operand. No other kernel source files show warnings for me, so maybe it
should be fixed.

I would create a patch myself but I'm not sure if it would be correct
and sufficient to put parenthesis around "data" like this:

#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | (data))

-- 
Regards,
Kai

Replies to list-only preferred.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [4.9.1] Compiler warnings in bcache
  2017-01-09 18:34 [4.9.1] Compiler warnings in bcache Kai Krakow
@ 2017-01-10  5:41 ` Coly Li
  2017-01-10 20:51   ` Kai Krakow
  2017-01-31 19:01   ` IOPRIO_PRIO_VALUE needs parens around (data) (was: [4.9.1] Compiler warnings in bcache) Eric Wheeler
  0 siblings, 2 replies; 5+ messages in thread
From: Coly Li @ 2017-01-10  5:41 UTC (permalink / raw)
  To: Kai Krakow; +Cc: linux-bcache

On 2017/1/10 上午2:34, Kai Krakow wrote:
> When compiling kernel 4.9.1, I'm seeing the following warnings:
> 
> In file included from ./include/linux/bio.h:23:0,
>                  from drivers/md/bcache/bcache.h:181,
>                  from drivers/md/bcache/writeback.c:9:
> drivers/md/bcache/writeback.c: In Funktion »bch_cached_dev_writeback_init«:
> ./include/linux/ioprio.h:15:73: Warnung: Klammern um Arithmetik in Operand von »|« empfohlen [-Wparentheses]
>  #define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
>                                                                          ^
> drivers/md/bcache/writeback.c:515:25: Anmerkung: bei Substitution des Makros »IOPRIO_PRIO_VALUE«
>   dc->ioprio_bypass    = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NR-1);
>                          ^
> 
> It suggests to put parentheses around the expression with the "|"
> operand. No other kernel source files show warnings for me, so maybe it
> should be fixed.
> 
> I would create a patch myself but I'm not sure if it would be correct
> and sufficient to put parenthesis around "data" like this:
> 
> #define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | (data))
> 

Hi Kai Krakow,

This fix is necessary, please send a patch to IOPRIO_PRIO_VALUE().

BTW, I don't see dc->ioprio_bypass from upstream kernel source, is it
from a development tree ?


-- 
Coly Li

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [4.9.1] Compiler warnings in bcache
  2017-01-10  5:41 ` Coly Li
@ 2017-01-10 20:51   ` Kai Krakow
  2017-01-15  9:36     ` Coly Li
  2017-01-31 19:01   ` IOPRIO_PRIO_VALUE needs parens around (data) (was: [4.9.1] Compiler warnings in bcache) Eric Wheeler
  1 sibling, 1 reply; 5+ messages in thread
From: Kai Krakow @ 2017-01-10 20:51 UTC (permalink / raw)
  To: Coly Li; +Cc: linux-bcache, Eric Wheeler

Am Tue, 10 Jan 2017 13:41:25 +0800
schrieb Coly Li <i@coly.li>:

> On 2017/1/10 上午2:34, Kai Krakow wrote:
> > When compiling kernel 4.9.1, I'm seeing the following warnings:
> > 
> > In file included from ./include/linux/bio.h:23:0,
> >                  from drivers/md/bcache/bcache.h:181,
> >                  from drivers/md/bcache/writeback.c:9:
> > drivers/md/bcache/writeback.c: In Funktion
> > »bch_cached_dev_writeback_init«: ./include/linux/ioprio.h:15:73:
> > Warnung: Klammern um Arithmetik in Operand von »|« empfohlen
> > [-Wparentheses] #define IOPRIO_PRIO_VALUE(class, data) (((class) <<
> > IOPRIO_CLASS_SHIFT) | data) ^ drivers/md/bcache/writeback.c:515:25:
> > Anmerkung: bei Substitution des Makros »IOPRIO_PRIO_VALUE«
> > dc->ioprio_bypass    = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE,
> > IOPRIO_BE_NR-1); ^
> > 
> > It suggests to put parentheses around the expression with the "|"
> > operand. No other kernel source files show warnings for me, so
> > maybe it should be fixed.
> > 
> > I would create a patch myself but I'm not sure if it would be
> > correct and sufficient to put parenthesis around "data" like this:
> > 
> > #define IOPRIO_PRIO_VALUE(class, data) (((class) <<
> > IOPRIO_CLASS_SHIFT) | (data)) 
> 
> Hi Kai Krakow,
> 
> This fix is necessary, please send a patch to IOPRIO_PRIO_VALUE().
> 
> BTW, I don't see dc->ioprio_bypass from upstream kernel source, is it
> from a development tree ?

Ahhh... This is from Erics ioprio bypass patches. I'm still using the
4.8 patchset with 4.9. Maybe it has been updated meanwhile?

-- 
Regards,
Kai

Replies to list-only preferred.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [4.9.1] Compiler warnings in bcache
  2017-01-10 20:51   ` Kai Krakow
@ 2017-01-15  9:36     ` Coly Li
  0 siblings, 0 replies; 5+ messages in thread
From: Coly Li @ 2017-01-15  9:36 UTC (permalink / raw)
  To: Kai Krakow; +Cc: linux-bcache, Eric Wheeler

On 2017/1/11 上午4:51, Kai Krakow wrote:
> Am Tue, 10 Jan 2017 13:41:25 +0800
> schrieb Coly Li <i@coly.li>:
> 
>> On 2017/1/10 上午2:34, Kai Krakow wrote:
>>> When compiling kernel 4.9.1, I'm seeing the following warnings:
>>>
>>> In file included from ./include/linux/bio.h:23:0,
>>>                  from drivers/md/bcache/bcache.h:181,
>>>                  from drivers/md/bcache/writeback.c:9:
>>> drivers/md/bcache/writeback.c: In Funktion
>>> »bch_cached_dev_writeback_init«: ./include/linux/ioprio.h:15:73:
>>> Warnung: Klammern um Arithmetik in Operand von »|« empfohlen
>>> [-Wparentheses] #define IOPRIO_PRIO_VALUE(class, data) (((class) <<
>>> IOPRIO_CLASS_SHIFT) | data) ^ drivers/md/bcache/writeback.c:515:25:
>>> Anmerkung: bei Substitution des Makros »IOPRIO_PRIO_VALUE«
>>> dc->ioprio_bypass    = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE,
>>> IOPRIO_BE_NR-1); ^
>>>
>>> It suggests to put parentheses around the expression with the "|"
>>> operand. No other kernel source files show warnings for me, so
>>> maybe it should be fixed.
>>>
>>> I would create a patch myself but I'm not sure if it would be
>>> correct and sufficient to put parenthesis around "data" like this:
>>>
>>> #define IOPRIO_PRIO_VALUE(class, data) (((class) <<
>>> IOPRIO_CLASS_SHIFT) | (data)) 
>>
>> Hi Kai Krakow,
>>
>> This fix is necessary, please send a patch to IOPRIO_PRIO_VALUE().
>>
>> BTW, I don't see dc->ioprio_bypass from upstream kernel source, is it
>> from a development tree ?
> 
> Ahhh... This is from Erics ioprio bypass patches. I'm still using the
> 4.8 patchset with 4.9. Maybe it has been updated meanwhile?
> 

Understand. Please compose a patch for this fix, thank you in advance :-)

-- 
Coly Li

^ permalink raw reply	[flat|nested] 5+ messages in thread

* IOPRIO_PRIO_VALUE needs parens around (data)  (was: [4.9.1] Compiler warnings in bcache)
  2017-01-10  5:41 ` Coly Li
  2017-01-10 20:51   ` Kai Krakow
@ 2017-01-31 19:01   ` Eric Wheeler
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Wheeler @ 2017-01-31 19:01 UTC (permalink / raw)
  To: Coly Li; +Cc: Kai Krakow, linux-bcache, linux-block

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1913 bytes --]

On Tue, 10 Jan 2017, Coly Li wrote:
> On 2017/1/10 上午2:34, Kai Krakow wrote:
> > When compiling kernel 4.9.1, I'm seeing the following warnings:
> > 
> > In file included from ./include/linux/bio.h:23:0,
> >                  from drivers/md/bcache/bcache.h:181,
> >                  from drivers/md/bcache/writeback.c:9:
> > drivers/md/bcache/writeback.c: In Funktion »bch_cached_dev_writeback_init«:
> > ./include/linux/ioprio.h:15:73: Warnung: Klammern um Arithmetik in Operand von »|« empfohlen [-Wparentheses]
> >  #define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
> >                                                                          ^
> > drivers/md/bcache/writeback.c:515:25: Anmerkung: bei Substitution des Makros »IOPRIO_PRIO_VALUE«
> >   dc->ioprio_bypass    = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, IOPRIO_BE_NR-1);
> >                          ^
> > 
> > It suggests to put parentheses around the expression with the "|"
> > operand. No other kernel source files show warnings for me, so maybe it
> > should be fixed.
> > 
> > I would create a patch myself but I'm not sure if it would be correct
> > and sufficient to put parenthesis around "data" like this:
> > 
> > #define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | (data))

I caught that before submitting to Jens, so its in 4.10.  I agree with 
Coly, however, that (data) should be added but I'm unable to do that at 
the moment.


--
Eric Wheeler



> > 
> 
> Hi Kai Krakow,
> 
> This fix is necessary, please send a patch to IOPRIO_PRIO_VALUE().
> 
> BTW, I don't see dc->ioprio_bypass from upstream kernel source, is it
> from a development tree ?
> 
> 
> -- 
> Coly Li
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-31 19:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-09 18:34 [4.9.1] Compiler warnings in bcache Kai Krakow
2017-01-10  5:41 ` Coly Li
2017-01-10 20:51   ` Kai Krakow
2017-01-15  9:36     ` Coly Li
2017-01-31 19:01   ` IOPRIO_PRIO_VALUE needs parens around (data) (was: [4.9.1] Compiler warnings in bcache) Eric Wheeler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.