All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: David Binderman <dcb314@hotmail.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: "mchehab@kernel.org" <mchehab@kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: edac/i7300_edac.c:307: strange macro ?
Date: Wed, 11 Jan 2017 23:58:30 +0100	[thread overview]
Message-ID: <20170111225830.xkqrvrfzv4swcrik@pd.tnic> (raw)
In-Reply-To: <VI1PR08MB1022F62928A4F5D396DA8FFD9C660@VI1PR08MB1022.eurprd08.prod.outlook.com>

On Wed, Jan 11, 2017 at 04:48:51PM +0000, David Binderman wrote:
> Hello there,
> 
> drivers/edac/i7300_edac.c:307:32: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]

Are you adding some other -W-switches to the kernel Makefile?

:-)

> Source code is
> 
>   #define IS_SECOND_CH(v)   ((v) * (1 << 17))

Looks like a bug to me. According to the chipset doc, bit 17 in REDMEMB
is the locator bit for CS[3:2] which probably means the second channel
but multiplying the full register value with 131072 looks wrong.

> Maybe better code
> 
>   #define IS_SECOND_CH(v)   ((v) & (1 << 17))

Yap.

Mauro, what's up?

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

       reply	other threads:[~2017-01-11 22:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VI1PR08MB1022F62928A4F5D396DA8FFD9C660@VI1PR08MB1022.eurprd08.prod.outlook.com>
2017-01-11 22:58 ` Borislav Petkov [this message]
     [not found]   ` <VI1PR08MB1022FEBA2CB88AE10D7319DA9C660@VI1PR08MB1022.eurprd08.prod.outlook.com>
2017-01-25 11:58     ` edac/i7300_edac.c:307: strange macro ? Borislav Petkov
     [not found]       ` <VI1PR08MB102297E01770CE3D7CF4F17A9C740@VI1PR08MB1022.eurprd08.prod.outlook.com>
2017-01-25 15:37         ` Borislav Petkov
2017-01-26  8:57           ` Mauro Carvalho Chehab
2017-01-26 10:36             ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170111225830.xkqrvrfzv4swcrik@pd.tnic \
    --to=bp@alien8.de \
    --cc=dcb314@hotmail.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.