summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-19 16:48:19 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-19 16:48:19 -0700
commit43b3ae31727836ef0e9c7348fa98c462a47b52aa (patch)
tree00ff02577f0e298c96bb523cbe755e0a99657aa2 /linux
parent0fa4369624b4637a7e36ed22e89a759031f08327 (diff)
downloadsyslinux-43b3ae31727836ef0e9c7348fa98c462a47b52aa.tar.gz
Standardize the names SECTOR_SIZE and SECTOR_SHIFT
Use the names SECTOR_SIZE and SECTOR_SHIFT everywhere, instead of an odd mix of symbols and hard-coded constants. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/syslinux.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/linux/syslinux.c b/linux/syslinux.c
index e1b464ec..10c089c0 100644
--- a/linux/syslinux.c
+++ b/linux/syslinux.c
@@ -53,7 +53,7 @@
# define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, uint32_t)
#endif
#undef SECTOR_SIZE
-#undef SECTOR_BITS
+#undef SECTOR_SHIFT
#include <paths.h>
#ifndef _PATH_MOUNT
@@ -176,7 +176,7 @@ int make_block_map(uint32_t *sectors, int len, int dev_fd, int fd)
if (ioctl(fd, FIGETBSZ, &blocksize) < 0)
die("ioctl FIGETBSZ failed");
- blocksize >>= SECTOR_BITS; /* sectors/block */
+ blocksize >>= SECTOR_SHIFT; /* sectors/block */
nblock = 0;
while (len > 0) {
@@ -190,7 +190,7 @@ int make_block_map(uint32_t *sectors, int len, int dev_fd, int fd)
*sectors++ = (block*blocksize)+i;
nsectors++;
- len -= (1 << SECTOR_BITS);
+ len -= (1 << SECTOR_SHIFT);
}
}
@@ -519,7 +519,7 @@ int main(int argc, char *argv[])
/*
* Create a block map.
*/
- ldlinux_sectors = (syslinux_ldlinux_len+SECTOR_SIZE-1) >> SECTOR_BITS;
+ ldlinux_sectors = (syslinux_ldlinux_len+SECTOR_SIZE-1) >> SECTOR_SHIFT;
sectors = calloc(ldlinux_sectors, sizeof *sectors);
nsectors = make_block_map(sectors, syslinux_ldlinux_len, dev_fd, fd);
@@ -538,14 +538,14 @@ umount:
* Patch ldlinux.sys and the boot sector
*/
i = syslinux_patch(sectors, nsectors, stupid, raid_mode);
- patch_sectors = (i + SECTOR_SIZE - 1) >> SECTOR_BITS;
+ patch_sectors = (i + SECTOR_SIZE - 1) >> SECTOR_SHIFT;
/*
* Write the now-patched first sectors of ldlinux.sys
*/
for (i = 0; i < patch_sectors; i++) {
xpwrite(dev_fd, syslinux_ldlinux + i*SECTOR_SIZE, SECTOR_SIZE,
- filesystem_offset+((off_t)sectors[i] << SECTOR_BITS));
+ filesystem_offset+((off_t)sectors[i] << SECTOR_SHIFT));
}
/*