From: "Patrick J. LoPresti" <patl@users.sourceforge.net>
To: Andries Brouwer <Andries.Brouwer@cwi.nl>
Cc: akpm@osdl.org, Matt Domsch <Matt_Domsch@dell.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Better names for EDD legacy_* fields
Date: 02 Jun 2004 19:38:40 -0400 [thread overview]
Message-ID: <s5gise97cy5.fsf@patl=users.sf.net> (raw)
In-Reply-To: <20040602230309.GR23408@apps.cwi.nl>
[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]
Andries Brouwer <Andries.Brouwer@cwi.nl> writes:
> Ach - I should have been more explicit instead of saying (etc.).
> Also legacy_cylinders is really legacy_max_cylinder (one less than
> the number of cylinders).
In my defense, I barely even thought about the cylinder count. I only
included it for completeness... It is meaningless on drives larger
than 8G, and even on older/smaller drives, it is kind of bogus.
According to <http://www.ctyme.com/intr/rb-0621.htm>:
The maximum cylinder number reported in CX is usually two less
than the total cylinder count reported in the fixed disk parameter
table (see INT 41h,INT 46h) because early hard disks used the last
cylinder for testing purposes; however, on some Zenith machines,
the maximum cylinder number reportedly is three less than the
count in the fixed disk parameter table.
So it is not "one less", but often two or three...
Nevertheless, you are correct. Revised trivial search&replace patch
attached.
- Pat
[-- Attachment #2: rename_edd_legacy.txt --]
[-- Type: text/plain, Size: 4542 bytes --]
diff -u -r linux-2.6.6-orig/drivers/firmware/edd.c linux-2.6.6/drivers/firmware/edd.c
--- linux-2.6.6-orig/drivers/firmware/edd.c 2004-05-09 22:32:27.000000000 -0400
+++ linux-2.6.6/drivers/firmware/edd.c 2004-06-02 19:17:26.000000000 -0400
@@ -334,7 +334,7 @@
}
static ssize_t
-edd_show_legacy_cylinders(struct edd_device *edev, char *buf)
+edd_show_legacy_max_cylinder(struct edd_device *edev, char *buf)
{
struct edd_info *info;
char *p = buf;
@@ -344,12 +344,12 @@
if (!info || !buf)
return -EINVAL;
- p += snprintf(p, left, "0x%x\n", info->legacy_cylinders);
+ p += snprintf(p, left, "0x%x\n", info->legacy_max_cylinder);
return (p - buf);
}
static ssize_t
-edd_show_legacy_heads(struct edd_device *edev, char *buf)
+edd_show_legacy_max_head(struct edd_device *edev, char *buf)
{
struct edd_info *info;
char *p = buf;
@@ -359,12 +359,12 @@
if (!info || !buf)
return -EINVAL;
- p += snprintf(p, left, "0x%x\n", info->legacy_heads);
+ p += snprintf(p, left, "0x%x\n", info->legacy_max_head);
return (p - buf);
}
static ssize_t
-edd_show_legacy_sectors(struct edd_device *edev, char *buf)
+edd_show_legacy_sectors_per_track(struct edd_device *edev, char *buf)
{
struct edd_info *info;
char *p = buf;
@@ -374,7 +374,7 @@
if (!info || !buf)
return -EINVAL;
- p += snprintf(p, left, "0x%x\n", info->legacy_sectors);
+ p += snprintf(p, left, "0x%x\n", info->legacy_sectors_per_track);
return (p - buf);
}
@@ -450,7 +450,7 @@
*/
static int
-edd_has_legacy_cylinders(struct edd_device *edev)
+edd_has_legacy_max_cylinder(struct edd_device *edev)
{
struct edd_info *info;
if (!edev)
@@ -458,11 +458,11 @@
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL;
- return info->legacy_cylinders > 0;
+ return info->legacy_max_cylinder > 0;
}
static int
-edd_has_legacy_heads(struct edd_device *edev)
+edd_has_legacy_max_head(struct edd_device *edev)
{
struct edd_info *info;
if (!edev)
@@ -470,11 +470,11 @@
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL;
- return info->legacy_heads > 0;
+ return info->legacy_max_head > 0;
}
static int
-edd_has_legacy_sectors(struct edd_device *edev)
+edd_has_legacy_sectors_per_track(struct edd_device *edev)
{
struct edd_info *info;
if (!edev)
@@ -482,7 +482,7 @@
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL;
- return info->legacy_sectors > 0;
+ return info->legacy_sectors_per_track > 0;
}
static int
@@ -569,12 +569,14 @@
static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, NULL);
static EDD_DEVICE_ATTR(info_flags, 0444, edd_show_info_flags, NULL);
static EDD_DEVICE_ATTR(sectors, 0444, edd_show_sectors, NULL);
-static EDD_DEVICE_ATTR(legacy_cylinders, 0444, edd_show_legacy_cylinders,
- edd_has_legacy_cylinders);
-static EDD_DEVICE_ATTR(legacy_heads, 0444, edd_show_legacy_heads,
- edd_has_legacy_heads);
-static EDD_DEVICE_ATTR(legacy_sectors, 0444, edd_show_legacy_sectors,
- edd_has_legacy_sectors);
+static EDD_DEVICE_ATTR(legacy_max_cylinder, 0444,
+ edd_show_legacy_max_cylinder,
+ edd_has_legacy_max_cylinder);
+static EDD_DEVICE_ATTR(legacy_max_head, 0444, edd_show_legacy_max_head,
+ edd_has_legacy_max_head);
+static EDD_DEVICE_ATTR(legacy_sectors_per_track, 0444,
+ edd_show_legacy_sectors_per_track,
+ edd_has_legacy_sectors_per_track);
static EDD_DEVICE_ATTR(default_cylinders, 0444, edd_show_default_cylinders,
edd_has_default_cylinders);
static EDD_DEVICE_ATTR(default_heads, 0444, edd_show_default_heads,
@@ -601,9 +603,9 @@
/* These attributes are conditional and only added for some devices. */
static struct edd_attribute * edd_attrs[] = {
- &edd_attr_legacy_cylinders,
- &edd_attr_legacy_heads,
- &edd_attr_legacy_sectors,
+ &edd_attr_legacy_max_cylinder,
+ &edd_attr_legacy_max_head,
+ &edd_attr_legacy_sectors_per_track,
&edd_attr_default_cylinders,
&edd_attr_default_heads,
&edd_attr_default_sectors_per_track,
diff -u -r linux-2.6.6-orig/include/linux/edd.h linux-2.6.6/include/linux/edd.h
--- linux-2.6.6-orig/include/linux/edd.h 2004-06-02 16:12:17.000000000 -0400
+++ linux-2.6.6/include/linux/edd.h 2004-06-02 19:16:57.000000000 -0400
@@ -166,9 +166,9 @@
u8 device;
u8 version;
u16 interface_support;
- u16 legacy_cylinders;
- u8 legacy_heads;
- u8 legacy_sectors;
+ u16 legacy_max_cylinder;
+ u8 legacy_max_head;
+ u8 legacy_sectors_per_track;
struct edd_device_params params;
} __attribute__ ((packed));
next prev parent reply other threads:[~2004-06-02 23:39 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 [this message]
2004-06-02 23:53 ` [PATCH] Use decimal instead of hex for EDD values Patrick J. LoPresti
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='s5gise97cy5.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