Commit 6cdb275a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Better names for EDD legacy_* fields

From: "Patrick J. LoPresti" <patl@users.sourceforge.net>

Renames legacy_heads to legacy_max_head legacy_sectors to
legacy_sectors_per_track.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a3ef80c4
......@@ -320,7 +320,7 @@ edd_show_info_flags(struct edd_device *edev, char *buf)
}
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;
......@@ -330,12 +330,12 @@ edd_show_legacy_cylinders(struct edd_device *edev, char *buf)
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;
......@@ -345,12 +345,12 @@ edd_show_legacy_heads(struct edd_device *edev, char *buf)
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;
......@@ -360,7 +360,7 @@ edd_show_legacy_sectors(struct edd_device *edev, char *buf)
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);
}
......@@ -436,7 +436,7 @@ edd_show_sectors(struct edd_device *edev, char *buf)
*/
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)
......@@ -444,11 +444,11 @@ edd_has_legacy_cylinders(struct edd_device *edev)
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)
......@@ -456,11 +456,11 @@ edd_has_legacy_heads(struct edd_device *edev)
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)
......@@ -468,7 +468,7 @@ edd_has_legacy_sectors(struct edd_device *edev)
info = edd_dev_get_info(edev);
if (!info)
return -EINVAL;
return info->legacy_sectors > 0;
return info->legacy_sectors_per_track > 0;
}
static int
......@@ -555,12 +555,14 @@ static EDD_DEVICE_ATTR(version, 0444, edd_show_version, NULL);
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,
......@@ -587,9 +589,9 @@ static struct attribute * def_attrs[] = {
/* 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,
......
......@@ -166,9 +166,9 @@ struct edd_info {
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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment