26 Aug, 2020

1 commit

  • kernel/cpu.c: don't use snprintf() for sysfs attrs

    As per the documentation (Documentation/filesystems/sysfs.rst),
    snprintf() should not be used for formatting values returned by sysfs.

    In all of these cases, sprintf() suffices as we know that the formatted
    strings will be less than PAGE_SIZE in length.

    Issue identified by Coccinelle.

    Signed-off-by: Alex Dewar
    Link: https://lore.kernel.org/r/20200824222322.22962-1-alex.dewar90@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Alex Dewar
     

18 Aug, 2020

1 commit

  • In preparation for unconditionally passing the
    struct tasklet_struct pointer to all tasklet
    callbacks, switch to using the new tasklet_setup()
    and from_tasklet() to pass the tasklet pointer explicitly.

    Signed-off-by: Romain Perier
    Signed-off-by: Allen Pais
    Link: https://lore.kernel.org/r/20200817090209.26351-2-allen.cryptic@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Allen Pais
     

10 Jul, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200707195607.GA4198@embeddedor
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

09 Jul, 2020

1 commit

  • No attempt has been made to document any of the functions here.

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

    drivers/usb/atm/ueagle-atm.c:578: warning: Function parameter or member 'usb' not described in 'uea_send_modem_cmd'
    drivers/usb/atm/ueagle-atm.c:578: warning: Function parameter or member 'addr' not described in 'uea_send_modem_cmd'
    drivers/usb/atm/ueagle-atm.c:578: warning: Function parameter or member 'size' not described in 'uea_send_modem_cmd'
    drivers/usb/atm/ueagle-atm.c:578: warning: Function parameter or member 'buff' not described in 'uea_send_modem_cmd'
    drivers/usb/atm/ueagle-atm.c:679: warning: Function parameter or member 'usb' not described in 'uea_load_firmware'
    drivers/usb/atm/ueagle-atm.c:679: warning: Function parameter or member 'ver' not described in 'uea_load_firmware'

    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Cc: Damien Bergamini
    Signed-off-by: Lee Jones
    Link: https://lore.kernel.org/r/20200703174148.2749969-6-lee.jones@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Lee Jones
     

18 Mar, 2020

1 commit

  • This patch corrects the SPDX License Identifier style in
    header file related to USB DSL modem support drivers.
    For C header files Documentation/process/license-rules.rst
    mandates C-like comments (opposed to C source files where
    C++ style should be used).

    Changes made by using a script provided by Joe Perches here:
    https://lkml.org/lkml/2019/2/7/46.

    Suggested-by: Joe Perches
    Signed-off-by: Nishad Kamdar
    Link: https://lore.kernel.org/r/20200315102844.GA3460@nishad
    Signed-off-by: Greg Kroah-Hartman

    Nishad Kamdar
     

24 Feb, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200220132017.GA29262@embeddedor
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

13 Feb, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200211232148.GA20644@embeddedor
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

15 Dec, 2019

1 commit

  • Pull USB fixes from Greg KH:
    "Here are some small USB driver fixes for reported issues for 5.5-rc2

    There's the usual gadget and xhci fixes, as well as some other
    problems that syzbot has been finding during it's fuzzing runs. Full
    details are in the shortlog.

    All of these have been in linux-next with no reported issues"

    * tag 'usb-5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (21 commits)
    usb: dwc3: pci: add ID for the Intel Comet Lake -H variant
    xhci: make sure interrupts are restored to correct state
    xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour.
    xhci: Increase STS_HALT timeout in xhci_suspend()
    usb: xhci: only set D3hot for pci device
    xhci: fix USB3 device initiated resume race with roothub autosuspend
    xhci: Fix memory leak in xhci_add_in_port()
    USB: Fix incorrect DMA allocations for local memory pool drivers
    usb: gadget: fix wrong endpoint desc
    usb: dwc3: ep0: Clear started flag on completion
    usb: dwc3: gadget: Clear started flag for non-IOC
    usb: dwc3: gadget: Fix logical condition
    USB: atm: ueagle-atm: add missing endpoint check
    USB: adutux: fix interface sanity check
    USB: idmouse: fix interface sanity checks
    USB: serial: io_edgeport: fix epic endpoint lookup
    usb: mon: Fix a deadlock in usbmon between mmap and read
    usb: common: usb-conn-gpio: Don't log an error on probe deferral
    usb: core: urb: fix URB structure initialization function
    usb: typec: fix use after free in typec_register_port()
    ...

    Linus Torvalds
     

