Index | Thread | Search

From:
jon@elytron.openbsd.amsterdam
Subject:
Minor fixes, style corrections, superfluous variables, and so on.
To:
tech@openbsd.org
Date:
Wed, 29 May 2024 04:39:37 +0000

Download raw body.

Thread
Hello, everyone. I just thought I should share very minor nitpicks
I have found over time in the kernel code. Most of them I have 
already posted in one way or another. They are

1. Tabs vs spaces in wsmux.c.
2. Extra defines (to the best of my knowledge) in wsdisplayvar.h.
3. Unnecessary variable, in my opinion in wsdisplay.c.
4. Tabs vs spaces in apm.c
And finally, if you would be so kind,
5. Added device id in usbdevs (I know this doesn't make bluetooth
work, just nice to have it identified). Also please see
https://marc.info/?l=openbsd-ppc&m=166128113030121&w=2

All the best, patches follow.

Index: dev/wscons/wsmux.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsmux.c,v
retrieving revision 1.57
diff -u -p -r1.57 wsmux.c
--- dev/wscons/wsmux.c	25 Mar 2024 13:01:49 -0000	1.57
+++ dev/wscons/wsmux.c	28 May 2024 19:17:36 -0000
@@ -216,7 +214,7 @@ wsmuxopen(dev_t dev, int flags, int mode
 
 	error = wsmux_do_open(sc, evar);
 	if (error)
-                wsevent_fini(evar);
+		wsevent_fini(evar);
 	return (error);
 }

Index: dev/wscons/wsdisplayvar.h
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsdisplayvar.h,v
retrieving revision 1.38
diff -u -p -r1.38 wsdisplayvar.h
--- dev/wscons/wsdisplayvar.h	13 Sep 2020 10:05:46 -0000	1.38
+++ dev/wscons/wsdisplayvar.h	28 May 2024 19:17:36 -0000
@@ -177,8 +177,6 @@ struct wsemuldisplaydev_attach_args {
 #define	WSEMULDISPLAYDEVCF_PRIMARY_UNK	-1
 #define	WSEMULDISPLAYDEVCF_MUX		2
 #define	wsemuldisplaydevcf_mux		cf_loc[WSEMULDISPLAYDEVCF_MUX]
-#define	WSDISPLAYDEVCF_MUX		0
-#define	wsdisplaydevcf_mux		cf_loc[WSDISPLAYDEVCF_MUX]
 
 struct wscons_syncops {
 	int (*detach)(void *, int, void (*)(void *, int, int), void *);
Index: dev/wscons/wsdisplay.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsdisplay.c,v
retrieving revision 1.152
diff -u -p -r1.152 wsdisplay.c
--- dev/wscons/wsdisplay.c	10 Jan 2023 16:33:18 -0000	1.152
+++ dev/wscons/wsdisplay.c	28 May 2024 19:17:35 -0000
@@ -268,7 +268,6 @@ int	(*ws_set_param)(struct wsdisplay_par
 #ifndef WSDISPLAY_DEFAULTSCREENS
 #define WSDISPLAY_DEFAULTSCREENS	1
 #endif
-int	wsdisplay_defaultscreens = WSDISPLAY_DEFAULTSCREENS;
 
 int	wsdisplay_switch1(void *, int, int);
 int	wsdisplay_switch2(void *, int, int);
@@ -782,7 +785,7 @@ wsdisplay_common_attach(struct wsdisplay
 	 * sane multihead defaults.
 	 */
 	if (defaultscreens == 0)
-		defaultscreens = wsdisplay_defaultscreens;
+		defaultscreens = WSDISPLAY_DEFAULTSCREENS;
 	for (i = start; i < defaultscreens; i++) {
 		if (wsdisplay_addscreen(sc, i, 0, 0))
 			break;
Index: arch/macppc/dev/apm.c
===================================================================
RCS file: /cvs/src/sys/arch/macppc/dev/apm.c,v
retrieving revision 1.36
diff -u -p -r1.36 apm.c
--- arch/macppc/dev/apm.c	28 May 2024 09:40:40 -0000	1.36
+++ arch/macppc/dev/apm.c	28 May 2024 19:17:30 -0000
@@ -250,7 +250,7 @@ apmioctl(dev_t dev, u_long cmd, caddr_t 
 		}
 		break;
 	case APM_IOC_GETPOWER:
-	        power = (struct apm_power_info *)data;
+		power = (struct apm_power_info *)data;
 
 		pm_battery_info(0, &batt);
 
Index: dev/usb/usbdevs
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.765
diff -u -p -r1.765 usbdevs
--- dev/usb/usbdevs	23 May 2024 08:06:22 -0000	1.765
+++ dev/usb/usbdevs	28 May 2024 19:17:35 -0000
@@ -1023,6 +1023,7 @@ product APPLE IPHONE_4S		0x12a0	iPhone 4
 product APPLE IPHONE_6		0x12a8	iPhone 6
 product APPLE ETHERNET		0x1402	Ethernet A1277
 product APPLE BLUETOOTH2	0x8205	Bluetooth
+product APPLE BLUETOOTH3	0x8207	Bluetooth
 product APPLE BLUETOOTH		0x8300	Bluetooth
 product APPLE ISIGHT_1		0x8501	iSight
 product APPLE ISIGHT		0x8502	iSight