From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: IDE Linux <linux-ide@vger.kernel.org>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Doug Maxey <dwm@maxeymade.com>
Subject: [PATCH 2/3] libata-dev: pdc2027x use "long" for counter data type
Date: Fri, 12 Aug 2005 15:21:08 +0800 [thread overview]
Message-ID: <42FC4DE4.1000408@tw.ibm.com> (raw)
In-Reply-To: <42FC4B36.9080805@tw.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
Jeff,
Patch 2/3: pdc2027x use "long" for counter data type
Description:
The pdc2027x byte counter value is only 30-bit, "long" should be big enough.
Changes:
- Change the counter data type from "unsigned long" to "long".
Patch tested OK on x86, power4 and power5 machines.
For your review, thanks.
Albert
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
[-- Attachment #2: pdc2.diff --]
[-- Type: text/plain, Size: 1282 bytes --]
--- 01_pdc_mmio/drivers/scsi/pata_pdc2027x.c 2005-08-11 16:43:25.000000000 +0800
+++ 02_pdc_long/drivers/scsi/pata_pdc2027x.c 2005-08-12 11:39:32.000000000 +0800
@@ -29,7 +29,7 @@
#include <asm/io.h>
#define DRV_NAME "pata_pdc2027x"
-#define DRV_VERSION "0.70"
+#define DRV_VERSION "0.71"
#undef PDC_DEBUG
#ifdef PDC_DEBUG
@@ -481,9 +481,9 @@
* @probe_ent: for the port address
*/
-static unsigned long pdc_read_counter(struct ata_probe_ent *probe_ent)
+static long pdc_read_counter(struct ata_probe_ent *probe_ent)
{
- unsigned long counter;
+ long counter;
int retry = 1;
u32 bccrl, bccrh, bccrlv, bccrhv;
@@ -612,7 +612,7 @@
static long pdc_detect_pll_input_clock(struct ata_probe_ent *probe_ent)
{
u32 scr;
- unsigned long start_count, end_count;
+ long start_count, end_count;
long pll_clock;
/* Read current counter value */
@@ -637,9 +637,9 @@
readl(probe_ent->mmio_base + PDC_SYS_CTL); /* flush */
/* calculate the input clock in Hz */
- pll_clock = (long) ((start_count - end_count) * 10);
+ pll_clock = (start_count - end_count) * 10;
- PDPRINTK("start[%lu] end[%lu] \n", start_count, end_count);
+ PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count);
PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock);
return pll_clock;
next prev parent reply other threads:[~2005-08-12 7:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-12 7:09 [PATCH 0/3] libata-dev: pdc2027x fixes Albert Lee
2005-08-12 7:19 ` [PATCH 1/3] libata-dev: Convert pdc2027x from PIO to MMIO Albert Lee
2005-08-12 7:21 ` Albert Lee [this message]
2005-08-12 7:23 ` [PATCH 3/3] libata-dev: pdc2027x ATAPI DMA lost irq problem workaround Albert Lee
2005-08-12 7:41 ` Jeff Garzik
2005-08-12 8:20 ` Albert Lee
2005-08-12 7:37 ` [PATCH 0/3] libata-dev: pdc2027x fixes Jeff Garzik
2005-08-12 8:10 ` Albert Lee
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=42FC4DE4.1000408@tw.ibm.com \
--to=albertcc@tw.ibm.com \
--cc=bzolnier@gmail.com \
--cc=dwm@maxeymade.com \
--cc=jgarzik@pobox.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).