git: ed4dd3bfc432 - main - misc/raspberrypi-gpioshutdown: fix build on recent FreeBSD

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 19 Dec 2024 14:39:12 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ed4dd3bfc4326cd2262f5215491eab8cd172a2c2

commit ed4dd3bfc4326cd2262f5215491eab8cd172a2c2
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2024-12-18 02:20:12 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-12-19 14:38:42 +0000

    misc/raspberrypi-gpioshutdown: fix build on recent FreeBSD
    
    Due to -Werror being enabled for kernel modules these days, the build
    of this module failed with a "variable set but not used" warning.
    Remove the offending variable to fix the build.
    
    Approved by:    portmgr (build fix blanket)
    MFH:            2024Q4
---
 .../files/patch-gpioshutdown.c                     | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/misc/raspberrypi-gpioshutdown/files/patch-gpioshutdown.c b/misc/raspberrypi-gpioshutdown/files/patch-gpioshutdown.c
new file mode 100644
index 000000000000..fef9df4a75e2
--- /dev/null
+++ b/misc/raspberrypi-gpioshutdown/files/patch-gpioshutdown.c
@@ -0,0 +1,34 @@
+--- gpioshutdown.c.orig	2024-12-18 02:17:41 UTC
++++ gpioshutdown.c
+@@ -199,7 +199,7 @@ static int internal_shutdown_pre_sync(void *arg1 __unu
+ 
+ static int internal_shutdown_pre_sync(void *arg1 __unused)
+ {
+-int nMaxUnit, nUnit, nPinBase, max_pin, res;
++int nMaxUnit, nUnit, nPinBase, max_pin;
+ devclass_t dc;
+ device_t dev;
+ 
+@@ -234,7 +234,7 @@ device_t dev;
+       {
+         max_pin = 0;
+ 
+-        res = GPIO_PIN_MAX(dev, &max_pin);
++        GPIO_PIN_MAX(dev, &max_pin);
+ 
+         if(led_gpio >= nPinBase && led_gpio <= max_pin + nPinBase)
+         {
+@@ -242,11 +242,11 @@ device_t dev;
+ 
+           pin = led_gpio - nPinBase;
+ 
+-          res = GPIO_PIN_GETFLAGS(dev, pin, &val);
++          GPIO_PIN_GETFLAGS(dev, pin, &val);
+           if(!(val & GPIO_PIN_OUTPUT))
+           {
+             int caps;
+-            res = GPIO_PIN_GETCAPS(dev, pin, &caps);
++            GPIO_PIN_GETCAPS(dev, pin, &caps);
+ 
+             if(caps & GPIO_PIN_OUTPUT) // it CAN be an input - see gpio_check_flags() in gpiobus.c
+             {