Eliminate unused uuid parameters from gptread and gptread_table. We

only need it for the gptfind() function, where it's used.
This commit is contained in:
Warner Losh 2019-06-05 02:34:58 +00:00
parent 7120683d7f
commit de357a736d
3 changed files with 7 additions and 9 deletions

View File

@ -232,7 +232,7 @@ static int
gptinit(void) gptinit(void)
{ {
if (gptread(&freebsd_ufs_uuid, &gdsk.dsk, dmadat->secbuf) == -1) { if (gptread(&gdsk.dsk, dmadat->secbuf) == -1) {
printf("%s: unable to load GPT\n", BOOTPROG); printf("%s: unable to load GPT\n", BOOTPROG);
return (-1); return (-1);
} }

View File

@ -275,8 +275,8 @@ gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,
} }
static int static int
gptread_table(const char *which, const uuid_t *uuid, struct dsk *dskp, gptread_table(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,
struct gpt_hdr *hdr, struct gpt_ent *table) struct gpt_ent *table)
{ {
struct gpt_ent *ent; struct gpt_ent *ent;
int entries_per_sec; int entries_per_sec;
@ -313,7 +313,7 @@ gptread_table(const char *which, const uuid_t *uuid, struct dsk *dskp,
} }
int int
gptread(const uuid_t *uuid, struct dsk *dskp, char *buf) gptread(struct dsk *dskp, char *buf)
{ {
uint64_t altlba; uint64_t altlba;
@ -328,8 +328,7 @@ gptread(const uuid_t *uuid, struct dsk *dskp, char *buf)
dskp->start = 0; dskp->start = 0;
if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 && if (gptread_hdr("primary", dskp, &hdr_primary, 1) == 0 &&
gptread_table("primary", uuid, dskp, &hdr_primary, gptread_table("primary", dskp, &hdr_primary, table_primary) == 0) {
table_primary) == 0) {
hdr_primary_lba = hdr_primary.hdr_lba_self; hdr_primary_lba = hdr_primary.hdr_lba_self;
gpthdr = &hdr_primary; gpthdr = &hdr_primary;
gpttable = table_primary; gpttable = table_primary;
@ -349,8 +348,7 @@ gptread(const uuid_t *uuid, struct dsk *dskp, char *buf)
if (altlba == 0) if (altlba == 0)
printf("%s: unable to locate backup GPT header\n", BOOTPROG); printf("%s: unable to locate backup GPT header\n", BOOTPROG);
else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 && else if (gptread_hdr("backup", dskp, &hdr_backup, altlba) == 0 &&
gptread_table("backup", uuid, dskp, &hdr_backup, gptread_table("backup", dskp, &hdr_backup, table_backup) == 0) {
table_backup) == 0) {
hdr_backup_lba = hdr_backup.hdr_lba_self; hdr_backup_lba = hdr_backup.hdr_lba_self;
if (hdr_primary_lba == 0) { if (hdr_primary_lba == 0) {
gpthdr = &hdr_backup; gpthdr = &hdr_backup;

View File

@ -34,7 +34,7 @@
#define MAXTBLENTS 128 #define MAXTBLENTS 128
int gptread(const uuid_t *uuid, struct dsk *dskp, char *buf); int gptread(struct dsk *dskp, char *buf);
int gptfind(const uuid_t *uuid, struct dsk *dskp, int part); int gptfind(const uuid_t *uuid, struct dsk *dskp, int part);
void gptbootfailed(struct dsk *dskp); void gptbootfailed(struct dsk *dskp);