Module Name:    src
Committed By:   rillig
Date:           Thu Feb 27 21:09:23 UTC 2025

Modified Files:
        src/usr.sbin/fwctl: Makefile fwcontrol.c

Log Message:
fwctl: remove dead code, suppress lint warning

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/fwctl/Makefile
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/fwctl/fwcontrol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/fwctl/Makefile
diff -u src/usr.sbin/fwctl/Makefile:1.7 src/usr.sbin/fwctl/Makefile:1.8
--- src/usr.sbin/fwctl/Makefile:1.7	Thu Oct 13 17:23:29 2011
+++ src/usr.sbin/fwctl/Makefile	Thu Feb 27 21:09:23 2025
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2011/10/13 17:23:29 plunky Exp $
+# $NetBSD: Makefile,v 1.8 2025/02/27 21:09:23 rillig Exp $
 
 WARNS?=	4
 PROG=	fwctl
@@ -9,5 +9,6 @@ MAN=	fwctl.8
 
 SDIR= ${.CURDIR}/../../sys
 CPPFLAGS+=-I${.CURDIR} -I${SDIR}
+LINTFLAGS+= -X 34	# unportable bit-field type 'unsigned char'
 
 .include <bsd.prog.mk>

Index: src/usr.sbin/fwctl/fwcontrol.c
diff -u src/usr.sbin/fwctl/fwcontrol.c:1.17 src/usr.sbin/fwctl/fwcontrol.c:1.18
--- src/usr.sbin/fwctl/fwcontrol.c:1.17	Fri Feb  1 08:29:04 2019
+++ src/usr.sbin/fwctl/fwcontrol.c	Thu Feb 27 21:09:23 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcontrol.c,v 1.17 2019/02/01 08:29:04 mrg Exp $	*/
+/*	$NetBSD: fwcontrol.c,v 1.18 2025/02/27 21:09:23 rillig Exp $	*/
 /*
  * Copyright (C) 2002
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 #include <sys/cdefs.h>
 //__FBSDID("$FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $");
-__RCSID("$NetBSD: fwcontrol.c,v 1.17 2019/02/01 08:29:04 mrg Exp $");
+__RCSID("$NetBSD: fwcontrol.c,v 1.18 2025/02/27 21:09:23 rillig Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -136,7 +136,7 @@ str2node(int fd, const char *nodestr)
 	data = malloc(sizeof(*data));
 	if (data == NULL)
 		err(EX_SOFTWARE, "%s: data malloc", __func__);
-	get_dev(fd,data);
+	get_dev(fd, data);
 
 	for (i = 0; i < data->info_len; i++) {
 		fweui2eui64(&data->dev[i].eui, &tmpeui);
@@ -148,8 +148,7 @@ str2node(int fd, const char *nodestr)
 		}
 	}
 	if (i >= data->info_len) {
-		if (data != NULL)
-			free(data);
+		free(data);
 		return -1;
 	}
 
@@ -765,12 +764,8 @@ main(int argc, char **argv)
 		for (current_board = 0; current_board < MAX_BOARDS; current_board++) {
 			snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board);
 			if (open_dev(&fd, devbase) < 0) {
-				if (current_board == 0) {
+				if (current_board == 0)
 					usage();
-					err(EX_IOERR, "%s: Error opening "
-					    "firewire controller #%d %s",
-					    __func__, current_board, devbase);
-				}
 				return EIO;
 			}
 			list_dev(fd);
@@ -928,26 +923,18 @@ main(int argc, char **argv)
 			command_set = true;
 			display_board_only = false;
 			break;
-		case '?':
 		default:
 			usage();
-			errx(EINVAL, "%s: Unknown command line arguments",
-			    __func__);
-			return 0;
 		}
-	} /* end while */
+	}
 
 	/*
 	 * Catch the error case when the user
 	 * executes the command with non ''-''
 	 * delimited arguments.
-	 * Generate the usage() display and exit.
 	 */
-	if (!command_set && !display_board_only) {
+	if (!command_set && !display_board_only)
 		usage();
-		errx(EINVAL, "%s: Unknown command line arguments", __func__);
-		return 0;
-	}
 
 	/*
 	 * If -u <bus_number> is passed, execute

Reply via email to