mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* common/ddr_spd.c:281:28: warning: bitwise comparison always evaluates to false
@ 2018-11-01 10:52 Antony Pavlov
  2018-11-07 13:31 ` Roland Hieber
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2018-11-01 10:52 UTC (permalink / raw)
  To: Alexander Smirnov; +Cc: Barebox List

Hi!

I have tried to build barebox with gcc-8.2.

I see this warning:

common/ddr_spd.c:281:28:
common/ddr_spd.c: In function ‘ddr_spd_print’:
common/ddr_spd.c:281:28: warning: bitwise comparison always evaluates to false [-Wtautological-compare]
  if ((s->mod_ranks & 0x10) == 1)
                            ^~

Git blame show me this:

f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 280)    printf("%-48s ", "DRAM Package ");
f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 281)    if ((s->mod_ranks & 0x10) == 1)
f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 282)            printf("Stack\n");
f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 283)    else
f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 284)            printf("Planar\n");

Please fix it.

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: common/ddr_spd.c:281:28: warning: bitwise comparison always evaluates to false
  2018-11-01 10:52 common/ddr_spd.c:281:28: warning: bitwise comparison always evaluates to false Antony Pavlov
@ 2018-11-07 13:31 ` Roland Hieber
  0 siblings, 0 replies; 2+ messages in thread
From: Roland Hieber @ 2018-11-07 13:31 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: Barebox List, Alexander Smirnov

On Thu, Nov 01, 2018 at 01:52:14PM +0300, Antony Pavlov wrote:
> Hi!
> 
> I have tried to build barebox with gcc-8.2.
> 
> I see this warning:
> 
> common/ddr_spd.c:281:28:
> common/ddr_spd.c: In function ‘ddr_spd_print’:
> common/ddr_spd.c:281:28: warning: bitwise comparison always evaluates to false [-Wtautological-compare]
>   if ((s->mod_ranks & 0x10) == 1)
>                             ^~

Indeed, selecting only bit 4 will never result in bit 0 being set. Is
this maybe missing a ">> 4"?

 - Roland

> 
> Git blame show me this:
> 
> f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 280)    printf("%-48s ", "DRAM Package ");
> f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 281)    if ((s->mod_ranks & 0x10) == 1)
> f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 282)            printf("Stack\n");
> f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 283)    else
> f75fe31095 (Alexander Smirnov 2015-07-03 18:58:24 +0300 284)            printf("Planar\n");
> 
> Please fix it.
> 
> -- 
> Best regards,
>   Antony Pavlov

-- 
Roland Hieber                     | r.hieber@pengutronix.de     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-11-07 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 10:52 common/ddr_spd.c:281:28: warning: bitwise comparison always evaluates to false Antony Pavlov
2018-11-07 13:31 ` Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox