0001-tty-module.c-mark-internal-functions-as-static.patch 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. From aed3ba0acb2c355be562cfbdb3a375682412c144 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Tue, 31 Dec 2024 10:28:41 +0100
  4. Subject: [PATCH] tty/module.c: mark internal functions as static
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Fixes:
  9. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:128:12: warning: no previous prototype for ‘ec_tty_init_module’ [-Wmissing-prototypes]
  10. 128 | int __init ec_tty_init_module(void)
  11. | ^~~~~~~~~~~~~~~~~~
  12. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:189:13: warning: no previous prototype for ‘ec_tty_cleanup_module’ [-Wmissing-prototypes]
  13. 189 | void __exit ec_tty_cleanup_module(void)
  14. | ^~~~~~~~~~~~~~~~~~~~~
  15. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:216:5: warning: no previous prototype for ‘ec_tty_init’ [-Wmissing-prototypes]
  16. 216 | int ec_tty_init(ec_tty_t *t, int minor,
  17. | ^~~~~~~~~~~
  18. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:293:6: warning: no previous prototype for ‘ec_tty_clear’ [-Wmissing-prototypes]
  19. 293 | void ec_tty_clear(ec_tty_t *tty)
  20. | ^~~~~~~~~~~~
  21. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:301:14: warning: no previous prototype for ‘ec_tty_tx_size’ [-Wmissing-prototypes]
  22. 301 | unsigned int ec_tty_tx_size(ec_tty_t *tty)
  23. | ^~~~~~~~~~~~~~
  24. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:316:14: warning: no previous prototype for ‘ec_tty_tx_space’ [-Wmissing-prototypes]
  25. 316 | unsigned int ec_tty_tx_space(ec_tty_t *tty)
  26. | ^~~~~~~~~~~~~~~
  27. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:323:14: warning: no previous prototype for ‘ec_tty_rx_size’ [-Wmissing-prototypes]
  28. 323 | unsigned int ec_tty_rx_size(ec_tty_t *tty)
  29. | ^~~~~~~~~~~~~~
  30. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:338:14: warning: no previous prototype for ‘ec_tty_rx_space’ [-Wmissing-prototypes]
  31. 338 | unsigned int ec_tty_rx_space(ec_tty_t *tty)
  32. | ^~~~~~~~~~~~~~~
  33. /home/autobuild/autobuild/instance-7/output-1/build/igh-ethercat-1.6.2/./tty/module.c:345:5: warning: no previous prototype for ‘ec_tty_get_serial_info’ [-Wmissing-prototypes]
  34. 345 | int ec_tty_get_serial_info(ec_tty_t *tty, struct serial_struct *data)
  35. | ^~~~~~~~~~~~~~~~~~~~~~
  36. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  37. Upstream: https://gitlab.com/etherlab.org/ethercat/-/merge_requests/150
  38. ---
  39. tty/module.c | 26 +++++++++++++-------------
  40. 1 file changed, 13 insertions(+), 13 deletions(-)
  41. diff --git a/tty/module.c b/tty/module.c
  42. index 05486940..af4c1b70 100644
  43. --- a/tty/module.c
  44. +++ b/tty/module.c
  45. @@ -64,9 +64,9 @@ ec_tty_t *ttys[EC_TTY_MAX_DEVICES];
  46. struct semaphore tty_sem;
  47. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  48. -void ec_tty_wakeup(struct timer_list *);
  49. +static void ec_tty_wakeup(struct timer_list *);
  50. #else
  51. -void ec_tty_wakeup(unsigned long);
  52. +static void ec_tty_wakeup(unsigned long);
  53. #endif
  54. /****************************************************************************/
  55. @@ -125,7 +125,7 @@ static const struct tty_operations ec_tty_ops; // see below
  56. *
  57. * \return 0 on success, else < 0
  58. */
  59. -int __init ec_tty_init_module(void)
  60. +static int __init ec_tty_init_module(void)
  61. {
  62. int i, ret = 0;
  63. unsigned flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
  64. @@ -186,7 +186,7 @@ out_return:
  65. *
  66. * Clears all master instances.
  67. */
  68. -void __exit ec_tty_cleanup_module(void)
  69. +static void __exit ec_tty_cleanup_module(void)
  70. {
  71. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
  72. int i;
  73. @@ -213,7 +213,7 @@ void __exit ec_tty_cleanup_module(void)
  74. * ec_tty_t methods.
  75. ****************************************************************************/
  76. -int ec_tty_init(ec_tty_t *t, int minor,
  77. +static int ec_tty_init(ec_tty_t *t, int minor,
  78. const ec_tty_operations_t *ops, void *cb_data)
  79. {
  80. int ret;
  81. @@ -290,7 +290,7 @@ int ec_tty_init(ec_tty_t *t, int minor,
  82. /****************************************************************************/
  83. -void ec_tty_clear(ec_tty_t *tty)
  84. +static void ec_tty_clear(ec_tty_t *tty)
  85. {
  86. del_timer_sync(&tty->timer);
  87. tty_unregister_device(tty_driver, tty->minor);
  88. @@ -298,7 +298,7 @@ void ec_tty_clear(ec_tty_t *tty)
  89. /****************************************************************************/
  90. -unsigned int ec_tty_tx_size(ec_tty_t *tty)
  91. +static unsigned int ec_tty_tx_size(ec_tty_t *tty)
  92. {
  93. unsigned int ret;
  94. @@ -313,14 +313,14 @@ unsigned int ec_tty_tx_size(ec_tty_t *tty)
  95. /****************************************************************************/
  96. -unsigned int ec_tty_tx_space(ec_tty_t *tty)
  97. +static unsigned int ec_tty_tx_space(ec_tty_t *tty)
  98. {
  99. return EC_TTY_TX_BUFFER_SIZE - 1 - ec_tty_tx_size(tty);
  100. }
  101. /****************************************************************************/
  102. -unsigned int ec_tty_rx_size(ec_tty_t *tty)
  103. +static unsigned int ec_tty_rx_size(ec_tty_t *tty)
  104. {
  105. unsigned int ret;
  106. @@ -335,14 +335,14 @@ unsigned int ec_tty_rx_size(ec_tty_t *tty)
  107. /****************************************************************************/
  108. -unsigned int ec_tty_rx_space(ec_tty_t *tty)
  109. +static unsigned int ec_tty_rx_space(ec_tty_t *tty)
  110. {
  111. return EC_TTY_RX_BUFFER_SIZE - 1 - ec_tty_rx_size(tty);
  112. }
  113. /****************************************************************************/
  114. -int ec_tty_get_serial_info(ec_tty_t *tty, struct serial_struct *data)
  115. +static int ec_tty_get_serial_info(ec_tty_t *tty, struct serial_struct *data)
  116. {
  117. struct serial_struct tmp;
  118. @@ -362,9 +362,9 @@ int ec_tty_get_serial_info(ec_tty_t *tty, struct serial_struct *data)
  119. /** Timer function.
  120. */
  121. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  122. -void ec_tty_wakeup(struct timer_list *t)
  123. +static void ec_tty_wakeup(struct timer_list *t)
  124. #else
  125. -void ec_tty_wakeup(unsigned long data)
  126. +static void ec_tty_wakeup(unsigned long data)
  127. #endif
  128. {
  129. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  130. --
  131. 2.47.1