Skip to contentSkip to conversation

staging: gpib: Modernize gpib_interface_t initialization and make static

PATCH Superseded Dave Penkler 3 participants 5 messages Jan 8, 2025 – Jan 10, 2025 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: gpib: Modernize gpib_interface_t initialization and make static

All interface drivers were using the old style initialization of this struct

field : value;

This generated the followng sparse warning, for example:
agilent_82357a/agilent_82357a.c:1492:1: warning: obsolete struct initializer, use C99 syntax

Change the initialization to use the C99 syntax

.field = value;

This also resolves the checkpatch constraint of no indentation.

These structs were also not declared as static, unnecessarily polluting the symbol namespace and generating the following sparse warnings, for example:

agilent_82357a/agilent_82357a.c:1465:18: warning: symbol 'agilent_82357a_gpib_interface' was not declared. Should it be static?

Declare them as static and remove any conflicting extern declarations in the corresponding include files.

---
v1 -> v2 Add subsystem prefix to subject

 .../gpib/agilent_82350b/agilent_82350b.c      | 100 ++--
 .../gpib/agilent_82350b/agilent_82350b.h      |   2 -
 .../gpib/agilent_82357a/agilent_82357a.c      |  56 +-
 drivers/staging/gpib/cb7210/cb7210.c          | 464 ++++++++--------
 drivers/staging/gpib/cec/cec.h                |   4 -
 drivers/staging/gpib/cec/cec_gpib.c           |  52 +-
 drivers/staging/gpib/eastwood/fluke_gpib.c    | 150 ++---
 drivers/staging/gpib/fmh_gpib/fmh_gpib.c      | 208 +++----
 drivers/staging/gpib/gpio/gpib_bitbang.c      |  50 +-
 drivers/staging/gpib/hp_82335/hp82335.c       |  52 +-
 drivers/staging/gpib/hp_82341/hp_82341.c      | 102 ++--
 drivers/staging/gpib/ines/ines.h              |   7 -
 drivers/staging/gpib/ines/ines_gpib.c         | 208 +++----
 .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c        |  54 +-
 drivers/staging/gpib/ni_usb/ni_usb_gpib.c     |  54 +-
 drivers/staging/gpib/pc2/pc2_gpib.c           | 208 +++----
 drivers/staging/gpib/tnt4882/tnt4882_gpib.c   | 520 +++++++++---------
 17 files changed, 1139 insertions(+), 1152 deletions(-)
drivers/staging/gpib/agilent_82350b/agilent_82350b.c +50 -50
index e9c1f0100b2a..95bb55b4c0e9 100644
@@ -828,58 +828,58 @@ void agilent_82350b_detach(gpib_board_t *board)
 	agilent_82350b_free_private(board);
 }
 
