summaryrefslogtreecommitdiffstats
path: root/fdisks/fdisksgilabel.c
diff options
context:
space:
mode:
authorKarel Zak2013-05-29 14:23:56 +0200
committerKarel Zak2013-09-16 16:46:57 +0200
commit5105f75f6765cf8de2770caf9ae0d3b4851ebd0e (patch)
tree6474068073dedd2b3627062537e484b39cc9cd7c /fdisks/fdisksgilabel.c
parentfdisk: (sgi) use cpu_to_beXX() and beXX_to_cpu() (diff)
downloadkernel-qcow2-util-linux-5105f75f6765cf8de2770caf9ae0d3b4851ebd0e.tar.gz
kernel-qcow2-util-linux-5105f75f6765cf8de2770caf9ae0d3b4851ebd0e.tar.xz
kernel-qcow2-util-linux-5105f75f6765cf8de2770caf9ae0d3b4851ebd0e.zip
fdisk: (sgi) remove magic strings
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisksgilabel.c')
-rw-r--r--fdisks/fdisksgilabel.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fdisks/fdisksgilabel.c b/fdisks/fdisksgilabel.c
index b07448d9a..8dab61522 100644
--- a/fdisks/fdisksgilabel.c
+++ b/fdisks/fdisksgilabel.c
@@ -43,8 +43,6 @@ struct fdisk_sgi_label {
struct fdisk_label head; /* generic part */
};
-static short volumes=1;
-
static sgiinfo *fill_sgiinfo(void);
/*
@@ -155,7 +153,6 @@ sgi_probe_label(struct fdisk_context *cxt)
cxt->label->nparts_max = SGI_MAXPARTITIONS;
cxt->label->nparts_cur = count_used_partitions(cxt);
- volumes = 15;
return 1;
}
@@ -216,7 +213,7 @@ sgi_list_table(struct fdisk_context *cxt, int xtra) {
printf(_("----- Bootinfo -----\nBootfile: %s\n"
"----- Directory Entries -----\n"),
sgilabel->boot_file);
- for (i = 0 ; i < (size_t) volumes; i++) {
+ for (i = 0 ; i < SGI_MAXVOLUMES; i++) {
if (sgilabel->volume[i].num_bytes) {
uint32_t start = be32_to_cpu(sgilabel->volume[i].block_num);
uint32_t len = be32_to_cpu(sgilabel->volume[i].num_bytes);
@@ -860,10 +857,11 @@ static int sgi_create_disklabel(struct fdisk_context *cxt)
sgilabel->devparam.xylogics_readgate = cpu_to_be16(0);
sgilabel->devparam.xylogics_writecont = cpu_to_be16(0);
- memset(&(sgilabel->volume), 0, sizeof(struct sgi_volume) * 15);
- memset(&(sgilabel->partitions), 0, sizeof(struct sgi_partition)*16);
- cxt->label->nparts_max = 16;
- volumes = 15;
+ memset(&(sgilabel->volume), 0,
+ sizeof(struct sgi_volume) * SGI_MAXVOLUMES);
+ memset(&(sgilabel->partitions), 0,
+ sizeof(struct sgi_partition) * SGI_MAXPARTITIONS);
+ cxt->label->nparts_max = SGI_MAXPARTITIONS;
sgi_set_entire(cxt);
sgi_set_volhdr(cxt);