Skip to content

Commit 95cfc75

Browse files
dpenklergregkh
authored andcommitted
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. 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 9125aa2 commit 95cfc75

File tree

20 files changed

+1217
-1240
lines changed

20 files changed

+1217
-1240
lines changed

drivers/staging/gpib/agilent_82350b/agilent_82350b.c

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -825,58 +825,58 @@ void agilent_82350b_detach(gpib_board_t *board)
825825
agilent_82350b_free_private(board);
826826
}
827827

828-
gpib_interface_t agilent_82350b_unaccel_interface = {
829-
name: "agilent_82350b_unaccel",
830-
attach : agilent_82350b_unaccel_attach,
831-
detach : agilent_82350b_detach,
832-
read : agilent_82350b_read,
833-
write : agilent_82350b_write,
834-
command : agilent_82350b_command,
835-
request_system_control : agilent_82350b_request_system_control,
836-
take_control : agilent_82350b_take_control,
837-
go_to_standby : agilent_82350b_go_to_standby,
838-
interface_clear : agilent_82350b_interface_clear,
839-
remote_enable : agilent_82350b_remote_enable,
840-
enable_eos : agilent_82350b_enable_eos,
841-
disable_eos : agilent_82350b_disable_eos,
842-
parallel_poll : agilent_82350b_parallel_poll,
843-
parallel_poll_configure : agilent_82350b_parallel_poll_configure,
844-
parallel_poll_response : agilent_82350b_parallel_poll_response,
845-
local_parallel_poll_mode : NULL, // XXX
846-
line_status : agilent_82350b_line_status,
847-
update_status : agilent_82350b_update_status,
848-
primary_address : agilent_82350b_primary_address,
849-
secondary_address : agilent_82350b_secondary_address,
850-
serial_poll_response : agilent_82350b_serial_poll_response,
851-
t1_delay : agilent_82350b_t1_delay,
852-
return_to_local : agilent_82350b_return_to_local,
828+
static gpib_interface_t agilent_82350b_unaccel_interface = {
829+
.name = "agilent_82350b_unaccel",
830+
.attach = agilent_82350b_unaccel_attach,
831+
.detach = agilent_82350b_detach,
832+
.read = agilent_82350b_read,
833+
.write = agilent_82350b_write,
834+
.command = agilent_82350b_command,
835+
.request_system_control = agilent_82350b_request_system_control,
836+
.take_control = agilent_82350b_take_control,
837+
.go_to_standby = agilent_82350b_go_to_standby,
838+
.interface_clear = agilent_82350b_interface_clear,
839+
.remote_enable = agilent_82350b_remote_enable,
840+
.enable_eos = agilent_82350b_enable_eos,
841+
.disable_eos = agilent_82350b_disable_eos,
842+
.parallel_poll = agilent_82350b_parallel_poll,
843+
.parallel_poll_configure = agilent_82350b_parallel_poll_configure,
844+
.parallel_poll_response = agilent_82350b_parallel_poll_response,
845+
.local_parallel_poll_mode = NULL, // XXX
846+
.line_status = agilent_82350b_line_status,
847+
.update_status = agilent_82350b_update_status,
848+
.primary_address = agilent_82350b_primary_address,
849+
.secondary_address = agilent_82350b_secondary_address,
850+
.serial_poll_response = agilent_82350b_serial_poll_response,
851+
.t1_delay = agilent_82350b_t1_delay,
852+
.return_to_local = agilent_82350b_return_to_local,
853853
};
854854

855-
gpib_interface_t agilent_82350b_interface = {
856-
name: "agilent_82350b",
857-
attach : agilent_82350b_accel_attach,
858-
detach : agilent_82350b_detach,
859-
read : agilent_82350b_accel_read,
860-
write : agilent_82350b_accel_write,
861-
command : agilent_82350b_command,
862-
request_system_control : agilent_82350b_request_system_control,
863-
take_control : agilent_82350b_take_control,
864-
go_to_standby : agilent_82350b_go_to_standby,
865-
interface_clear : agilent_82350b_interface_clear,
866-
remote_enable : agilent_82350b_remote_enable,
867-
enable_eos : agilent_82350b_enable_eos,
868-
disable_eos : agilent_82350b_disable_eos,
869-
parallel_poll : agilent_82350b_parallel_poll,
870-
parallel_poll_configure : agilent_82350b_parallel_poll_configure,
871-
parallel_poll_response : agilent_82350b_parallel_poll_response,
872-
local_parallel_poll_mode : NULL, // XXX
873-
line_status : agilent_82350b_line_status,
874-
update_status : agilent_82350b_update_status,
875-
primary_address : agilent_82350b_primary_address,
876-
secondary_address : agilent_82350b_secondary_address,
877-
serial_poll_response : agilent_82350b_serial_poll_response,
878-
t1_delay : agilent_82350b_t1_delay,
879-
return_to_local : agilent_82350b_return_to_local,
855+
static gpib_interface_t agilent_82350b_interface = {
856+
.name = "agilent_82350b",
857+
.attach = agilent_82350b_accel_attach,
858+
.detach = agilent_82350b_detach,
859+
.read = agilent_82350b_accel_read,
860+
.write = agilent_82350b_accel_write,
861+
.command = agilent_82350b_command,
862+
.request_system_control = agilent_82350b_request_system_control,
863+
.take_control = agilent_82350b_take_control,
864+
.go_to_standby = agilent_82350b_go_to_standby,
865+
.interface_clear = agilent_82350b_interface_clear,
866+
.remote_enable = agilent_82350b_remote_enable,
867+
.enable_eos = agilent_82350b_enable_eos,
868+
.disable_eos = agilent_82350b_disable_eos,
869+
.parallel_poll = agilent_82350b_parallel_poll,
870+
.parallel_poll_configure = agilent_82350b_parallel_poll_configure,
871+
.parallel_poll_response = agilent_82350b_parallel_poll_response,
872+
.local_parallel_poll_mode = NULL, // XXX
873+
.line_status = agilent_82350b_line_status,
874+
.update_status = agilent_82350b_update_status,
875+
.primary_address = agilent_82350b_primary_address,
876+
.secondary_address = agilent_82350b_secondary_address,
877+
.serial_poll_response = agilent_82350b_serial_poll_response,
878+
.t1_delay = agilent_82350b_t1_delay,
879+
.return_to_local = agilent_82350b_return_to_local,
880880
};
881881

882882
static int agilent_82350b_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)

drivers/staging/gpib/agilent_82350b/agilent_82350b.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ struct agilent_82350b_priv {
6060
// driver name
6161
extern const char *driver_name;
6262

63-
// interfaces
64-
extern gpib_interface_t agilent_82350b_interface;
6563
// init functions
6664

6765
int agilent_82350b_unaccel_attach(gpib_board_t *board, const gpib_board_config_t *config);

drivers/staging/gpib/agilent_82357a/agilent_82357a.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,34 +1462,34 @@ static void agilent_82357a_detach(gpib_board_t *board)
14621462
mutex_unlock(&agilent_82357a_hotplug_lock);
14631463
}
14641464

1465-
gpib_interface_t agilent_82357a_gpib_interface = {
1466-
name: "agilent_82357a",
1467-
attach : agilent_82357a_attach,
1468-
detach : agilent_82357a_detach,
1469-
read : agilent_82357a_read,
1470-
write : agilent_82357a_write,
1471-
command : agilent_82357a_command,
1472-
take_control : agilent_82357a_take_control,
1473-
go_to_standby : agilent_82357a_go_to_standby,
1474-
request_system_control : agilent_82357a_request_system_control,
1475-
interface_clear : agilent_82357a_interface_clear,
1476-
remote_enable : agilent_82357a_remote_enable,
1477-
enable_eos : agilent_82357a_enable_eos,
1478-
disable_eos : agilent_82357a_disable_eos,
1479-
parallel_poll : agilent_82357a_parallel_poll,
1480-
parallel_poll_configure : agilent_82357a_parallel_poll_configure,
1481-
parallel_poll_response : agilent_82357a_parallel_poll_response,
1482-
local_parallel_poll_mode : NULL, // XXX
1483-
line_status : agilent_82357a_line_status,
1484-
update_status : agilent_82357a_update_status,
1485-
primary_address : agilent_82357a_primary_address,
1486-
secondary_address : agilent_82357a_secondary_address,
1487-
serial_poll_response : agilent_82357a_serial_poll_response,
1488-
serial_poll_status : agilent_82357a_serial_poll_status,
1489-
t1_delay : agilent_82357a_t1_delay,
1490-
return_to_local : agilent_82357a_return_to_local,
1491-
no_7_bit_eos : 1,
1492-
skip_check_for_command_acceptors : 1
1465+
static gpib_interface_t agilent_82357a_gpib_interface = {
1466+
.name = "agilent_82357a",
1467+
.attach = agilent_82357a_attach,
1468+
.detach = agilent_82357a_detach,
1469+
.read = agilent_82357a_read,
1470+
.write = agilent_82357a_write,
1471+
.command = agilent_82357a_command,
1472+
.take_control = agilent_82357a_take_control,
1473+
.go_to_standby = agilent_82357a_go_to_standby,
1474+
.request_system_control = agilent_82357a_request_system_control,
1475+
.interface_clear = agilent_82357a_interface_clear,
1476+
.remote_enable = agilent_82357a_remote_enable,
1477+
.enable_eos = agilent_82357a_enable_eos,
1478+
.disable_eos = agilent_82357a_disable_eos,
1479+
.parallel_poll = agilent_82357a_parallel_poll,
1480+
.parallel_poll_configure = agilent_82357a_parallel_poll_configure,
1481+
.parallel_poll_response = agilent_82357a_parallel_poll_response,
1482+
.local_parallel_poll_mode = NULL, // XXX
1483+
.line_status = agilent_82357a_line_status,
1484+
.update_status = agilent_82357a_update_status,
1485+
.primary_address = agilent_82357a_primary_address,
1486+
.secondary_address = agilent_82357a_secondary_address,
1487+
.serial_poll_response = agilent_82357a_serial_poll_response,
1488+
.serial_poll_status = agilent_82357a_serial_poll_status,
1489+
.t1_delay = agilent_82357a_t1_delay,
1490+
.return_to_local = agilent_82357a_return_to_local,
1491+
.no_7_bit_eos = 1,
1492+
.skip_check_for_command_acceptors = 1
14931493
};
14941494

14951495
// Table with the USB-devices: just now only testing IDs

0 commit comments

Comments
 (0)