-gpib_interface_t agilent_82350b_unaccel_interface = {
-name: "agilent_82350b_unaccel",
-attach : agilent_82350b_unaccel_attach,
-detach : agilent_82350b_detach,
-read : agilent_82350b_read,
-write : agilent_82350b_write,
-command : agilent_82350b_command,
-request_system_control : agilent_82350b_request_system_control,
-take_control : agilent_82350b_take_control,
-go_to_standby : agilent_82350b_go_to_standby,
-interface_clear : agilent_82350b_interface_clear,
-remote_enable : agilent_82350b_remote_enable,
-enable_eos : agilent_82350b_enable_eos,
-disable_eos : agilent_82350b_disable_eos,
-parallel_poll : agilent_82350b_parallel_poll,
-parallel_poll_configure : agilent_82350b_parallel_poll_configure,
-parallel_poll_response : agilent_82350b_parallel_poll_response,
-local_parallel_poll_mode : NULL, // XXX
-line_status : agilent_82350b_line_status,
-update_status : agilent_82350b_update_status,
-primary_address : agilent_82350b_primary_address,
-secondary_address : agilent_82350b_secondary_address,
-serial_poll_response : agilent_82350b_serial_poll_response,
-t1_delay : agilent_82350b_t1_delay,
-return_to_local : agilent_82350b_return_to_local,
+static gpib_interface_t agilent_82350b_unaccel_interface = {
+	.name = "agilent_82350b_unaccel",
+	.attach = agilent_82350b_unaccel_attach,
+	.detach = agilent_82350b_detach,
+	.read = agilent_82350b_read,
+	.write = agilent_82350b_write,
+	.command = agilent_82350b_command,
+	.request_system_control = agilent_82350b_request_system_control,
+	.take_control = agilent_82350b_take_control,
+	.go_to_standby = agilent_82350b_go_to_standby,
+	.interface_clear = agilent_82350b_interface_clear,
+	.remote_enable = agilent_82350b_remote_enable,
+	.enable_eos = agilent_82350b_enable_eos,
+	.disable_eos = agilent_82350b_disable_eos,
+	.parallel_poll = agilent_82350b_parallel_poll,
+	.parallel_poll_configure = agilent_82350b_parallel_poll_configure,
+	.parallel_poll_response = agilent_82350b_parallel_poll_response,
+	.local_parallel_poll_mode = NULL, // XXX
+	.line_status = agilent_82350b_line_status,
+	.update_status = agilent_82350b_update_status,
+	.primary_address = agilent_82350b_primary_address,
+	.secondary_address = agilent_82350b_secondary_address,
+	.serial_poll_response = agilent_82350b_serial_poll_response,
+	.t1_delay = agilent_82350b_t1_delay,
+	.return_to_local = agilent_82350b_return_to_local,
 };
 
-gpib_interface_t agilent_82350b_interface = {
-name: "agilent_82350b",
-attach : agilent_82350b_accel_attach,
-detach : agilent_82350b_detach,
-read : agilent_82350b_accel_read,
-write : agilent_82350b_accel_write,
-command : agilent_82350b_command,
-request_system_control : agilent_82350b_request_system_control,
-take_control : agilent_82350b_take_control,
-go_to_standby : agilent_82350b_go_to_standby,
-interface_clear : agilent_82350b_interface_clear,
-remote_enable : agilent_82350b_remote_enable,
-enable_eos : agilent_82350b_enable_eos,
-disable_eos : agilent_82350b_disable_eos,
-parallel_poll : agilent_82350b_parallel_poll,
-parallel_poll_configure : agilent_82350b_parallel_poll_configure,
-parallel_poll_response : agilent_82350b_parallel_poll_response,
-local_parallel_poll_mode : NULL, // XXX
-line_status : agilent_82350b_line_status,
-update_status : agilent_82350b_update_status,
-primary_address : agilent_82350b_primary_address,
-secondary_address : agilent_82350b_secondary_address,
-serial_poll_response : agilent_82350b_serial_poll_response,
-t1_delay : agilent_82350b_t1_delay,
-return_to_local : agilent_82350b_return_to_local,
+static gpib_interface_t agilent_82350b_interface = {
+	.name = "agilent_82350b",
+	.attach = agilent_82350b_accel_attach,
+	.detach = agilent_82350b_detach,
+	.read = agilent_82350b_accel_read,
+	.write = agilent_82350b_accel_write,
+	.command = agilent_82350b_command,
+	.request_system_control = agilent_82350b_request_system_control,
+	.take_control = agilent_82350b_take_control,
+	.go_to_standby = agilent_82350b_go_to_standby,
+	.interface_clear = agilent_82350b_interface_clear,
+	.remote_enable = agilent_82350b_remote_enable,
+	.enable_eos = agilent_82350b_enable_eos,
+	.disable_eos = agilent_82350b_disable_eos,
+	.parallel_poll = agilent_82350b_parallel_poll,
+	.parallel_poll_configure = agilent_82350b_parallel_poll_configure,
+	.parallel_poll_response = agilent_82350b_parallel_poll_response,
+	.local_parallel_poll_mode = NULL, // XXX
+	.line_status = agilent_82350b_line_status,
+	.update_status = agilent_82350b_update_status,
+	.primary_address = agilent_82350b_primary_address,
+	.secondary_address = agilent_82350b_secondary_address,
+	.serial_poll_response = agilent_82350b_serial_poll_response,
+	.t1_delay = agilent_82350b_t1_delay,
+	.return_to_local = agilent_82350b_return_to_local,
 };
 
 static int agilent_82350b_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
drivers/staging/gpib/agilent_82350b/agilent_82350b.h +0 -2
index 30683d67d170..6915c1b2c85b 100644
@@ -60,8 +60,6 @@ struct agilent_82350b_priv {
 // driver name
 extern const char *driver_name;
 
-// interfaces
-extern gpib_interface_t agilent_82350b_interface;
 // init functions
 
 int agilent_82350b_unaccel_attach(gpib_board_t *board, const gpib_board_config_t *config);
drivers/staging/gpib/agilent_82357a/agilent_82357a.c +28 -28

62 lines not on this page · raw message

drivers/staging/gpib/cb7210/cb7210.c +232 -232

490 lines not on this page · raw message

drivers/staging/gpib/cec/cec.h +0 -4
index 352cf83d8328..040ca70ed708 100644
@@ -16,10 +16,6 @@ struct cec_priv  {
 	unsigned int irq;
 };
 
-// interfaces
-extern gpib_interface_t cec_pci_interface;
-extern gpib_interface_t cec_pcmcia_interface;
-
 // interface functions
 int cec_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read);
 int cec_write(gpib_board_t *board, uint8_t *buffer, size_t length, int send_eoi,
drivers/staging/gpib/cec/cec_gpib.c +26 -26

58 lines not on this page · raw message

drivers/staging/gpib/eastwood/fluke_gpib.c +75 -75

164 lines not on this page · raw message

drivers/staging/gpib/fmh_gpib/fmh_gpib.c +104 -104

220 lines not on this page · raw message

drivers/staging/gpib/gpio/gpib_bitbang.c +25 -25

56 lines not on this page · raw message

drivers/staging/gpib/hp_82335/hp82335.c +26 -26

58 lines not on this page · raw message

drivers/staging/gpib/hp_82341/hp_82341.c +51 -51

110 lines not on this page · raw message

drivers/staging/gpib/ines/ines.h +0 -7
index 7e8302619998..4e243d7951af 100644
@@ -35,13 +35,6 @@ struct ines_priv {
 	u8 extend_mode_bits;
 };
 
-// interfaces
-extern gpib_interface_t ines_pci_interface;
-extern gpib_interface_t ines_pci_accel_interface;
-extern gpib_interface_t ines_pcmcia_interface;
-extern gpib_interface_t ines_pcmcia_accel_interface;
-extern gpib_interface_t ines_pcmcia_unaccel_interface;
-
 // interface functions
 int ines_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read);
 int ines_write(gpib_board_t *board, uint8_t *buffer, size_t length,
drivers/staging/gpib/ines/ines_gpib.c +104 -104

220 lines not on this page · raw message

drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +27 -27

60 lines not on this page · raw message

drivers/staging/gpib/ni_usb/ni_usb_gpib.c +27 -27

60 lines not on this page · raw message

drivers/staging/gpib/pc2/pc2_gpib.c +104 -104

220 lines not on this page · raw message

drivers/staging/gpib/tnt4882/tnt4882_gpib.c +260 -260

545 lines not on this page · raw message

Signature · 1 line
2.47.1
#1 lore raw
kernel test robot noticed the following build errors:

Hi Dave,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Modernize-gpib_interface_t-initialization-and-make-static/20250109-014247
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250108174121.23044-1-dpenkler%40gmail.com
patch subject: [PATCH v2] staging: gpib: Modernize gpib_interface_t initialization and make static
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20250109/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/staging/gpib/cb7210/cb7210.c: In function 'cb7210_line_status':
drivers/staging/gpib/cb7210/cb7210.c:383:30: warning: variable 'nec_priv' set but not used [-Wunused-but-set-variable]

     383 |         struct nec7210_priv *nec_priv;
         |                              ^~~~~~~~
   drivers/staging/gpib/cb7210/cb7210.c: In function 'cb_gpib_config':
   drivers/staging/gpib/cb7210/cb7210.c:1265:28: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
    1265 |         struct local_info *dev;
         |                            ^~~
   drivers/staging/gpib/cb7210/cb7210.c:1264:31: warning: variable 'handle' set but not used [-Wunused-but-set-variable]
    1264 |         struct pcmcia_device *handle;
         |                               ^~~~~~
   drivers/staging/gpib/cb7210/cb7210.c: At top level:
>> drivers/staging/gpib/cb7210/cb7210.c:1360:25: error: static declaration of 'cb_pcmcia_unaccel_interface' follows non-static declaration
    1360 | static gpib_interface_t cb_pcmcia_unaccel_interface = {
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/staging/gpib/cb7210/cb7210.c:8:
   drivers/staging/gpib/cb7210/cb7210.h:42:25: note: previous declaration of 'cb_pcmcia_unaccel_interface' with type 'gpib_interface_t' {aka 'struct gpib_interface_struct'}
      42 | extern gpib_interface_t cb_pcmcia_unaccel_interface;
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/gpib/cb7210/cb7210.c:1388:25: error: static declaration of 'cb_pcmcia_interface' follows non-static declaration
    1388 | static gpib_interface_t cb_pcmcia_interface = {
         |                         ^~~~~~~~~~~~~~~~~~~
   drivers/staging/gpib/cb7210/cb7210.h:40:25: note: previous declaration of 'cb_pcmcia_interface' with type 'gpib_interface_t' {aka 'struct gpib_interface_struct'}
      40 | extern gpib_interface_t cb_pcmcia_interface;
         |                         ^~~~~~~~~~~~~~~~~~~
>> drivers/staging/gpib/cb7210/cb7210.c:1416:25: error: static declaration of 'cb_pcmcia_accel_interface' follows non-static declaration
    1416 | static gpib_interface_t cb_pcmcia_accel_interface = {
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/gpib/cb7210/cb7210.h:41:25: note: previous declaration of 'cb_pcmcia_accel_interface' with type 'gpib_interface_t' {aka 'struct gpib_interface_struct'}
      41 | extern gpib_interface_t cb_pcmcia_accel_interface;
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~

vim +/cb_pcmcia_unaccel_interface +1360 drivers/staging/gpib/cb7210/cb7210.c

1359

> 1360	static gpib_interface_t cb_pcmcia_unaccel_interface = {
  1361		.name = "cbi_pcmcia_unaccel",
  1362		.attach = cb_pcmcia_attach,
  1363		.detach = cb_pcmcia_detach,
  1364		.read = cb7210_read,
  1365		.write = cb7210_write,
  1366		.command = cb7210_command,
  1367		.take_control = cb7210_take_control,
  1368		.go_to_standby = cb7210_go_to_standby,
  1369		.request_system_control = cb7210_request_system_control,
  1370		.interface_clear = cb7210_interface_clear,
  1371		.remote_enable = cb7210_remote_enable,
  1372		.enable_eos = cb7210_enable_eos,
  1373		.disable_eos = cb7210_disable_eos,
  1374		.parallel_poll = cb7210_parallel_poll,
  1375		.parallel_poll_configure = cb7210_parallel_poll_configure,
  1376		.parallel_poll_response = cb7210_parallel_poll_response,
  1377		.local_parallel_poll_mode = NULL, // XXX
  1378		.line_status = cb7210_line_status,
  1379		.update_status = cb7210_update_status,
  1380		.primary_address = cb7210_primary_address,
  1381		.secondary_address = cb7210_secondary_address,
  1382		.serial_poll_response = cb7210_serial_poll_response,
  1383		.serial_poll_status = cb7210_serial_poll_status,
  1384		.t1_delay = cb7210_t1_delay,
  1385		.return_to_local = cb7210_return_to_local,
  1386	};
  1387	
> 1388	static gpib_interface_t cb_pcmcia_interface = {
  1389		.name = "cbi_pcmcia",
  1390		.attach = cb_pcmcia_attach,
  1391		.detach = cb_pcmcia_detach,
  1392		.read = cb7210_accel_read,
  1393		.write = cb7210_accel_write,
  1394		.command = cb7210_command,
  1395		.take_control = cb7210_take_control,
  1396		.go_to_standby = cb7210_go_to_standby,
  1397		.request_system_control = cb7210_request_system_control,
  1398		.interface_clear = cb7210_interface_clear,
  1399		.remote_enable = cb7210_remote_enable,
  1400		.enable_eos = cb7210_enable_eos,
  1401		.disable_eos = cb7210_disable_eos,
  1402		.parallel_poll = cb7210_parallel_poll,
  1403		.parallel_poll_configure = cb7210_parallel_poll_configure,
  1404		.parallel_poll_response = cb7210_parallel_poll_response,
  1405		.local_parallel_poll_mode = NULL, // XXX
  1406		.line_status = cb7210_line_status,
  1407		.update_status = cb7210_update_status,
  1408		.primary_address = cb7210_primary_address,
  1409		.secondary_address = cb7210_secondary_address,
  1410		.serial_poll_response = cb7210_serial_poll_response,
  1411		.serial_poll_status = cb7210_serial_poll_status,
  1412		.t1_delay = cb7210_t1_delay,
  1413		.return_to_local = cb7210_return_to_local,
  1414	};
  1415	
> 1416	static gpib_interface_t cb_pcmcia_accel_interface = {

1417 .name = "cbi_pcmcia_accel",
1418 .attach = cb_pcmcia_attach,
1419 .detach = cb_pcmcia_detach,
1420 .read = cb7210_accel_read,
1421 .write = cb7210_accel_write,
1422 .command = cb7210_command,
1423 .take_control = cb7210_take_control,
1424 .go_to_standby = cb7210_go_to_standby,
1425 .request_system_control = cb7210_request_system_control,
1426 .interface_clear = cb7210_interface_clear,
1427 .remote_enable = cb7210_remote_enable,
1428 .enable_eos = cb7210_enable_eos,
1429 .disable_eos = cb7210_disable_eos,
1430 .parallel_poll = cb7210_parallel_poll,
1431 .parallel_poll_configure = cb7210_parallel_poll_configure,
1432 .parallel_poll_response = cb7210_parallel_poll_response,
1433 .local_parallel_poll_mode = NULL, // XXX
1434 .line_status = cb7210_line_status,
1435 .update_status = cb7210_update_status,
1436 .primary_address = cb7210_primary_address,
1437 .secondary_address = cb7210_secondary_address,
1438 .serial_poll_response = cb7210_serial_poll_response,
1439 .serial_poll_status = cb7210_serial_poll_status,
1440 .t1_delay = cb7210_t1_delay,
1441 .return_to_local = cb7210_return_to_local,
1442 };
1443

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#2 lore raw
In reply to Dave Penkler
kernel test robot noticed the following build errors:

Hi Dave,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Modernize-gpib_interface_t-initialization-and-make-static/20250109-014247
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250108174121.23044-1-dpenkler%40gmail.com
patch subject: [PATCH v2] staging: gpib: Modernize gpib_interface_t initialization and make static
config: x86_64-randconfig-077-20250109 (https://download.01.org/0day-ci/archive/20250109/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/staging/gpib/hp_82335/hp82335.c:175:25: error: static declaration of 'hp82335_interface' follows non-static declaration
     175 | static gpib_interface_t hp82335_interface = {
         |                         ^~~~~~~~~~~~~~~~~
   In file included from drivers/staging/gpib/hp_82335/hp82335.c:11:
   drivers/staging/gpib/hp_82335/hp82335.h:21:25: note: previous declaration of 'hp82335_interface' with type 'gpib_interface_t' {aka 'struct gpib_interface_struct'}
      21 | extern gpib_interface_t hp82335_interface;
         |                         ^~~~~~~~~~~~~~~~~

vim +/hp82335_interface +175 drivers/staging/gpib/hp_82335/hp82335.c

174

 > 175	static gpib_interface_t hp82335_interface = {

176 .name = "hp82335",
177 .attach = hp82335_attach,
178 .detach = hp82335_detach,
179 .read = hp82335_read,
180 .write = hp82335_write,
181 .command = hp82335_command,
182 .request_system_control = hp82335_request_system_control,
183 .take_control = hp82335_take_control,
184 .go_to_standby = hp82335_go_to_standby,
185 .interface_clear = hp82335_interface_clear,
186 .remote_enable = hp82335_remote_enable,
187 .enable_eos = hp82335_enable_eos,
188 .disable_eos = hp82335_disable_eos,
189 .parallel_poll = hp82335_parallel_poll,
190 .parallel_poll_configure = hp82335_parallel_poll_configure,
191 .parallel_poll_response = hp82335_parallel_poll_response,
192 .local_parallel_poll_mode = NULL, // XXX
193 .line_status = hp82335_line_status,
194 .update_status = hp82335_update_status,
195 .primary_address = hp82335_primary_address,
196 .secondary_address = hp82335_secondary_address,
197 .serial_poll_response = hp82335_serial_poll_response,
198 .serial_poll_status = hp82335_serial_poll_status,
199 .t1_delay = hp82335_t1_delay,
200 .return_to_local = hp82335_return_to_local,
201 };
202

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#3 lore raw
In reply to Dave Penkler
kernel test robot noticed the following build warnings:

Hi Dave,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Modernize-gpib_interface_t-initialization-and-make-static/20250109-014247
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250108174121.23044-1-dpenkler%40gmail.com
patch subject: [PATCH v2] staging: gpib: Modernize gpib_interface_t initialization and make static
config: alpha-randconfig-r113-20250109 (https://download.01.org/0day-ci/archive/20250110/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250110/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
drivers/staging/gpib/ines/ines_gpib.c:378:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:379:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:380:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:381:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:382:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:383:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:385:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:386:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:387:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:388:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:389:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:390:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:391:10: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1237:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1238:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1239:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1240:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1241:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1242:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1243:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1244:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1245:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1246:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1247:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1248:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1249:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1250:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1251:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1252:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1253:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1254:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1255:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1256:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1257:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1258:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1259:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1260:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1261:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1265:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1266:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1267:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1268:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1269:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1270:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1271:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1272:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1273:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1274:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1275:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1276:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1277:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1278:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1279:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1280:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1281:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1282:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1283:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1284:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1285:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1286:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1287:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1288:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1289:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1293:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1294:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1295:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1296:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1297:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1298:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1299:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1300:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1301:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1302:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1303:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1304:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1305:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1306:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1307:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1308:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1309:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1310:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1311:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1312:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1313:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1314:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1315:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1316:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:1317:1: sparse: sparse: obsolete struct initializer, use C99 syntax drivers/staging/gpib/ines/ines_gpib.c:801:36: sparse: sparse: Using plain integer as NULL pointer
drivers/staging/gpib/ines/ines_gpib.c:1157:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *virt @@ got void [noderef] __iomem * @@
drivers/staging/gpib/ines/ines_gpib.c:1157:14: sparse: expected void *virt
drivers/staging/gpib/ines/ines_gpib.c:1157:14: sparse: got void [noderef] __iomem *
drivers/staging/gpib/ines/ines_gpib.c:1158:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/staging/gpib/ines/ines_gpib.c:1158:61: sparse: expected void volatile [noderef] __iomem *addr
drivers/staging/gpib/ines/ines_gpib.c:1158:61: sparse: got void *
drivers/staging/gpib/ines/ines_gpib.c:1159:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/staging/gpib/ines/ines_gpib.c:1159:18: sparse: expected void volatile [noderef] __iomem *addr
drivers/staging/gpib/ines/ines_gpib.c:1159:18: sparse: got void *
drivers/staging/gpib/ines/ines_gpib.c:1346:82: sparse: sparse: Using plain integer as NULL pointer

>> drivers/staging/gpib/ines/ines_gpib.c:1236:18: sparse: sparse: symbol 'ines_pcmcia_unaccel_interface' was not declared. Should it be static?
>> drivers/staging/gpib/ines/ines_gpib.c:1264:18: sparse: sparse: symbol 'ines_pcmcia_accel_interface' was not declared. Should it be static?
>> drivers/staging/gpib/ines/ines_gpib.c:1292:18: sparse: sparse: symbol 'ines_pcmcia_interface' was not declared. Should it be static?

drivers/staging/gpib/ines/ines_gpib.c: note: in included file (through arch/alpha/include/asm/core_cia.h, arch/alpha/include/asm/io.h, include/linux/io.h, ...):
arch/alpha/include/asm/io_trivial.h:12:16: sparse: sparse: undefined identifier '__kernel_ldbu' arch/alpha/include/asm/io_trivial.h:24:9: sparse: sparse: undefined identifier '__kernel_stb' arch/alpha/include/asm/io_trivial.h:76:9: sparse: sparse: undefined identifier '__kernel_stb'

vim +/ines_pcmcia_unaccel_interface +1236 drivers/staging/gpib/ines/ines_gpib.c

bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1235

bb1bd92fa0f2c9 Dave Penkler 2024-09-18 @1236  gpib_interface_t ines_pcmcia_unaccel_interface = {
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1237  name: "ines_pcmcia_unaccel",
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1238  attach : ines_pcmcia_attach,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1239  detach : ines_pcmcia_detach,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1240  read : ines_read,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1241  write : ines_write,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1242  command : ines_command,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1243  take_control : ines_take_control,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1244  go_to_standby : ines_go_to_standby,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1245  request_system_control : ines_request_system_control,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1246  interface_clear : ines_interface_clear,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1247  remote_enable : ines_remote_enable,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1248  enable_eos : ines_enable_eos,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1249  disable_eos : ines_disable_eos,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1250  parallel_poll : ines_parallel_poll,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1251  parallel_poll_configure : ines_parallel_poll_configure,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1252  parallel_poll_response : ines_parallel_poll_response,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1253  local_parallel_poll_mode : NULL, // XXX
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1254  line_status : ines_line_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1255  update_status : ines_update_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1256  primary_address : ines_primary_address,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1257  secondary_address : ines_secondary_address,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1258  serial_poll_response : ines_serial_poll_response,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1259  serial_poll_status : ines_serial_poll_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1260  t1_delay : ines_t1_delay,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1261  return_to_local : ines_return_to_local,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1262  };
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1263  
bb1bd92fa0f2c9 Dave Penkler 2024-09-18 @1264  gpib_interface_t ines_pcmcia_accel_interface = {
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1265  name: "ines_pcmcia_accel",
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1266  attach : ines_pcmcia_accel_attach,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1267  detach : ines_pcmcia_detach,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1268  read : ines_accel_read,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1269  write : ines_accel_write,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1270  command : ines_command,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1271  take_control : ines_take_control,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1272  go_to_standby : ines_go_to_standby,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1273  request_system_control : ines_request_system_control,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1274  interface_clear : ines_interface_clear,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1275  remote_enable : ines_remote_enable,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1276  enable_eos : ines_enable_eos,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1277  disable_eos : ines_disable_eos,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1278  parallel_poll : ines_parallel_poll,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1279  parallel_poll_configure : ines_parallel_poll_configure,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1280  parallel_poll_response : ines_parallel_poll_response,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1281  local_parallel_poll_mode : NULL, // XXX
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1282  line_status : ines_line_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1283  update_status : ines_update_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1284  primary_address : ines_primary_address,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1285  secondary_address : ines_secondary_address,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1286  serial_poll_response : ines_serial_poll_response,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1287  serial_poll_status : ines_serial_poll_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1288  t1_delay : ines_t1_delay,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1289  return_to_local : ines_return_to_local,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1290  };
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1291  
bb1bd92fa0f2c9 Dave Penkler 2024-09-18 @1292  gpib_interface_t ines_pcmcia_interface = {
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1293  name: "ines_pcmcia",
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1294  attach : ines_pcmcia_accel_attach,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1295  detach : ines_pcmcia_detach,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1296  read : ines_accel_read,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1297  write : ines_accel_write,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1298  command : ines_command,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1299  take_control : ines_take_control,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1300  go_to_standby : ines_go_to_standby,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1301  request_system_control : ines_request_system_control,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1302  interface_clear : ines_interface_clear,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1303  remote_enable : ines_remote_enable,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1304  enable_eos : ines_enable_eos,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1305  disable_eos : ines_disable_eos,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1306  parallel_poll : ines_parallel_poll,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1307  parallel_poll_configure : ines_parallel_poll_configure,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1308  parallel_poll_response : ines_parallel_poll_response,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1309  local_parallel_poll_mode : NULL, // XXX
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1310  line_status : ines_line_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1311  update_status : ines_update_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1312  primary_address : ines_primary_address,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1313  secondary_address : ines_secondary_address,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1314  serial_poll_response : ines_serial_poll_response,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1315  serial_poll_status : ines_serial_poll_status,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1316  t1_delay : ines_t1_delay,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1317  return_to_local : ines_return_to_local,
bb1bd92fa0f2c9 Dave Penkler 2024-09-18  1318  };

bb1bd92fa0f2c9 Dave Penkler 2024-09-18 1319

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#4 lore raw
In reply to Dave Penkler
Quoted 18 lines · Dave Penkler

All interface drivers were using the old style initialization of this struct

field : value;

This generated the followng sparse warning, for example:
agilent_82357a/agilent_82357a.c:1492:1: warning: obsolete struct initializer, use C99 syntax

Change the initialization to use the C99 syntax

.field = value;

This also resolves the checkpatch constraint of no indentation.

These structs were also not declared as static, unnecessarily polluting the symbol namespace and generating the following sparse warnings, for example:

Quoted 8 lines

agilent_82357a/agilent_82357a.c:1465:18: warning: symbol 'agilent_82357a_gpib_interface' was not declared. Should it be static?

Declare them as static and remove any conflicting extern declarations in the corresponding include files.

---
v1 -> v2 Add subsystem prefix to subject

Please test-build your changes before sending them out :(

thanks,

greg k-h