From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Grant Grundler <grundler@google.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
akpm@linux-foundation.org, linux-scsi@vger.kernel.org,
fujita.tomonori@lab.ntt.co.jp
Subject: Re: [patch 13/17] drivers/scsi/initio.c: suppress compile warning
Date: Fri, 28 Mar 2008 22:09:16 -0500 [thread overview]
Message-ID: <1206760156.3662.79.camel@localhost.localdomain> (raw)
In-Reply-To: <da824cf30803281749l614c3592t89cce073c9b043c8@mail.gmail.com>
On Fri, 2008-03-28 at 17:49 -0700, Grant Grundler wrote:
> On Fri, Mar 28, 2008 at 4:51 PM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> ...
> > So basically, most of the cpu_to_le32 in this driver look wrong. If I
> > can fix it (or persuade someone else to fix it) can anyone test it on a
> > BE platform?
>
> But the code I submitted the patch is also broken for LE platforms.
> (As you pointed out earlier and was my original incentive for
> submitting the patch).
No ... it's correct on a LE platform .. the warning is superfluous we
promote a u8 to a u32 and then complain when it's truncated to a u8
again.
> If most of the usage is wrong anyway, perhaps it's better to
> not pretend the driver can work on a BE platform and just rip
> all the cpu_to_le32() usage out...including the one I submitted
> the patch for. Either way, that change should go in. Right?
Well, not really; the problem is it's not complete ... it only covers up
the real problem by silencing the warning.
If the actual BE pieces of the driver worked, you could make it correct
either by making senselen a u32 and leaving the cpu_to_le32 or adding it
to the point at which we assign it to bufflen.
If you can verify my analysis of the way the driver works, then the
complete fix should be pretty simple: just remove the cpu_to_le32 from
everywhere except the sg list construction.
James
next prev parent reply other threads:[~2008-03-29 3:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:48 [patch 13/17] drivers/scsi/initio.c: suppress compile warning akpm
2008-03-28 21:55 ` Grant Grundler
2008-03-28 22:13 ` Andrew Morton
2008-03-28 22:26 ` James Bottomley
2008-03-28 22:43 ` Alan Cox
2008-03-28 23:51 ` James Bottomley
2008-03-29 0:49 ` Grant Grundler
2008-03-29 3:09 ` James Bottomley [this message]
2008-03-31 4:50 ` Grant Grundler
2008-03-31 14:56 ` James Bottomley
2008-03-31 16:23 ` Grant Grundler
2008-04-04 7:05 ` Grant Grundler
2008-04-05 16:14 ` Grant Grundler
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=1206760156.3662.79.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=grundler@google.com \
--cc=linux-scsi@vger.kernel.org \
/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