From: "Patrick J. LoPresti" <patl@users.sourceforge.net>
To: akpm@osdl.org
Cc: Matt Domsch <Matt_Domsch@dell.com>,
Andries Brouwer <Andries.Brouwer@cwi.nl>,
linux-kernel@vger.kernel.org
Subject: [PATCH] Use decimal instead of hex for EDD values
Date: 02 Jun 2004 19:53:23 -0400 [thread overview]
Message-ID: <s5gd64h7cf9.fsf@patl=users.sf.net> (raw)
In-Reply-To: <20040602150051.GA3165@lists.us.dell.com>
[-- Attachment #1: Type: text/plain, Size: 816 bytes --]
Matt Domsch <Matt_Domsch@dell.com> writes:
> Whatever, scanf works with either representation. Patrick, if
> you're changing the above, feel free to submit a second patch to
> switch these all to %u instead.
OK, the attached patch causes the EDD module to export numeric values
as decimal instead of hex, with two exceptions. I left "version"
alone since 0x21 (for example) actually means version 2.1. And I left
"mbr_signature" alone since hex seems the more natural representation
for something which is literally just a sequence of four bytes.
So this patch changes default_cylinders, default_heads,
default_sectors_per_track, legacy_max_cylinder, legacy_max_head,
legacy_sectors_per_track, and sectors to decimal. It depends upon the
other patch I just sent (renaming the three legacy_* fields).
- Pat
[-- Attachment #2: edd_decimal.txt --]
[-- Type: text/plain, Size: 1697 bytes --]
--- linux-2.6.6-renamed/drivers/firmware/edd.c 2004-06-02 19:17:26.000000000 -0400
+++ linux-2.6.6/drivers/firmware/edd.c 2004-06-02 19:42:25.000000000 -0400
@@ -344,7 +344,7 @@
if (!info || !buf)
return -EINVAL;
- p += snprintf(p, left, "0x%x\n", info->legacy_max_cylinder);
+ p += snprintf(p, left, "%u\n", info->legacy_max_cylinder);
return (p - buf);
}
@@ -359,7 +359,7 @@
if (!info || !buf)
return -EINVAL;
- p += snprintf(p, left, "0x%x\n", info->legacy_max_head);
+ p += snprintf(p, left, "%u\n", info->legacy_max_head);
return (p - buf);
}
@@ -374,7 +374,7 @@
if (!info || !buf)
return -EINVAL;
- p += snprintf(p, left, "0x%x\n", info->legacy_sectors_per_track);
+ p += snprintf(p, left, "%u\n", info->legacy_sectors_per_track);
return (p - buf);
}
@@ -389,7 +389,7 @@
if (!info || !buf)
return -EINVAL;
- p += scnprintf(p, left, "0x%x\n", info->params.num_default_cylinders);
+ p += scnprintf(p, left, "%u\n", info->params.num_default_cylinders);
return (p - buf);
}
@@ -404,7 +404,7 @@
if (!info || !buf)
return -EINVAL;
- p += scnprintf(p, left, "0x%x\n", info->params.num_default_heads);
+ p += scnprintf(p, left, "%u\n", info->params.num_default_heads);
return (p - buf);
}
@@ -419,7 +419,7 @@
if (!info || !buf)
return -EINVAL;
- p += scnprintf(p, left, "0x%x\n", info->params.sectors_per_track);
+ p += scnprintf(p, left, "%u\n", info->params.sectors_per_track);
return (p - buf);
}
@@ -434,7 +434,7 @@
if (!info || !buf)
return -EINVAL;
- p += scnprintf(p, left, "0x%llx\n", info->params.number_of_sectors);
+ p += scnprintf(p, left, "%llu\n", info->params.number_of_sectors);
return (p - buf);
}
next prev parent reply other threads:[~2004-06-02 23:53 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-30 18:04 2.6.x partition breakage and dual booting Jeff Garzik
2004-05-30 18:36 ` Andries Brouwer
2004-05-30 18:56 ` Jeff Garzik
2004-05-30 20:03 ` Andries Brouwer
2004-05-30 20:47 ` viro
2004-05-30 21:06 ` Andries Brouwer
2004-05-30 21:08 ` Andreas Schwab
2004-05-30 21:14 ` viro
2004-05-30 21:02 ` Patrick J. LoPresti
2004-05-30 22:20 ` Andries Brouwer
[not found] ` <mit.lcs.mail.linux-kernel/20040530222001.GD4681@apps.cwi.nl>
2004-05-30 22:54 ` Patrick J. LoPresti
2004-05-31 18:08 ` Tomas Szepe
2004-05-31 19:19 ` Frediano Ziglio
2004-05-31 20:06 ` Patrick J. LoPresti
2004-05-31 21:03 ` Sean Estabrooks
2004-06-01 15:10 ` Patrick J. LoPresti
2004-06-01 23:55 ` Andries Brouwer
2004-06-02 13:02 ` Patrick J. LoPresti
2004-06-02 15:00 ` Matt Domsch
2004-06-02 21:22 ` [PATCH] Better names for EDD legacy_* fields Patrick J. LoPresti
2004-06-02 23:03 ` Andries Brouwer
2004-06-02 23:38 ` Patrick J. LoPresti
2004-06-02 23:53 ` Patrick J. LoPresti [this message]
2004-06-01 16:28 ` 2.6.x partition breakage and dual booting Stephen Hemminger
2004-06-03 6:51 ` Frediano Ziglio
2004-06-03 10:39 ` Andries Brouwer
2004-06-03 12:30 ` Frediano Ziglio
2004-06-03 14:35 ` Bartlomiej Zolnierkiewicz
2004-06-03 15:11 ` Andries Brouwer
2004-06-03 14:46 ` Patrick J. LoPresti
2004-06-03 15:32 ` Bartlomiej Zolnierkiewicz
2004-06-03 15:55 ` Patrick J. LoPresti
2004-05-30 19:35 ` Patrick J. LoPresti
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='s5gd64h7cf9.fsf@patl=users.sf.net' \
--to=patl@users.sourceforge.net \
--cc=Andries.Brouwer@cwi.nl \
--cc=Matt_Domsch@dell.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@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