14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 May, 2020

1 commit

  • Fix to return negative error code -ENOMEM from the ioremap() error handling
    case instead of 0, as done elsewhere in this function.

    Fixes: 43986798fd50 ("ipack: add error handling for ioremap_nocache")
    Reported-by: Hulk Robot
    Signed-off-by: Wei Yongjun
    Cc: stable
    Acked-by: Samuel Iglesias Gonsalvez
    Link: https://lore.kernel.org/r/20200507094237.13599-1-weiyongjun1@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     

06 Jan, 2020

1 commit


12 Jul, 2019

1 commit

  • Pull tty / serial driver updates from Greg KH:
    "Here is the "large" TTY and Serial driver update for 5.3-rc1.

    It's in the negative number of lines overall as we removed an obsolete
    serial driver that was causing problems for some people who were
    trying to clean up some apis (the mpsc.c driver, which only worked for
    some pre-production hardware that no one has anymore.)

    Other than that, lots of tiny changes, cleaning up small things along
    with some platform-specific serial driver updates.

    All of these have been in linux-next for a while now with no reported
    issues"

    * tag 'tty-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (68 commits)
    tty: serial: fsl_lpuart: add imx8qxp support
    serial: imx: set_termios(): preserve RTS state
    serial: imx: set_termios(): clarify RTS/CTS bits calculation
    serial: imx: set_termios(): factor-out 'ucr2' initial value
    serial: sh-sci: Terminate TX DMA during buffer flushing
    serial: sh-sci: Fix TX DMA buffer flushing and workqueue races
    serial: mpsc: Remove obsolete MPSC driver
    serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_port()
    serial: stm32: add RX and TX FIFO flush
    serial: stm32: add support of RX FIFO threshold
    serial: stm32: add support of TX FIFO threshold
    serial: stm32: update PIO transmission
    serial: stm32: add support of timeout interrupt for RX
    Revert "serial: 8250: Don't service RX FIFO if interrupts are disabled"
    tty/serial/8250: use mctrl_gpio helpers
    serial: mctrl_gpio: Check if GPIO property exisits before requesting it
    serial: 8250: pericom_do_set_divisor can be static
    tty: serial_core: Set port active bit in uart_port_activate
    serial: 8250: Add MSR/MCR TIOCM conversion wrapper functions
    serial: 8250: factor out serial8250_{set,clear}_THRI() helpers
    ...

    Linus Torvalds
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2 of the license

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 315 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Armijn Hemel
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Jun, 2019

1 commit


24 May, 2019

1 commit


21 May, 2019

1 commit


07 Jul, 2018

1 commit


13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

18 May, 2017

2 commits


28 Oct, 2016

1 commit

  • It makes the result hard to interpret correctly if a base 10 number is
    prefixed by 0x. So change to a hex number.

    Link: http://lkml.kernel.org/r/20161026125658.25728-4-u.kleine-koenig@pengutronix.de
    Signed-off-by: Uwe Kleine-König
    Cc: Samuel Iglesias Gonsalvez
    Cc: Jens Taprogge
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     

01 May, 2016

1 commit

  • Replace ASYNC_INITIALIZED bit in the tty_port::flags field with
    TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers
    tty_port_set_initialized() and tty_port_initialized() to abstract
    atomic bit ops.

    Note: the transforms for test_and_set_bit() and test_and_clear_bit()
    are unnecessary as the state transitions are already mutually exclusive;
    the tty lock prevents concurrent open/close/hangup.

    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

24 Sep, 2014

5 commits


19 Jul, 2014

1 commit


10 Jul, 2014

2 commits

  • The request for an IRQ handler must be done after whole configuration. This
    was not the case for this driver which request the IRQ in the middle of
    the configuration. Sometimes, it happens that something is not completely
    configured, we recieve an interrupt thus we stumble into troubles in the
    IRQ handler.

    Signed-off-by: Federico Vaga
    Acked-by: Samuel Iglesias Gonsalvez
    Signed-off-by: Greg Kroah-Hartman

    Federico Vaga
     
  • In some conditions (echo or particular sequence of special
    characters), on buffer push, the tty layer calls the write operation
    while we are holding the spinlock. This means deadlock within the same
    process on kernels version < 3.12. It seems not a problem on recent
    kernel, but the patch still valid as locking optimization.

    The protected variables by the spinlock are: xmit_buf, nb_bytes,
    pointer_read and pointer_write. So, this patch reduces the locked area
    in the IRQ handler only to these variables. Most of the code inside the
    locked area in the IRQ handler is not protected elsewhere; it means
    that it is not protected at all.

    Signed-off-by: Federico Vaga
    Acked-by: Samuel Iglesias Gonsalvez
    Signed-off-by: Greg Kroah-Hartman

    Federico Vaga
     

