public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@ge.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: nick <nickkrause@sympatico.ca>, <manohar.vanga@gmail.com>,
	<gregkh@linuxfoundation.org>, <devel@driverdev.osuosl.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]‏‏
Date: Mon, 16 Jun 2014 11:08:30 +0100	[thread overview]
Message-ID: <539EC21E.8030909@ge.com> (raw)
In-Reply-To: <20140616095631.GN5015@mwanda>

On 16/06/14 10:56, Dan Carpenter wrote:
> On Mon, Jun 16, 2014 at 10:47:25AM +0100, Martyn Welch wrote:
>> Nick,
>>
>> Sorry for the delay in responding.
>>
>> I'm staring at the manual for the ca91c142 and the relevant bits in
>> the VSIx_CTL registers definitely need to be set to 0 for A16,
>> likewise with the LM_CTL register. The pattern (3<<16) would enable
>> one of the "reserved" address spaces.
>>
>
> Nick emailed me privately that this was a static checker warning.  These
> warnings are often false positives...  But I'm worried about the test:
>
> 	if ((ctl & CA91CX42_VSI_CTL_VAS_M) == CA91CX42_VSI_CTL_VAS_A16)
> 		*aspace = VME_A16;
>
> That could be true when we didn't intend it.
>

If I'm not mistaken, CA91CX42_VSI_CTL_VAS_A16 is currently defined as 0.

So:
	if ((ctl & (7<<16) == 0)
		*aspace = VME_A16;

Which looks right to me, it's checking to see if the relevant bits in 
the register are all zero, am I missing something obvious?

Martyn


-- 
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms               | (3828642) at 100 Barbirolli Square
T +44(0)1327322748                     | Manchester, M2 3AB
E martyn.welch@ge.com                  | VAT:GB 927559189

  reply	other threads:[~2014-06-16 12:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 14:33 PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]‏‏ nick
2014-06-12 15:10 ` Dan Carpenter
2014-06-12 20:52   ` Dan Carpenter
2014-06-16  9:47 ` Martyn Welch
2014-06-16  9:56   ` Dan Carpenter
2014-06-16 10:08     ` Martyn Welch [this message]
     [not found] <SNT145-W1D429653B80A40C499048A52A0@phx.gbl>
2014-06-12  5:19 ` PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]‏ gregkh
  -- strict thread matches above, loose matches on Subject: below --
2014-06-12  3:44 PATCH[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix] Nick Krause
2014-06-12  3:53 ` gregkh

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=539EC21E.8030909@ge.com \
    --to=martyn.welch@ge.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@gmail.com \
    --cc=nickkrause@sympatico.ca \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox