Quiet unitialized variable warnings

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Dan Williams 2008-11-04 20:50:39 +11:00 committed by NeilBrown
parent ad5bc697ad
commit 197e3eb690
3 changed files with 7 additions and 7 deletions

View File

@ -142,7 +142,7 @@ int Assemble(struct supertype *st, char *mddev,
mdu_array_info_t tmp_inf;
char *avail;
int nextspare = 0;
char *name;
char *name = NULL;
int trustworthy;
char chosen_name[1024];

View File

@ -81,7 +81,6 @@ int Incremental(char *devname, int verbose, int runstop,
struct mddev_ident_s *array_list, *match;
char chosen_name[1024];
int rv;
int devnum;
struct map_ent *mp, *map = NULL;
int dfd, mdfd;
char *avail;
@ -284,7 +283,7 @@ int Incremental(char *devname, int verbose, int runstop,
close(mdfd);
return 2;
}
sra = sysfs_read(mdfd, devnum, GET_DEVS);
sra = sysfs_read(mdfd, fd2devnum(mdfd), GET_DEVS);
if (!sra || !sra->devs || sra->devs->disk.raid_disk >= 0) {
/* It really should be 'none' - must be old buggy
* kernel, and mdadm -I may not be able to complete.
@ -318,7 +317,7 @@ int Incremental(char *devname, int verbose, int runstop,
strcpy(chosen_name, mp->path);
sra = sysfs_read(mdfd, devnum, (GET_DEVS | GET_STATE));
sra = sysfs_read(mdfd, fd2devnum(mdfd), (GET_DEVS | GET_STATE));
sprintf(dn, "%d:%d", sra->devs->disk.major,
sra->devs->disk.minor);
@ -442,7 +441,7 @@ int Incremental(char *devname, int verbose, int runstop,
}
close(bmfd);
}
sra = sysfs_read(mdfd, devnum, 0);
sra = sysfs_read(mdfd, fd2devnum(mdfd), 0);
if ((sra == NULL || active_disks >= info.array.working_disks)
&& trustworthy != FOREIGN)
rv = ioctl(mdfd, RUN_ARRAY, NULL);

View File

@ -43,14 +43,15 @@ void make_parts(char *dev, int cnt)
* else that of dev
*/
struct stat stb;
int major_num, minor_num;
int major_num = major_num; /* quiet gcc -Os unitialized warning */
int minor_num = minor_num; /* quiet gcc -Os unitialized warning */
int odig = odig; /* quiet gcc -Os unitialized warning */
int i;
int nlen = strlen(dev) + 20;
char *name = malloc(nlen);
int dig = isdigit(dev[strlen(dev)-1]);
char orig[1024];
char sym[1024];
int odig;
if (cnt==0) cnt=4;
if (lstat(dev, &stb)!= 0)