From: krw Date: Sat, 3 Jun 2023 21:37:53 +0000 (+0000) Subject: Remove declarations of unused local variables, an unused function X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5655a256dbe5dc1bd6b61d3678a678d3d6925e55;p=openbsd Remove declarations of unused local variables, an unused function (get_long) and add missing {} in devsw[1] initialization. Most from 2011 NetBSD commit by tsutui. No functional change. Build tested and ok kn@ --- diff --git a/sys/arch/sparc64/stand/ofwboot/boot.c b/sys/arch/sparc64/stand/ofwboot/boot.c index 1e7869aa262..a0476101878 100644 --- a/sys/arch/sparc64/stand/ofwboot/boot.c +++ b/sys/arch/sparc64/stand/ofwboot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.42 2023/06/01 17:24:56 krw Exp $ */ +/* $OpenBSD: boot.c,v 1.43 2023/06/03 21:37:53 krw Exp $ */ /* $NetBSD: boot.c,v 1.3 2001/05/31 08:55:19 mrg Exp $ */ /* * Copyright (c) 1997, 1999 Eduardo E. Horvath. All rights reserved. @@ -110,7 +110,6 @@ static int parseargs(char *str, int *howtop) { char *cp; - int i; *howtop = 0; cp = str; @@ -284,7 +283,7 @@ int loadrandom(char *path, char *buf, size_t buflen) { struct stat sb; - int fd, i, error = 0; + int fd, error = 0; fd = open(path, O_RDONLY); if (fd == -1) @@ -416,7 +415,7 @@ main(void) int chosen; char bootline[512]; /* Should check size? */ char *cp; - int i, fd; + int fd; #ifdef SOFTRAID int err; #endif diff --git a/sys/arch/sparc64/stand/ofwboot/elf64_exec.c b/sys/arch/sparc64/stand/ofwboot/elf64_exec.c index 6fe116eb563..0b57c98dfa3 100644 --- a/sys/arch/sparc64/stand/ofwboot/elf64_exec.c +++ b/sys/arch/sparc64/stand/ofwboot/elf64_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf64_exec.c,v 1.15 2023/06/02 00:10:25 krw Exp $ */ +/* $OpenBSD: elf64_exec.c,v 1.16 2023/06/03 21:37:53 krw Exp $ */ /* $NetBSD: elfXX_exec.c,v 1.2 2001/08/15 20:08:15 eeh Exp $ */ /* @@ -82,7 +82,6 @@ elf64_exec(int fd, Elf_Ehdr *elf, u_int64_t *entryp, void **ssymp, void **esymp) size_t size; u_int align; int i, first = 1; - int n; struct openbsd_bootdata *obd; #ifdef SOFTRAID struct sr_boot_volume *bv; diff --git a/sys/arch/sparc64/stand/ofwboot/netif_of.c b/sys/arch/sparc64/stand/ofwboot/netif_of.c index 220f59e13f6..6b2ac60d399 100644 --- a/sys/arch/sparc64/stand/ofwboot/netif_of.c +++ b/sys/arch/sparc64/stand/ofwboot/netif_of.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netif_of.c,v 1.8 2023/06/01 17:24:56 krw Exp $ */ +/* $OpenBSD: netif_of.c,v 1.9 2023/06/03 21:37:53 krw Exp $ */ /* $NetBSD: netif_of.c,v 1.1 2000/08/20 14:58:39 mrg Exp $ */ /* @@ -72,8 +72,6 @@ netif_open(void *machdep_hint) { struct of_dev *op = machdep_hint; struct iodesc *io; - int fd, error; - char addr[32]; DNPRINTF(BOOT_D_OFNET, "netif_open..."); diff --git a/sys/arch/sparc64/stand/ofwboot/ofdev.c b/sys/arch/sparc64/stand/ofwboot/ofdev.c index 2310867a139..ef9c7ffa204 100644 --- a/sys/arch/sparc64/stand/ofwboot/ofdev.c +++ b/sys/arch/sparc64/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.38 2023/06/01 17:24:56 krw Exp $ */ +/* $OpenBSD: ofdev.c,v 1.39 2023/06/03 21:37:53 krw Exp $ */ /* $NetBSD: ofdev.c,v 1.1 2000/08/20 14:58:41 mrg Exp $ */ /* @@ -184,11 +184,13 @@ devclose(struct open_file *of) } struct devsw devsw[1] = { - "OpenFirmware", - strategy, - (int (*)(struct open_file *, ...))nodev, - devclose, - noioctl + { + "OpenFirmware", + strategy, + (int (*)(struct open_file *, ...))nodev, + devclose, + noioctl + } }; int ndevs = sizeof devsw / sizeof devsw[0]; @@ -224,14 +226,6 @@ static struct of_dev ofdev = { char opened_name[256]; -static u_long -get_long(const void *p) -{ - const unsigned char *cp = p; - - return cp[0] | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24); -} - /************************************************************************ * * The rest of this was taken from arch/sparc64/scsi/sun_disklabel.c diff --git a/sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c b/sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c index bd0b5e59510..5cf58f3a1b6 100644 --- a/sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c +++ b/sys/arch/sparc64/stand/ofwboot/softraid_sparc64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_sparc64.c,v 1.7 2023/06/01 17:24:56 krw Exp $ */ +/* $OpenBSD: softraid_sparc64.c,v 1.8 2023/06/03 21:37:53 krw Exp $ */ /* * Copyright (c) 2012 Joel Sing @@ -404,7 +404,6 @@ const char * sr_getdisklabel(struct sr_boot_volume *bv, struct disklabel *label) { struct of_dev ofdev; - int err; #ifdef DEBUG int i; #endif