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

tty: tty_ldisc: Fix some kernel-doc related misdemeanours

- Functions must follow directly on from their headers
- Demote non-conforming kernel-doc header
- Ensure notes have unique section names
- Provide missing description for 'reinit'

Fixes the following W=1 kernel build warning(s):

drivers/tty/tty_ldisc.c:158: warning: cannot understand function prototype: 'int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); '
drivers/tty/tty_ldisc.c:199: warning: Function parameter or member 'ld' not described in 'tty_ldisc_put'
drivers/tty/tty_ldisc.c:260: warning: duplicate section name 'Note'
drivers/tty/tty_ldisc.c:717: warning: Function parameter or member 'reinit' not described in 'tty_ldisc_hangup'

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20201112105857.2078977-2-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lee Jones and committed by
Greg Kroah-Hartman
8eddcca2 bc0468ee

+5 -5
+5 -5
drivers/tty/tty_ldisc.c
··· 135 135 raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags); 136 136 } 137 137 138 + static int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); 138 139 /** 139 140 * tty_ldisc_get - take a reference to an ldisc 140 141 * @tty: tty device ··· 156 155 * Locking: 157 156 * takes tty_ldiscs_lock to guard against ldisc races 158 157 */ 159 - 160 - static int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD); 161 158 162 159 static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc) 163 160 { ··· 190 191 return ld; 191 192 } 192 193 193 - /** 194 + /* 194 195 * tty_ldisc_put - release the ldisc 195 196 * 196 197 * Complement of tty_ldisc_get(). ··· 250 251 * Returns: NULL if the tty has been hungup and not re-opened with 251 252 * a new file descriptor, otherwise valid ldisc reference 252 253 * 253 - * Note: Must not be called from an IRQ/timer context. The caller 254 + * Note 1: Must not be called from an IRQ/timer context. The caller 254 255 * must also be careful not to hold other locks that will deadlock 255 256 * against a discipline change, such as an existing ldisc reference 256 257 * (which we check for) 257 258 * 258 - * Note: a file_operations routine (read/poll/write) should use this 259 + * Note 2: a file_operations routine (read/poll/write) should use this 259 260 * function to wait for any ldisc lifetime events to finish. 260 261 */ 261 262 ··· 701 702 /** 702 703 * tty_ldisc_hangup - hangup ldisc reset 703 704 * @tty: tty being hung up 705 + * @reinit: whether to re-initialise the tty 704 706 * 705 707 * Some tty devices reset their termios when they receive a hangup 706 708 * event. In that situation we must also switch back to N_TTY properly