From a2fe6e2d3c4323d91557e5415b71d752f529da0a Mon Sep 17 00:00:00 2001 From: krw Date: Tue, 6 Sep 2022 14:14:44 +0000 Subject: [PATCH] Delete some unreferenced SMD, ST506 and archaic SCSI #define's that use d_drivedata. Since nothing else in the tree refers to d_drivedata other than /etc/disktab parsing and no /etc/disktab entry utilizes the :d[0-4]: attributes, stop disklabel(8) both printing "drivedata: 0" and paying attention to any "drivedata: ..." lines in ascii labels being read. ok jsg@ miod@ --- sbin/disklabel/disklabel.c | 34 +++++----------------------------- sys/sys/disklabel.h | 22 +--------------------- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index ba8d30083bc..1dafdc9ec6b 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.243 2022/09/01 13:35:02 krw Exp $ */ +/* $OpenBSD: disklabel.c,v 1.244 2022/09/06 14:14:44 krw Exp $ */ /* * Copyright (c) 1987, 1993 @@ -418,9 +418,6 @@ makedisktab(FILE *f, struct disklabel *lp) * XXX We do not print have disktab information yet for * XXX DL_GETBSTART DL_GETBEND */ - for (i = 0; i < NDDATA; i++) - if (lp->d_drivedata[i]) - (void)fprintf(f, "d%d#%u", i, lp->d_drivedata[i]); pp = lp->d_partitions; for (i = 0; i < lp->d_npartitions; i++, pp++) { if (DL_GETPSIZE(pp)) { @@ -556,7 +553,7 @@ canonical_unit(struct disklabel *lp, char unit) void display(FILE *f, struct disklabel *lp, char unit, int all) { - int i, j; + int i; double d; unit = canonical_unit(lp, unit); @@ -595,15 +592,6 @@ display(FILE *f, struct disklabel *lp, char unit, int all) fprintf(f, "boundstart: %llu\n", DL_GETBSTART(lp)); fprintf(f, "boundend: %llu\n", DL_GETBEND(lp)); - fprintf(f, "drivedata: "); - for (i = NDDATA - 1; i >= 0; i--) - if (lp->d_drivedata[i]) - break; - if (i < 0) - i = 0; - for (j = 0; j <= i; j++) - fprintf(f, "%d ", lp->d_drivedata[j]); - fprintf(f, "\n"); if (all) { fprintf(f, "\n%hu partitions:\n", lp->d_npartitions); fprintf(f, "# %16.16s %16.16s fstype [fsize bsize cpg]\n", @@ -889,19 +877,6 @@ getasciilabel(FILE *f, struct disklabel *lp) lp->d_flags = v; continue; } - if (!strcmp(cp, "drivedata")) { - int i; - - for (i = 0; (cp = tp) && *cp != '\0' && i < NDDATA;) { - v = GETNUM(lp->d_drivedata[i], cp, 0, &errstr); - if (errstr) - warnx("line %d: bad drivedata %s", - lineno, cp); - lp->d_drivedata[i++] = v; - tp = word(cp); - } - continue; - } if (sscanf(cp, "%d partitions", &v) == 1) { if (v == 0 || v > MAXPARTITIONS) { warnx("line %d: bad # of partitions", lineno); @@ -929,13 +904,14 @@ getasciilabel(FILE *f, struct disklabel *lp) continue; } - /* Ignore fields that are no longer in the disklabel. */ + /* Ignore fields that are no longer used. */ if (!strcmp(cp, "rpm") || !strcmp(cp, "interleave") || !strcmp(cp, "trackskew") || !strcmp(cp, "cylinderskew") || !strcmp(cp, "headswitch") || - !strcmp(cp, "track-to-track seek")) + !strcmp(cp, "track-to-track seek") || + !strcmp(cp, "drivedata")) continue; /* Ignore fields that are forcibly set when label is read. */ diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index a1f2585564c..bc595f3e826 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.79 2022/09/01 15:48:51 krw Exp $ */ +/* $OpenBSD: disklabel.h,v 1.80 2022/09/06 14:14:44 krw Exp $ */ /* $NetBSD: disklabel.h,v 1.41 1996/05/10 23:07:37 mark Exp $ */ /* @@ -324,26 +324,6 @@ static char *fstypesnames[] = { #define D_BADSECT 0x04 /* supports bad sector forw. */ #define D_VENDOR 0x08 /* vendor disklabel */ -/* - * Drive data for SMD. - */ -#define d_smdflags d_drivedata[0] -#define D_SSE 0x1 /* supports skip sectoring */ -#define d_mindist d_drivedata[1] -#define d_maxdist d_drivedata[2] -#define d_sdist d_drivedata[3] - -/* - * Drive data for ST506. - */ -#define d_precompcyl d_drivedata[0] -#define d_gap3 d_drivedata[1] /* used only when formatting */ - -/* - * Drive data for SCSI. - */ -#define d_blind d_drivedata[0] - #ifndef _LOCORE /* * Structure used internally to retrieve information about a partition -- 2.20.1