Skip to contentSkip to conversation

staging: gpib: make global 'usec_diff' functions static

PATCH New Arnd Bergmann 1 participant 2 messages Dec 12, 2024 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: gpib: make global 'usec_diff' functions static

From: Arnd Bergmann <[email protected]>

Trying to build both gpib_bitbang and lpvo_usb_gpib into the kernel reveals a function that should have been static and is also duplicated:

x86_64-linux-ld: drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.o: in function `usec_diff':
lpvo_usb_gpib.c:(.text+0x23c0): multiple definition of `usec_diff'; drivers/staging/gpib/gpio/gpib_bitbang.o:gpib_bitbang.c:(.text+0x2470): first defined here

---
 drivers/staging/gpib/gpio/gpib_bitbang.c           | 2 +-
 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/gpib/gpio/gpib_bitbang.c +1 -1
index a2d562cbd65b..23550502e012 100644
@@ -315,7 +315,7 @@ struct bb_priv {
 	enum listener_function_state listener_state;
 };
 
-inline long usec_diff(struct timespec64 *a, struct timespec64 *b);
+static inline long usec_diff(struct timespec64 *a, struct timespec64 *b);
 static void bb_buffer_print(unsigned char *buffer, size_t length, int cmd, int eoi);
 static void set_data_lines(u8 byte);
 static u8 get_data_lines(void);
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +1 -1
index 22185b48e3e9..f7ba770e4707 100644
@@ -208,7 +208,7 @@ static int skel_do_release(gpib_board_t *);
  *		 (unix time in sec and NANOsec)
  */
 