17 Oct, 2013

1 commit


16 Mar, 2013

2 commits


22 Feb, 2013

1 commit

  • Pull char/misc driver patches from Greg Kroah-Hartman:
    "Here's the big char/misc driver patches for 3.9-rc1.

    Nothing major here, just lots of different driver updates (mei,
    hyperv, ipack, extcon, vmci, etc.).

    All of these have been in the linux-next tree for a while."

    * tag 'char-misc-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (209 commits)
    w1: w1_therm: Add force-pullup option for "broken" sensors
    w1: ds2482: Added 1-Wire pull-up support to the driver
    vme: add missing put_device() after device_register() fails
    extcon: max8997: Use workqueue to check cable state after completing boot of platform
    extcon: max8997: Set default UART/USB path on probe
    extcon: max8997: Consolidate duplicate code for checking ADC/CHG cable type
    extcon: max8997: Set default of ADC debounce time during initialization
    extcon: max8997: Remove duplicate code related to set H/W line path
    extcon: max8997: Move defined constant to header file
    extcon: max77693: Make max77693_extcon_cable static
    extcon: max8997: Remove unreachable code
    extcon: max8997: Make max8997_extcon_cable static
    extcon: max77693: Remove unnecessary goto statement to improve readability
    extcon: max77693: Convert to devm_input_allocate_device()
    extcon: gpio: Rename filename of extcon-gpio.c according to kernel naming style
    CREDITS: update email and address of Harald Hoyer
    extcon: arizona: Use MICDET for final microphone identification
    extcon: arizona: Always take the first HPDET reading as the final one
    extcon: arizona: Clear _trig_sts bits after jack detection
    extcon: arizona: Don't HPDET magic when headphones are enabled
    ...

    Linus Torvalds
     

22 Jan, 2013

1 commit

  • Delete successive tests to the same location. The code tested the result
    of a previous allocation, that itself was already tested. It is changed to
    test the result of the most recent allocation.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @s exists@
    local idexpression y;
    expression x,e;
    @@

    *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
    { ... when forall
    return ...; }
    ... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
    when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
    *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
    { ... when forall
    return ...; }
    //

    Signed-off-by: Julia Lawall
    Cc: Samuel Iglesias Gonsalvez
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

19 Jan, 2013

2 commits

  • The option allows you to remove TTY and compile without errors. This
    saves space on systems that won't support TTY interfaces anyway.
    bloat-o-meter output is below.

    The bulk of this patch consists of Kconfig changes adding "depends on
    TTY" to various serial devices and similar drivers that require the TTY
    layer. Ideally, these dependencies would occur on a common intermediate
    symbol such as SERIO, but most drivers "select SERIO" rather than
    "depends on SERIO", and "select" does not respect dependencies.

    bloat-o-meter output comparing our previous minimal to new minimal by
    removing TTY. The list is filtered to not show removed entries with awk
    '$3 != "-"' as the list was very long.

    add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350)
    function old new delta
    chr_dev_init 166 170 +4
    allow_signal 80 82 +2
    static.__warned 143 142 -1
    disallow_signal 63 62 -1
    __set_special_pids 95 94 -1
    unregister_console 126 121 -5
    start_kernel 546 541 -5
    register_console 593 588 -5
    copy_from_user 45 40 -5
    sys_setsid 128 120 -8
    sys_vhangup 32 19 -13
    do_exit 1543 1526 -17
    bitmap_zero 60 40 -20
    arch_local_irq_save 137 117 -20
    release_task 674 652 -22
    static.spin_unlock_irqrestore 308 260 -48

    Signed-off-by: Joe Millenbach
    Reviewed-by: Jamey Sharp
    Reviewed-by: Josh Triplett
    Signed-off-by: Greg Kroah-Hartman

    Joe Millenbach
     
  • There was a bug in the code when managing a GE IP-OCTAL-485 board. The RX would
    be enabled but we have a wrong state in the rx_enable flag.

    Then, if the user changes the terminal settings, RX would not be enabled again.

    Signed-off-by: Samuel Iglesias Gonsalvez
    Signed-off-by: Greg Kroah-Hartman

    Samuel Iglesias Gonsalvez
     

16 Jan, 2013

11 commits