Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: gpib: Declare driver entry points static

Many of this driver's entry points were unecessarily not declared
static.

Remove the declarations from the include file.
Make the declarations static in the .c file.
Remove an uneccessary forward declaration in the .c file.

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250502072150.32714-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dave Penkler and committed by
Greg Kroah-Hartman
cfa6673e 034a4568

+47 -89
-44
drivers/staging/gpib/ines/ines.h
··· 35 35 u8 extend_mode_bits; 36 36 }; 37 37 38 - // interface functions 39 - int ines_read(struct gpib_board *board, u8 *buffer, size_t length, 40 - int *end, size_t *bytes_read); 41 - int ines_write(struct gpib_board *board, u8 *buffer, size_t length, 42 - int send_eoi, size_t *bytes_written); 43 - int ines_accel_read(struct gpib_board *board, u8 *buffer, size_t length, 44 - int *end, size_t *bytes_read); 45 - int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, 46 - int send_eoi, size_t *bytes_written); 47 - int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written); 48 - int ines_take_control(struct gpib_board *board, int synchronous); 49 - int ines_go_to_standby(struct gpib_board *board); 50 - int ines_request_system_control(struct gpib_board *board, int request_control); 51 - void ines_interface_clear(struct gpib_board *board, int assert); 52 - void ines_remote_enable(struct gpib_board *board, int enable); 53 - int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits); 54 - void ines_disable_eos(struct gpib_board *board); 55 - unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask); 56 - int ines_primary_address(struct gpib_board *board, unsigned int address); 57 - int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable); 58 - int ines_parallel_poll(struct gpib_board *board, u8 *result); 59 - void ines_parallel_poll_configure(struct gpib_board *board, u8 config); 60 - void ines_parallel_poll_response(struct gpib_board *board, int ist); 61 - void ines_serial_poll_response(struct gpib_board *board, u8 status); 62 - u8 ines_serial_poll_status(struct gpib_board *board); 63 - int ines_line_status(const struct gpib_board *board); 64 - int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec); 65 - void ines_return_to_local(struct gpib_board *board); 66 - 67 - // interrupt service routines 68 - irqreturn_t ines_pci_interrupt(int irq, void *arg); 69 - irqreturn_t ines_interrupt(struct gpib_board *board); 70 - 71 - // utility functions 72 - void ines_free_private(struct gpib_board *board); 73 - int ines_generic_attach(struct gpib_board *board); 74 - void ines_online(struct ines_priv *priv, const struct gpib_board *board, int use_accel); 75 - void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count); 76 - 77 38 /* inb/outb wrappers */ 78 39 static inline unsigned int ines_inb(struct ines_priv *priv, unsigned int register_number) 79 40 { ··· 48 87 outb(value, priv->nec7210_priv.iobase + 49 88 register_number * priv->nec7210_priv.offset); 50 89 } 51 - 52 - // pcmcia init/cleanup 53 - 54 - int ines_pcmcia_init_module(void); 55 - void ines_pcmcia_cleanup_module(void); 56 90 57 91 enum ines_regs { 58 92 // read
+47 -45
drivers/staging/gpib/ines/ines_gpib.c
··· 25 25 MODULE_LICENSE("GPL"); 26 26 MODULE_DESCRIPTION("GPIB driver for Ines iGPIB 72010"); 27 27 28 - int ines_line_status(const struct gpib_board *board) 28 + static irqreturn_t ines_interrupt(struct gpib_board *board); 29 + 30 + static int ines_line_status(const struct gpib_board *board) 29 31 { 30 32 int status = VALID_ALL; 31 33 int bcm_bits; ··· 57 55 return status; 58 56 } 59 57 60 - void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) 58 + static void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) 61 59 { 62 60 if (count > 0xffff) { 63 61 pr_err("bug! tried to set xfer counter > 0xffff\n"); ··· 67 65 ines_outb(priv, count & 0xff, XFER_COUNT_LOWER); 68 66 } 69 67 70 - int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) 68 + static int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) 71 69 { 72 70 struct ines_priv *ines_priv = board->private_data; 73 71 struct nec7210_priv *nec_priv = &ines_priv->nec7210_priv; ··· 135 133 return retval; 136 134 } 137 135 138 - int ines_accel_read(struct gpib_board *board, u8 *buffer, 139 - size_t length, int *end, size_t *bytes_read) 136 + static int ines_accel_read(struct gpib_board *board, u8 *buffer, 137 + size_t length, int *end, size_t *bytes_read) 140 138 { 141 139 ssize_t retval = 0; 142 140 struct ines_priv *ines_priv = board->private_data; ··· 215 213 return 0; 216 214 } 217 215 218 - int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, 219 - int send_eoi, size_t *bytes_written) 216 + static int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, 217 + int send_eoi, size_t *bytes_written) 220 218 { 221 219 size_t count = 0; 222 220 ssize_t retval = 0; ··· 266 264 return retval; 267 265 } 268 266 269 - irqreturn_t ines_pci_interrupt(int irq, void *arg) 267 + static irqreturn_t ines_pci_interrupt(int irq, void *arg) 270 268 { 271 269 struct gpib_board *board = arg; 272 270 struct ines_priv *priv = board->private_data; ··· 283 281 return ines_interrupt(board); 284 282 } 285 283 286 - irqreturn_t ines_interrupt(struct gpib_board *board) 284 + static irqreturn_t ines_interrupt(struct gpib_board *board) 287 285 { 288 286 struct ines_priv *priv = board->private_data; 289 287 struct nec7210_priv *nec_priv = &priv->nec7210_priv; ··· 395 393 static const int num_pci_chips = ARRAY_SIZE(pci_ids); 396 394 397 395 // wrappers for interface functions 398 - int ines_read(struct gpib_board *board, u8 *buffer, size_t length, 399 - int *end, size_t *bytes_read) 396 + static int ines_read(struct gpib_board *board, u8 *buffer, size_t length, 397 + int *end, size_t *bytes_read) 400 398 { 401 399 struct ines_priv *priv = board->private_data; 402 400 struct nec7210_priv *nec_priv = &priv->nec7210_priv; ··· 414 412 return retval; 415 413 } 416 414 417 - int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, 418 - size_t *bytes_written) 415 + static int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, 416 + size_t *bytes_written) 419 417 { 420 418 struct ines_priv *priv = board->private_data; 421 419 422 420 return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); 423 421 } 424 422 425 - int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) 423 + static int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) 426 424 { 427 425 struct ines_priv *priv = board->private_data; 428 426 429 427 return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_written); 430 428 } 431 429 432 - int ines_take_control(struct gpib_board *board, int synchronous) 430 + static int ines_take_control(struct gpib_board *board, int synchronous) 433 431 { 434 432 struct ines_priv *priv = board->private_data; 435 433 436 434 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); 437 435 } 438 436 439 - int ines_go_to_standby(struct gpib_board *board) 437 + static int ines_go_to_standby(struct gpib_board *board) 440 438 { 441 439 struct ines_priv *priv = board->private_data; 442 440 443 441 return nec7210_go_to_standby(board, &priv->nec7210_priv); 444 442 } 445 443 446 - int ines_request_system_control(struct gpib_board *board, int request_control) 444 + static int ines_request_system_control(struct gpib_board *board, int request_control) 447 445 { 448 446 struct ines_priv *priv = board->private_data; 449 447 450 448 return nec7210_request_system_control(board, &priv->nec7210_priv, request_control); 451 449 } 452 450 453 - void ines_interface_clear(struct gpib_board *board, int assert) 451 + static void ines_interface_clear(struct gpib_board *board, int assert) 454 452 { 455 453 struct ines_priv *priv = board->private_data; 456 454 457 455 nec7210_interface_clear(board, &priv->nec7210_priv, assert); 458 456 } 459 457 460 - void ines_remote_enable(struct gpib_board *board, int enable) 458 + static void ines_remote_enable(struct gpib_board *board, int enable) 461 459 { 462 460 struct ines_priv *priv = board->private_data; 463 461 464 462 nec7210_remote_enable(board, &priv->nec7210_priv, enable); 465 463 } 466 464 467 - int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) 465 + static int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) 468 466 { 469 467 struct ines_priv *priv = board->private_data; 470 468 471 469 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8_bits); 472 470 } 473 471 474 - void ines_disable_eos(struct gpib_board *board) 472 + static void ines_disable_eos(struct gpib_board *board) 475 473 { 476 474 struct ines_priv *priv = board->private_data; 477 475 478 476 nec7210_disable_eos(board, &priv->nec7210_priv); 479 477 } 480 478 481 - unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask) 479 + static unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask) 482 480 { 483 481 struct ines_priv *priv = board->private_data; 484 482 485 483 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); 486 484 } 487 485 488 - int ines_primary_address(struct gpib_board *board, unsigned int address) 486 + static int ines_primary_address(struct gpib_board *board, unsigned int address) 489 487 { 490 488 struct ines_priv *priv = board->private_data; 491 489 492 490 return nec7210_primary_address(board, &priv->nec7210_priv, address); 493 491 } 494 492 495 - int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable) 493 + static int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable) 496 494 { 497 495 struct ines_priv *priv = board->private_data; 498 496 499 497 return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); 500 498 } 501 499 502 - int ines_parallel_poll(struct gpib_board *board, u8 *result) 500 + static int ines_parallel_poll(struct gpib_board *board, u8 *result) 503 501 { 504 502 struct ines_priv *priv = board->private_data; 505 503 506 504 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); 507 505 } 508 506 509 - void ines_parallel_poll_configure(struct gpib_board *board, u8 config) 507 + static void ines_parallel_poll_configure(struct gpib_board *board, u8 config) 510 508 { 511 509 struct ines_priv *priv = board->private_data; 512 510 513 511 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config); 514 512 } 515 513 516 - void ines_parallel_poll_response(struct gpib_board *board, int ist) 514 + static void ines_parallel_poll_response(struct gpib_board *board, int ist) 517 515 { 518 516 struct ines_priv *priv = board->private_data; 519 517 520 518 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); 521 519 } 522 520 523 - void ines_serial_poll_response(struct gpib_board *board, u8 status) 521 + static void ines_serial_poll_response(struct gpib_board *board, u8 status) 524 522 { 525 523 struct ines_priv *priv = board->private_data; 526 524 527 525 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); 528 526 } 529 527 530 - u8 ines_serial_poll_status(struct gpib_board *board) 528 + static u8 ines_serial_poll_status(struct gpib_board *board) 531 529 { 532 530 struct ines_priv *priv = board->private_data; 533 531 534 532 return nec7210_serial_poll_status(board, &priv->nec7210_priv); 535 533 } 536 534 537 - void ines_return_to_local(struct gpib_board *board) 535 + static void ines_return_to_local(struct gpib_board *board) 538 536 { 539 537 struct ines_priv *priv = board->private_data; 540 538 ··· 666 664 return 0; 667 665 } 668 666 669 - void ines_free_private(struct gpib_board *board) 667 + static void ines_free_private(struct gpib_board *board) 670 668 { 671 669 kfree(board->private_data); 672 670 board->private_data = NULL; 673 671 } 674 672 675 - int ines_generic_attach(struct gpib_board *board) 673 + static int ines_generic_attach(struct gpib_board *board) 676 674 { 677 675 struct ines_priv *ines_priv; 678 676 struct nec7210_priv *nec_priv; ··· 692 690 return 0; 693 691 } 694 692 695 - void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, int use_accel) 693 + static void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, int use_accel) 696 694 { 697 695 struct nec7210_priv *nec_priv = &ines_priv->nec7210_priv; 698 696 ··· 854 852 return 0; 855 853 } 856 854 857 - int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) 855 + static int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) 858 856 { 859 857 struct ines_priv *ines_priv; 860 858 int retval; ··· 869 867 return 0; 870 868 } 871 869 872 - int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) 870 + static int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) 873 871 { 874 872 struct ines_priv *ines_priv; 875 873 int retval; ··· 886 884 887 885 static const int ines_isa_iosize = 0x20; 888 886 889 - int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) 887 + static int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) 890 888 { 891 889 struct ines_priv *ines_priv; 892 890 struct nec7210_priv *nec_priv; ··· 917 915 return 0; 918 916 } 919 917 920 - void ines_pci_detach(struct gpib_board *board) 918 + static void ines_pci_detach(struct gpib_board *board) 921 919 { 922 920 struct ines_priv *ines_priv = board->private_data; 923 921 struct nec7210_priv *nec_priv; ··· 951 949 ines_free_private(board); 952 950 } 953 951 954 - void ines_isa_detach(struct gpib_board *board) 952 + static void ines_isa_detach(struct gpib_board *board) 955 953 { 956 954 struct ines_priv *ines_priv = board->private_data; 957 955 struct nec7210_priv *nec_priv; ··· 1007 1005 static int ines_pcmcia_accel_attach(struct gpib_board *board, 1008 1006 const struct gpib_board_config *config); 1009 1007 static void ines_pcmcia_detach(struct gpib_board *board); 1010 - static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg); 1011 1008 static int ines_common_pcmcia_attach(struct gpib_board *board); 1012 1009 /* 1013 1010 * A linked list of "instances" of the gpib device. Each actual ··· 1214 1213 .resume = ines_gpib_resume, 1215 1214 }; 1216 1215 1217 - void ines_pcmcia_cleanup_module(void) 1216 + static void ines_pcmcia_cleanup_module(void) 1218 1217 { 1219 1218 pcmcia_unregister_driver(&ines_gpib_cs_driver); 1220 1219 } ··· 1303 1302 .return_to_local = ines_return_to_local, 1304 1303 }; 1305 1304 1306 - irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) 1305 + static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) 1307 1306 { 1308 1307 struct gpib_board *board = arg; 1309 1308 1310 1309 return ines_interrupt(board); 1311 1310 } 1312 1311 1313 - int ines_common_pcmcia_attach(struct gpib_board *board) 1312 + static int ines_common_pcmcia_attach(struct gpib_board *board) 1314 1313 { 1315 1314 struct ines_priv *ines_priv; 1316 1315 struct nec7210_priv *nec_priv; ··· 1349 1348 return 0; 1350 1349 } 1351 1350 1352 - int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) 1351 + static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) 1353 1352 { 1354 1353 struct ines_priv *ines_priv; 1355 1354 int retval; ··· 1364 1363 return 0; 1365 1364 } 1366 1365 1367 - int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) 1366 + static int ines_pcmcia_accel_attach(struct gpib_board *board, 1367 + const struct gpib_board_config *config) 1368 1368 { 1369 1369 struct ines_priv *ines_priv; 1370 1370 int retval; ··· 1380 1378 return 0; 1381 1379 } 1382 1380 1383 - void ines_pcmcia_detach(struct gpib_board *board) 1381 + static void ines_pcmcia_detach(struct gpib_board *board) 1384 1382 { 1385 1383 struct ines_priv *ines_priv = board->private_data; 1386 1384 struct nec7210_priv *nec_priv;