-inline int usec_diff(struct timespec64 *a, struct timespec64 *b)
+static inline int usec_diff(struct timespec64 *a, struct timespec64 *b)
 {
 	return ((a->tv_sec - b->tv_sec) * 1000000 +
 		(a->tv_nsec - b->tv_nsec) / 1000);
Signature · 1 line
2.39.5
#1 lore raw

PATCH 2/2 staging: gpib: fix Makefiles

From: Arnd Bergmann <[email protected]>

Having gpib drivers built-in rather than as loadable modules causes link failure because the drivers are never actually built:

arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_t1_delay':
fmh_gpib.c:(.text+0x3b0): undefined reference to `nec7210_t1_delay'
arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_serial_poll_status':
fmh_gpib.c:(.text+0x418): undefined reference to `nec7210_serial_poll_status'
arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_secondary_address':
fmh_gpib.c:(.text+0x57c): undefined reference to `nec7210_secondary_address'
arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_primary_address':
fmh_gpib.c:(.text+0x5ac): undefined reference to `nec7210_primary_address'

Change this to use the correct Makefile syntax, setting either obj-m or obj-y.

---
 drivers/staging/gpib/agilent_82350b/Makefile | 2 +-
 drivers/staging/gpib/agilent_82357a/Makefile | 2 +-
 drivers/staging/gpib/cb7210/Makefile         | 2 +-
 drivers/staging/gpib/cec/Makefile            | 2 +-
 drivers/staging/gpib/common/Makefile         | 2 +-
 drivers/staging/gpib/eastwood/Makefile       | 2 +-
 drivers/staging/gpib/gpio/Makefile           | 2 +-
 drivers/staging/gpib/hp_82335/Makefile       | 2 +-
 drivers/staging/gpib/hp_82341/Makefile       | 2 +-
 drivers/staging/gpib/ines/Makefile           | 2 +-
 drivers/staging/gpib/lpvo_usb_gpib/Makefile  | 2 +-
 drivers/staging/gpib/nec7210/Makefile        | 2 +-
 drivers/staging/gpib/ni_usb/Makefile         | 2 +-
 drivers/staging/gpib/pc2/Makefile            | 2 +-
 drivers/staging/gpib/tms9914/Makefile        | 2 +-
 drivers/staging/gpib/tnt4882/Makefile        | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
drivers/staging/gpib/agilent_82350b/Makefile +1 -1
index d9236c92e04b..f24e1e713a63 100644
@@ -1,2 +1,2 @@
 
-obj-m += agilent_82350b.o
+obj-$(CONFIG_GPIB_AGILENT_82350B) += agilent_82350b.o
drivers/staging/gpib/agilent_82357a/Makefile +1 -1
index 4a1d940fce2b..81a55c257a6e 100644
@@ -1,4 +1,4 @@
 
-obj-m += agilent_82357a.o
+obj-$(CONFIG_GPIB_AGILENT_82357A) += agilent_82357a.o
 
 
drivers/staging/gpib/cb7210/Makefile +1 -1
index 22e0214fc17d..cda0725d6487 100644
@@ -1,4 +1,4 @@
 ccflags-$(CONFIG_GPIB_PCMCIA) := -DGPIB_PCMCIA
-obj-m += cb7210.o
+obj-$(CONFIG_GPIB_CB7210) += cb7210.o
 
 
drivers/staging/gpib/cec/Makefile +1 -1
index f4638628ff29..b7141e23d4e0 100644
@@ -1,3 +1,3 @@
 
-obj-m += cec_gpib.o
+obj-$(CONFIG_GPIB_CEC_PCI) += cec_gpib.o
 
drivers/staging/gpib/common/Makefile +1 -1
index 0c4c77bea75b..460586edb574 100644
@@ -1,5 +1,5 @@
 
-obj-m += gpib_common.o
+obj-$(CONFIG_GPIB_COMMON) += gpib_common.o
 
 gpib_common-objs := gpib_os.o iblib.o
 
drivers/staging/gpib/eastwood/Makefile +1 -1
index c74056f959d0..384825195f77 100644
@@ -1,3 +1,3 @@
 
-obj-m += fluke_gpib.o
+obj-$(CONFIG_GPIB_FLUKE) += fluke_gpib.o
 
drivers/staging/gpib/gpio/Makefile +1 -1
index a31ded6e5924..00ea52abdda7 100644
@@ -1,4 +1,4 @@
 
-obj-m += gpib_bitbang.o
+obj-$(CONFIG_GPIB_GPIO) += gpib_bitbang.o
 
 
drivers/staging/gpib/hp_82335/Makefile +1 -1
index 8b7a552e9355..305ce44ee48a 100644
@@ -1,4 +1,4 @@
 
-obj-m += hp82335.o
+obj-$(CONFIG_GPIB_HP82335) += hp82335.o
 
 
drivers/staging/gpib/hp_82341/Makefile +1 -1
index 1fe7db4f8ca4..21367310a17e 100644
@@ -1,2 +1,2 @@
 
-obj-m += hp_82341.o
+obj-$(CONFIG_GPIB_HP82341) += hp_82341.o
drivers/staging/gpib/ines/Makefile +1 -1
index cdcaa59a4e39..6b6e480fd811 100644
@@ -1,4 +1,4 @@
 ccflags-$(CONFIG_GPIB_PCMCIA) := -DGPIB_PCMCIA
-obj-m += ines_gpib.o
+obj-$(CONFIG_GPIB_INES) += ines_gpib.o
 
 
drivers/staging/gpib/lpvo_usb_gpib/Makefile +1 -1
index 137511acce63..360553488e6d 100644
@@ -1,3 +1,3 @@
 
-obj-m += lpvo_usb_gpib.o
+obj-$(CONFIG_GPIB_LPVO) += lpvo_usb_gpib.o
 
drivers/staging/gpib/nec7210/Makefile +1 -1
index 8d4d90f21109..64330f2e89d1 100644
@@ -1,4 +1,4 @@
 
-obj-m += nec7210.o
+obj-$(CONFIG_GPIB_NEC7210) += nec7210.o
 
 
drivers/staging/gpib/ni_usb/Makefile +1 -1
index e22b3b21a62c..469c5d16add3 100644
@@ -1,4 +1,4 @@
 
-obj-m += ni_usb_gpib.o
+obj-$(CONFIG_GPIB_NI_USB) += ni_usb_gpib.o
 
 
drivers/staging/gpib/pc2/Makefile +1 -1
index 8148425e0f87..481ee4296e1b 100644
@@ -1,5 +1,5 @@
 
-obj-m += pc2_gpib.o
+obj-$(CONFIG_GPIB_PC2) += pc2_gpib.o
 
 
 
drivers/staging/gpib/tms9914/Makefile +1 -1
index 81b7e3cf104c..4705ab07f413 100644
@@ -1,5 +1,5 @@
 
-obj-m += tms9914.o
+obj-$(CONFIG_GPIB_TMS9914) += tms9914.o
 
 
 
drivers/staging/gpib/tnt4882/Makefile +1 -1
index f767c990db7a..04a4520ed3b7 100644
@@ -1,5 +1,5 @@
 ccflags-$(CONFIG_GPIB_PCMCIA) := -DGPIB_PCMCIA
-obj-m += tnt4882.o
+obj-$(CONFIG_GPIB_TNT4882) += tnt4882.o
 
 tnt4882-objs := tnt4882_gpib.o mite.o
 
Signature · 1 line
2.39.5