Skip to content

Commit 3e2bcc1

Browse files
dpenklergregkh
authored andcommitted
staging: gpib: Use C99 syntax and make static
Some drivers were still using the old syntax for initializing structs: field : value; This caused sparse to emit the following warning, for example: common/gpib_os.c:2026:1: warning: obsolete struct initializer, use C99 syntax Use C99 syntax: .field = value; Some local structs and arrays were not declared static causing sparse to emit the following warning, for example: warning: symbol 'ib_fops' was not declared. Should it be static? Declare the local structs and arrays as static. Signed-off-by: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b3beeee commit 3e2bcc1

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed

drivers/staging/gpib/agilent_82357a/agilent_82357a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MODULE_DESCRIPTION("GPIB driver for Agilent 82357A/B usb adapters");
1919

2020
#define MAX_NUM_82357A_INTERFACES 128
2121
static struct usb_interface *agilent_82357a_driver_interfaces[MAX_NUM_82357A_INTERFACES];
22-
DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board insertion and removal
22+
static DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board insertion and removal
2323

2424
static unsigned int agilent_82357a_update_status(gpib_board_t *board, unsigned int clear_mask);
2525

drivers/staging/gpib/common/gpib_os.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,13 +2023,13 @@ static int t1_delay_ioctl(gpib_board_t *board, unsigned long arg)
20232023
return 0;
20242024
}
20252025

2026-
const struct file_operations ib_fops = {
2027-
owner: THIS_MODULE,
2028-
llseek : NULL,
2029-
unlocked_ioctl : &ibioctl,
2030-
compat_ioctl : &ibioctl,
2031-
open : &ibopen,
2032-
release : &ibclose,
2026+
static const struct file_operations ib_fops = {
2027+
.owner = THIS_MODULE,
2028+
.llseek = NULL,
2029+
.unlocked_ioctl = &ibioctl,
2030+
.compat_ioctl = &ibioctl,
2031+
.open = &ibopen,
2032+
.release = &ibclose,
20332033
};
20342034

20352035
gpib_board_t board_array[GPIB_MAX_NUM_BOARDS];

drivers/staging/gpib/gpio/gpib_bitbang.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ DEFINE_LED_TRIGGER(ledtrig_gpib);
147147
led_trigger_event(ledtrig_gpib, LED_OFF); } \
148148
while (0)
149149

150-
struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
150+
static struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
151151

152152
#define D01 all_descriptors[0]
153153
#define D02 all_descriptors[1]
@@ -175,7 +175,7 @@ struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS];
175175
/* YOGA dapter uses a global enable for the buffer chips, re-using the TE pin */
176176
#define YOGA_ENABLE TE
177177

178-
int gpios_vector[] = {
178+
static int gpios_vector[] = {
179179
D01_pin_nr,
180180
D02_pin_nr,
181181
D03_pin_nr,

drivers/staging/gpib/ines/ines_gpib.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -357,38 +357,38 @@ struct ines_pci_id {
357357
enum ines_pci_chip pci_chip_type;
358358
};
359359

360-
struct ines_pci_id pci_ids[] = {
361-
{vendor_id: PCI_VENDOR_ID_PLX,
362-
device_id : PCI_DEVICE_ID_PLX_9050,
363-
subsystem_vendor_id : PCI_VENDOR_ID_PLX,
364-
subsystem_device_id : PCI_SUBDEVICE_ID_INES_GPIB,
365-
gpib_region : 2,
366-
io_offset : 1,
367-
pci_chip_type : PCI_CHIP_PLX9050,
360+
static struct ines_pci_id pci_ids[] = {
361+
{.vendor_id = PCI_VENDOR_ID_PLX,
362+
.device_id = PCI_DEVICE_ID_PLX_9050,
363+
.subsystem_vendor_id = PCI_VENDOR_ID_PLX,
364+
.subsystem_device_id = PCI_SUBDEVICE_ID_INES_GPIB,
365+
.gpib_region = 2,
366+
.io_offset = 1,
367+
.pci_chip_type = PCI_CHIP_PLX9050,
368368
},
369-
{vendor_id: PCI_VENDOR_ID_AMCC,
370-
device_id : PCI_DEVICE_ID_INES_GPIB_AMCC,
371-
subsystem_vendor_id : PCI_VENDOR_ID_AMCC,
372-
subsystem_device_id : PCI_SUBDEVICE_ID_INES_GPIB,
373-
gpib_region : 1,
374-
io_offset : 1,
375-
pci_chip_type : PCI_CHIP_AMCC5920,
369+
{.vendor_id = PCI_VENDOR_ID_AMCC,
370+
.device_id = PCI_DEVICE_ID_INES_GPIB_AMCC,
371+
.subsystem_vendor_id = PCI_VENDOR_ID_AMCC,
372+
.subsystem_device_id = PCI_SUBDEVICE_ID_INES_GPIB,
373+
.gpib_region = 1,
374+
.io_offset = 1,
375+
.pci_chip_type = PCI_CHIP_AMCC5920,
376376
},
377-
{vendor_id: PCI_VENDOR_ID_INES_QUICKLOGIC,
378-
device_id : PCI_DEVICE_ID_INES_GPIB_QL5030,
379-
subsystem_vendor_id : PCI_VENDOR_ID_INES_QUICKLOGIC,
380-
subsystem_device_id : PCI_DEVICE_ID_INES_GPIB_QL5030,
381-
gpib_region : 1,
382-
io_offset : 1,
383-
pci_chip_type : PCI_CHIP_QUICKLOGIC5030,
377+
{.vendor_id = PCI_VENDOR_ID_INES_QUICKLOGIC,
378+
.device_id = PCI_DEVICE_ID_INES_GPIB_QL5030,
379+
.subsystem_vendor_id = PCI_VENDOR_ID_INES_QUICKLOGIC,
380+
.subsystem_device_id = PCI_DEVICE_ID_INES_GPIB_QL5030,
381+
.gpib_region = 1,
382+
.io_offset = 1,
383+
.pci_chip_type = PCI_CHIP_QUICKLOGIC5030,
384384
},
385-
{vendor_id: PCI_VENDOR_ID_QUANCOM,
386-
device_id : PCI_DEVICE_ID_QUANCOM_GPIB,
387-
subsystem_vendor_id : -1,
388-
subsystem_device_id : -1,
389-
gpib_region : 0,
390-
io_offset : 4,
391-
pci_chip_type : PCI_CHIP_QUANCOM,
385+
{.vendor_id = PCI_VENDOR_ID_QUANCOM,
386+
.device_id = PCI_DEVICE_ID_QUANCOM_GPIB,
387+
.subsystem_vendor_id = -1,
388+
.subsystem_device_id = -1,
389+
.gpib_region = 0,
390+
.io_offset = 4,
391+
.pci_chip_type = PCI_CHIP_QUANCOM,
392392
},
393393
};
394394

0 commit comments

Comments
 (0)