10 Dec, 2019

2 commits

  • Make sure that the interrupt interface has an endpoint before trying to
    access its endpoint descriptors to avoid dereferencing a NULL pointer.

    The driver binds to the interrupt interface with interface number 0, but
    must not assume that this interface or its current alternate setting are
    the first entries in the corresponding configuration arrays.

    Fixes: b72458a80c75 ("[PATCH] USB: Eagle and ADI 930 usb adsl modem driver")
    Cc: stable # 2.6.16
    Signed-off-by: Johan Hovold
    Link: https://lore.kernel.org/r/20191210112601.3561-2-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Replace all the occurrences of FIELD_SIZEOF() with sizeof_field() except
    at places where these are defined. Later patches will remove the unused
    definition of FIELD_SIZEOF().

    This patch is generated using following script:

    EXCLUDE_FILES="include/linux/stddef.h|include/linux/kernel.h"

    git grep -l -e "\bFIELD_SIZEOF\b" | while read file;
    do

    if [[ "$file" =~ $EXCLUDE_FILES ]]; then
    continue
    fi
    sed -i -e 's/\bFIELD_SIZEOF\b/sizeof_field/g' $file;
    done

    Signed-off-by: Pankaj Bharadiya
    Link: https://lore.kernel.org/r/20190924105839.110713-3-pankaj.laxminarayan.bharadiya@intel.com
    Co-developed-by: Kees Cook
    Signed-off-by: Kees Cook
    Acked-by: David Miller # for net

    Pankaj Bharadiya
     

09 Aug, 2019

2 commits

  • USB drivers now support the ability for the driver core to handle the
    creation and removal of device-specific sysfs files in a race-free
    manner. Take advantage of that by converting the driver to use this by
    moving the sysfs attributes into a group and assigning the dev_groups
    pointer to it.

    Link: https://lore.kernel.org/r/20190806144502.17792-4-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • USB drivers now support the ability for the driver core to handle the
    creation and removal of device-specific sysfs files in a race-free
    manner. Take advantage of that by converting the driver to use this by
    moving the sysfs attributes into a group and assigning the dev_groups
    pointer to it.

    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Link: https://lore.kernel.org/r/20190806144502.17792-5-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

03 Jun, 2019

2 commits

  • Now that we have the correct SPDX tag for the ueagle-atm.c file, the
    wall of "boiler-plate" text is not needed.

    This is done on a quest to remove the 700+ different ways that files in
    the kernel describe the GPL license text. And there's unneeded stuff
    like the address (sometimes incorrect) for the FSF which is never
    needed.

    No copyright headers or other non-license-description text was removed.

    Cc: Thomas Gleixner
    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Cc: Damien Bergamini
    Cc: Duncan Sands
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Thomas rightly points out that I got the BSD clause count wrong for this
    driver, it should be 2, not 3 based on the text in the license here, so
    fix that up.

    He also raises the question that the license text points to a v2 only
    license, yet the text in the header says "or later". Given that the
    text in the header says "or later" and all of the other USB atm drivers
    are licensed in that way, I am going to leave the string as-is for that
    mark.

    Reported-by: Thomas Gleixner
    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Cc: Damien Bergamini
    Cc: Duncan Sands
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

21 May, 2019

1 commit

  • 'default n' is the default value for any bool or tristate Kconfig
    setting so there is no need to write it explicitly.

    Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO
    is not set' for visible symbols") the Kconfig behavior is the same
    regardless of 'default n' being present or not:

    ...
    One side effect of (and the main motivation for) this change is making
    the following two definitions behave exactly the same:

    config FOO
    bool

    config FOO
    bool
    default n

    With this change, neither of these will generate a
    '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
    That might make it clearer to people that a bare 'default n' is
    redundant.
    ...

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Greg Kroah-Hartman

    Bartlomiej Zolnierkiewicz
     

22 Jan, 2019

1 commit


24 Jan, 2018

