1. 14 5月, 2021 3 次提交
  2. 13 5月, 2021 9 次提交
    • J
      tty: make tty_operations::write_room return uint · 03b3b1a2
      Jiri Slaby 提交于
      Line disciplines expect a positive value or zero returned from
      tty->ops->write_room (invoked by tty_write_room). So make this
      assumption explicit by using unsigned int as a return value. Both of
      tty->ops->write_room and tty_write_room.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Acked-by: NLaurentiu Tudor <laurentiu.tudor@nxp.com>
      Acked-by: NAlex Elder <elder@linaro.org>
      Acked-by: Max Filippov <jcmvbkbc@gmail.com> # xtensa
      Acked-by: NDavid Sterba <dsterba@suse.com>
      Acked-By: NAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
      Cc: Jens Taprogge <jens.taprogge@taprogge.org>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Scott Branden <scott.branden@broadcom.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David Lin <dtwlin@gmail.com>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Oliver Neukum <oneukum@suse.com>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Mathias Nyman <mathias.nyman@intel.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-23-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      03b3b1a2
    • J
      tty: return void from tty_unregister_ldisc · f6f19595
      Jiri Slaby 提交于
      Now that noone checks the return value of tty_unregister_ldisc, make the
      function return 'void'.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Link: https://lore.kernel.org/r/20210505091928.22010-20-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f6f19595
    • J
      tty: drop tty_ldisc_ops::refcount · 19475209
      Jiri Slaby 提交于
      The refcount is checked only in tty_unregister_ldisc and EBUSY returned
      if it is nonzero. But none of the tty_unregister_ldisc callers act
      anyhow if this (or any other) error is returned. So remove
      tty_ldisc_ops::refcount completely and make tty_unregister_ldisc return
      'void' in the next patches. That means we assume tty_unregister_ldisc is
      not called while the ldisc might be in use. That relies on
      try_module_get in get_ldops and module_put in put_ldops.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Link: https://lore.kernel.org/r/20210505091928.22010-18-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19475209
    • J
      tty: make tty_ldisc_ops a param in tty_unregister_ldisc · f81ee8b8
      Jiri Slaby 提交于
      Make tty_unregister_ldisc symmetric to tty_register_ldisc by accepting
      struct tty_ldisc_ops as a parameter instead of ldisc number. This avoids
      checking of the ldisc number bounds in tty_unregister_ldisc.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@reisers.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Rodolfo Giometti <giometti@enneenne.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-17-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f81ee8b8
    • J
      tty: set tty_ldisc_ops::num statically · fbadf70a
      Jiri Slaby 提交于
      There is no reason to pass the ldisc number to tty_register_ldisc
      separately. Just set it in the already defined tty_ldisc_ops in all the
      ldiscs.
      
      This simplifies tty_register_ldisc a bit too (no need to set the num
      member there).
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@reisers.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Rodolfo Giometti <giometti@enneenne.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-15-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fbadf70a
    • J
      tty: cumulate and document tty_struct::ctrl* members · 64d608db
      Jiri Slaby 提交于
      Group the ctrl members under a single struct called ctrl. The new struct
      contains 'pgrp', 'session', 'pktstatus', and 'packet'. 'pktstatus' and
      'packet' used to be bits in a bitfield. The struct also contains the
      lock protecting them to share the same cache line.
      
      Note that commit c545b66c (tty: Serialize tcflow() with other tty
      flow control changes) added a padding to the original bitfield. It was
      for the bitfield to occupy a whole 64b word to avoid interferring stores
      on Alpha (cannot we evaporate this arch with weird implications to C
      code yet?). But it doesn't work as expected as the padding
      (tty_struct::ctrl_unused) is aligned to a 8B boundary too and occupies
      some bytes from the next word.
      
      So make it reliable by:
      1) setting __aligned of the struct -- that aligns the start, and
      2) making 'unsigned long unused[0]' as the last member of the struct --
         pads the end.
      
      Add a kerneldoc comment for this grouped members.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: netdev@vger.kernel.org
      Link: https://lore.kernel.org/r/20210505091928.22010-14-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64d608db
    • J
      tty: cumulate and document tty_struct::flow* members · 6e94dbc7
      Jiri Slaby 提交于
      Group the flow flags under a single struct called flow. The new struct
      contains 'stopped' and 'tco_stopped' bools which used to be bits in a
      bitfield. The struct also contains the lock protecting them to
      potentially share the same cache line.
      
      Note that commit c545b66c (tty: Serialize tcflow() with other tty
      flow control changes) added a padding to the original bitfield. It was
      for the bitfield to occupy a whole 64b word to avoid interferring stores
      on Alpha (cannot we evaporate this arch with weird implications to C
      code yet?). But it doesn't work as expected as the padding
      (tty_struct::unused) is aligned to a 8B boundary too and occupies some
      bytes from the next word.
      
      So make it reliable by:
      1) setting __aligned of the struct -- that aligns the start, and
      2) making 'unsigned long unused[0]' as the last member of the struct --
         pads the end.
      
      This is also the perfect time to start the documentation of tty_struct
      where all this lives. So we start by documenting what these bools
      actually serve for. And why we do all the alignment dances. Only the few
      up-to-date information from the Theodore's comment made it into this new
      Kerneldoc comment.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>
      Link: https://lore.kernel.org/r/20210505091928.22010-13-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e94dbc7
    • J
      tty: make fp of tty_ldisc_ops::receive_buf{,2} const · 0f3dcf3b
      Jiri Slaby 提交于
      Char pointer (cp) passed to tty_ldisc_ops::receive_buf{,2} is const.
      There is no reason for flag pointer (fp) not to be too. So switch it in
      the definition and all uses.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@reisers.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-12-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0f3dcf3b
    • J
      tty: remove broken r3964 line discipline · ed5aecd3
      Jiri Slaby 提交于
      Noone stepped up in the past two years since it was marked as BROKEN by
      commit c7084edc (tty: mark Siemens R3964 line discipline as BROKEN).
      Remove the line discipline for good.
      
      Three remarks:
      * we remove also the uapi header (as noone is able to use that interface
        anyway)
      * we do *not* remove the N_R3964 constant definition from tty.h, so it
        remains reserved.
      * in_interrupt() check is now removed from vt's con_put_char. Noone else
        calls tty_operations::put_char from interrupt context.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Link: https://lore.kernel.org/r/20210505091928.22010-2-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ed5aecd3
  3. 09 5月, 2021 1 次提交
  4. 08 5月, 2021 1 次提交
    • M
      linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h> · 0ab1438b
      Masahiro Yamada 提交于
      <linux/kconfig.h> is included from all the kernel-space source files,
      including C, assembly, linker scripts. It is intended to contain a
      minimal set of macros to evaluate CONFIG options.
      
      IF_ENABLED() is an intruder here because (x ? y : z) is C code, which
      should not be included from assembly files or linker scripts.
      
      Also, <linux/kconfig.h> is no longer self-contained because NULL is
      defined in <linux/stddef.h>.
      
      Move IF_ENABLED() out to <linux/kernel.h> as PTR_IF(). PTF_IF()
      takes the general boolean expression instead of a CONFIG option
      so that it fits better in <linux/kernel.h>.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      0ab1438b
  5. 07 5月, 2021 19 次提交
  6. 06 5月, 2021 7 次提交