From: akpm@linux-foundation.org
To: jeff@garzik.org
Cc: linux-ide@vger.kernel.org, akpm@linux-foundation.org,
harvey.harrison@gmail.com, alan@lxorguk.ukuu.org.uk
Subject: [patch 2/2] pata_amd: fix sparse warning
Date: Fri, 28 Mar 2008 14:33:56 -0700 [thread overview]
Message-ID: <200803282133.m2SLXutE011470@imap1.linux-foundation.org> (raw)
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;
if (ata_timing_compute(adev, speed, &at, T, UT) < 0) {
dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed);
_
next reply other threads:[~2008-03-28 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:33 akpm [this message]
2008-03-29 16:17 ` [patch 2/2] pata_amd: fix sparse warning Jeff Garzik
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=200803282133.m2SLXutE011470@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=harvey.harrison@gmail.com \
--cc=jeff@garzik.org \
--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).