3 commits

  • There's no need to have DEVICE_ATTR() in these crazy macros, so use the
    proper DEVICE_ATTR_*() versions intead.

    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Instead of "open coding" a DEVICE_ATTR() define, use the
    DEVICE_ATTR_RO() macro instead, which does everything properly instead.

    This does require a few static functions to be renamed to work properly,
    but thanks to a script from Joe Perches, this was easily done.

    Reported-by: Joe Perches
    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Cc: Oliver Neukum
    Acked-by: Alan Stern
    Acked-by: Felipe Balbi
    Acked-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Instead of "open coding" a DEVICE_ATTR() define, use the
    DEVICE_ATTR_RW() macro instead, which does everything properly instead.

    This does require a few static functions to be renamed to work properly,
    but thanks to a script from Joe Perches, this was easily done.

    Reported-by: Joe Perches
    Cc: Matthieu CASTET
    Cc: Stanislaw Gruszka
    Cc: Peter Chen
    Cc: Mathias Nyman
    Acked-by: Felipe Balbi
    Acked-by: Alan Stern
    Acked-by: Bin Liu
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

22 Nov, 2017

1 commit

  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly. Additionally corrects and on-stack
    timer usage.

    Cc: Greg Kroah-Hartman
    Cc: Duncan Sands
    Cc: "Gustavo A. R. Silva"
    Cc: accessrunner-general@lists.sourceforge.net
    Cc: linux-usb@vger.kernel.org
    Signed-off-by: Kees Cook
    Reviewed-by: Allen Pais

    Kees Cook
     

14 Nov, 2017

1 commit

  • Pull USB/PHY updates from Greg KH:
    "Here is the big set of USB and PHY driver updates for 4.15-rc1.

    There is the usual amount of gadget and xhci driver updates, along
    with phy and chipidea enhancements. There's also a lot of SPDX tags
    and license boilerplate cleanups as well, which provide some churn in
    the diffstat.

    Other major thing is the typec code that moved out of staging and into
    the "real" part of the drivers/usb/ tree, which was nice to see
    happen.

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

    * tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits)
    usb: gadget: f_fs: Fix use-after-free in ffs_free_inst
    USB: usbfs: compute urb->actual_length for isochronous
    usb: core: message: remember to reset 'ret' to 0 when necessary
    USB: typec: Remove remaining redundant license text
    USB: typec: add SPDX identifiers to some files
    USB: renesas_usbhs: rcar?.h: add SPDX tags
    USB: chipidea: ci_hdrc_tegra.c: add SPDX line
    USB: host: xhci-debugfs: add SPDX lines
    USB: add SPDX identifiers to all remaining Makefiles
    usb: host: isp1362-hcd: remove a couple of redundant assignments
    USB: adutux: remove redundant variable minor
    usb: core: add a new usb_get_ptm_status() helper
    usb: core: add a 'type' parameter to usb_get_status()
    usb: core: introduce a new usb_get_std_status() helper
    usb: core: rename usb_get_status() 'type' argument to 'recip'
    usb: core: add Status Type definitions
    USB: gadget: Remove redundant license text
    USB: gadget: function: Remove redundant license text
    USB: gadget: udc: Remove redundant license text
    USB: gadget: legacy: Remove redundant license text
    ...

    Linus Torvalds
     

04 Nov, 2017

2 commits

  • Now that the SPDX tag is in all USB files, that identifies the license
    in a specific and legally-defined manner. So the extra GPL text wording
    can be removed as it is no longer needed at all.

    This is done on a quest to remove the 700+ different ways that files in
    the kernel describe the GPL license text. And there's unneeded stuff
    like the address (sometimes incorrect) for the FSF which is never
    needed.

    No copyright headers or other non-license-description text was removed.

    Cc: Duncan Sands
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • It's good to have SPDX identifiers in all files to make it easier to
    audit the kernel tree for correct licenses.

    Update the drivers/usb/ and include/linux/usb* files with the correct
    SPDX license identifier based on the license text in the file itself.
    The SPDX identifier is a legally binding shorthand, which can be used
    instead of the full boiler plate text.

    This work is based on a script and data from Thomas Gleixner, Philippe
    Ombredanne, and Kate Stewart.

    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Signed-off-by: Greg Kroah-Hartman
    Acked-by: Felipe Balbi
    Acked-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

27 Oct, 2017

1 commit


04 Oct, 2017

2 commits


11 Aug, 2017

3 commits


22 Jul, 2017

1 commit


17 Jul, 2017

1 commit


16 Mar, 2017

1 commit


02 Mar, 2017

1 commit


25 Dec, 2016

1 commit


31 Aug, 2016

4 commits


15 Aug, 2016

1 commit