From: Jeff Garzik <jeff@garzik.org>
To: akpm@linux-foundation.org
Cc: linux-ide@vger.kernel.org, harvey.harrison@gmail.com,
alan@lxorguk.ukuu.org.uk
Subject: Re: [patch 2/2] pata_amd: fix sparse warning
Date: Sat, 29 Mar 2008 12:17:08 -0400 [thread overview]
Message-ID: <47EE6B84.4070907@garzik.org> (raw)
In-Reply-To: <200803282133.m2SLXutE011470@imap1.linux-foundation.org>
akpm@linux-foundation.org wrote:
> From: Harvey Harrison <harvey.harrison@gmail.com>
>
> Current code is essentially choosing between dividing by 1 or
> dividing by two, make the conditions a little more obvious.
>
> As a bonus, removes a sparse error:
> drivers/ata/pata_amd.c:59:11: warning: symbol '__x' shadows an earlier one
> drivers/ata/pata_amd.c:59:11: originally declared here
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/ata/pata_amd.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff -puN drivers/ata/pata_amd.c~pata_amd-fix-sparse-warning drivers/ata/pata_amd.c
> --- a/drivers/ata/pata_amd.c~pata_amd-fix-sparse-warning
> +++ a/drivers/ata/pata_amd.c
> @@ -56,7 +56,9 @@ static void timing_setup(struct ata_port
> u8 t;
>
> T = 1000000000 / amd_clock;
> - UT = T / min_t(int, max_t(int, clock, 1), 2);
> + UT = T;
> + if (clock >= 2)
> + UT = T / 2;
Why assign UT twice, potentially?
next prev parent reply other threads:[~2008-03-29 16:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:33 [patch 2/2] pata_amd: fix sparse warning akpm
2008-03-29 16:17 ` Jeff Garzik [this message]
2008-03-31 3:12 ` Grant Grundler
2008-04-04 7:39 ` Jeff Garzik
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=47EE6B84.4070907@garzik.org \
--to=jeff@garzik.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=harvey.harrison@gmail.com \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).