28 Jul, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1].

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

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

    Gustavo A. R. Silva
     

13 Apr, 2020

1 commit

  • The pointer 'w' is being initialized with a value that is never read
    and it is being updated later with a new value. The initialization
    is redundant and can be removed.

    Addresses-Coverity: ("Unused value")
    Signed-off-by: Colin Ian King
    Link: https://lore.kernel.org/r/20200405130619.377043-1-colin.king@canonical.com
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

20 Mar, 2020

1 commit


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/20200220132908.GA30501@embeddedor
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

03 Apr, 2019

1 commit


22 Mar, 2019

1 commit

  • Remove print statements that provide information about error messages
    when memory allocation is failed.
    Issue found using coccinelle
    The following semantic patch is used to solve this:

    @@
    expression x;
    constant char[] C;
    identifier f;
    @@

    x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
    usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

    if(x==NULL)
    {
    ...
    (
    -f(C,...);
    |
    -f(...,C);
    )
    ...
    }

    Signed-off-by: Bhanusree Pola
    Acked-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Bhanusree Pola
     

21 Mar, 2019

1 commit


18 Mar, 2019

1 commit


11 Jul, 2018

1 commit

  • Variable idProduct and idVendor are being assigned but are never used
    hence they are redundant and can be removed.

    Cleans up clang warnings:
    warning: variable 'idProduct' set but not used [-Wunused-but-set-variable]
    warning: variable 'idVendor' set but not used [-Wunused-but-set-variable]

    Signed-off-by: Colin Ian King
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

17 Jun, 2018

1 commit


26 Apr, 2018

2 commits

  • Now that the SPDX tag is in all gdm724x 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.

    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.

    Fix up the all of the staging gdm724x files to have a proper SPDX
    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.

    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 Apr, 2018

1 commit


23 Feb, 2018

3 commits


20 Feb, 2018

5 commits


14 Nov, 2017

1 commit

  • Pull staging and IIO updates from Greg KH:
    "Here is the "big" staging and IIO driver update for 4.15-rc1.

    Lots and lots of little changes, almost all minor code cleanups as the
    Outreachy application process happened during this development cycle.
    Also happened was a lot of IIO driver activity, and the typec USB code
    moving out of staging to drivers/usb (same commits are in the USB tree
    on a persistent branch to not cause merge issues.)

    Overall, it's a wash, I think we added a few hundred more lines than
    removed, but really only a few thousand were modified at all.

    All of these have been in linux-next for a while. There might be a
    merge issue with Al's vfs tree in the pi433 driver (take his changes,
    they are always better), and the media tree with some of the odd
    atomisp cleanups (take the media tree's version)"

    * tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (507 commits)
    staging: lustre: add SPDX identifiers to all lustre files
    staging: greybus: Remove redundant license text
    staging: greybus: add SPDX identifiers to all greybus driver files
    staging: ccree: simplify ioread/iowrite
    staging: ccree: simplify registers access
    staging: ccree: simplify error handling logic
    staging: ccree: remove dead code
    staging: ccree: handle limiting of DMA masks
    staging: ccree: copy IV to DMAable memory
    staging: fbtft: remove redundant initialization of buf
    staging: sm750fb: Fix parameter mistake in poke32
    staging: wilc1000: Fix bssid buffer offset in Txq
    staging: fbtft: fb_ssd1331: fix mirrored display
    staging: android: Fix checkpatch.pl error
    staging: greybus: loopback: convert loopback to use generic async operations
    staging: greybus: operation: add private data with get/set accessors
    staging: greybus: loopback: Fix iteration count on async path
    staging: greybus: loopback: Hold per-connection mutex across operations
    staging: greybus/loopback: use ktime_get() for time intervals
    staging: fsl-dpaa2/eth: Extra headroom in RX buffers
    ...

    Linus Torvalds
     

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
     

20 Oct, 2017

2 commits


06 Jul, 2017

1 commit

  • Pull networking updates from David Miller:
    "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
    merge window:

    1) Several optimizations for UDP processing under high load from
    Paolo Abeni.

    2) Support pacing internally in TCP when using the sch_fq packet
    scheduler for this is not practical. From Eric Dumazet.

    3) Support mutliple filter chains per qdisc, from Jiri Pirko.

    4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

    5) Add batch dequeueing to vhost_net, from Jason Wang.

    6) Flesh out more completely SCTP checksum offload support, from
    Davide Caratti.

    7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
    Neira Ayuso, and Matthias Schiffer.

    8) Add devlink support to nfp driver, from Simon Horman.

    9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
    Prabhu.

    10) Add stack depth tracking to BPF verifier and use this information
    in the various eBPF JITs. From Alexei Starovoitov.

    11) Support XDP on qed device VFs, from Yuval Mintz.

    12) Introduce BPF PROG ID for better introspection of installed BPF
    programs. From Martin KaFai Lau.

    13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

    14) For loads, allow narrower accesses in bpf verifier checking, from
    Yonghong Song.

    15) Support MIPS in the BPF selftests and samples infrastructure, the
    MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
    Daney.

    16) Support kernel based TLS, from Dave Watson and others.

    17) Remove completely DST garbage collection, from Wei Wang.

    18) Allow installing TCP MD5 rules using prefixes, from Ivan
    Delalande.

    19) Add XDP support to Intel i40e driver, from Björn Töpel

    20) Add support for TC flower offload in nfp driver, from Simon
    Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
    Kicinski, and Bert van Leeuwen.

    21) IPSEC offloading support in mlx5, from Ilan Tayari.

    22) Add HW PTP support to macb driver, from Rafal Ozieblo.

    23) Networking refcount_t conversions, From Elena Reshetova.

    24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
    for tuning the TCP sockopt settings of a group of applications,
    currently via CGROUPs"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
    net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
    dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
    cxgb4: Support for get_ts_info ethtool method
    cxgb4: Add PTP Hardware Clock (PHC) support
    cxgb4: time stamping interface for PTP
    nfp: default to chained metadata prepend format
    nfp: remove legacy MAC address lookup
    nfp: improve order of interfaces in breakout mode
    net: macb: remove extraneous return when MACB_EXT_DESC is defined
    bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
    bpf: fix return in load_bpf_file
    mpls: fix rtm policy in mpls_getroute
    net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
    net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
    ...

    Linus Torvalds
     

16 Jun, 2017

1 commit

  • A common pattern with skb_put() is to just want to memcpy()
    some data into the new space, introduce skb_put_data() for
    this.

    An spatch similar to the one for skb_put_zero() converts many
    of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

    (again, manually post-processed to retain some comments)

    Reviewed-by: Stephen Hemminger
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

03 Jun, 2017

1 commit


28 Apr, 2017

1 commit


16 Mar, 2017

1 commit


10 Mar, 2017

1 commit

  • Use macro min() to get the minimum of two values for
    brevity and readability. The macro MUX_TX_MAX_SIZE
    has a value of 2048 which is well within the integer
    limits. This check was done manually.

    Found using Coccinelle:
    @@ type T; T x; T y; @@
    (
    - x < y ? x : y
    + min(x,y)
    |
    - x > y ? x : y
    + max(x,y)
    )

    Signed-off-by: Gargi Sharma
    Signed-off-by: Greg Kroah-Hartman

    Gargi Sharma
     

06 Mar, 2017

2 commits

  • Removed initialisation of a varible if it is immediately reassigned.

    Changes were made using Coccinelle.

    @@
    type T;
    constant C;
    expression e;
    identifier i;
    @@
    T i
    - = C
    ;
    i = e;

    Signed-off-by: simran singhal
    Signed-off-by: Greg Kroah-Hartman

    simran singhal
     
  • The icmp6_checksum was returning an invalid data type as the expected type
    is __sum16. For returning such data type, icmp6_checksum, now, is using
    the kernel functions for computing the checksum.

    Here, the sparse message:

    drivers/staging/gdm724x/gdm_lte.c:311:39: warning: incorrect type in assignment (different base types)
    drivers/staging/gdm724x/gdm_lte.c:311:39: expected restricted __sum16 [addressable] [assigned] [usertype] icmp6_cksum
    drivers/staging/gdm724x/gdm_lte.c:311:39: got int

    Signed-off-by: Javier Rodriguez
    Signed-off-by: Greg Kroah-Hartman

    Javier Rodriguez
     

09 Feb, 2017

2 commits

  • Fix sparse warning issue.

    drivers/staging/gdm724x/gdm_lte.c:201:33: warning: incorrect type in assignment (different base types)
    drivers/staging/gdm724x/gdm_lte.c:201:33: expected unsigned int [unsigned] [addressable] [usertype] ph_len
    drivers/staging/gdm724x/gdm_lte.c:201:33: got restricted __be16 [usertype] payload_len

    Signed-off-by: Javier Rodriguez
    Signed-off-by: Greg Kroah-Hartman

    Javier Rodriguez
     
  • The find_dev_index() function is frustrating. If you give it an invalid
    index then it returns 0. That was the intent except there is an
    off-by-one so it can return MAX_NIC_TYPE which is one higher than we
    want.

    There is one caller which had a sanity check to catch invalid returns,
    but the other two callers assumed that index was valid.

    My feeling is that when we are given invalid indexes, that should be
    treated like an error and we abandon what we were doing.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

08 Jan, 2017

1 commit


06 Jan, 2017

1 commit

  • Update the driver's HCI structs and associated endian-converter
    functions with new driver-specific bitwise types. The new types
    encourage correct endian-handling within the driver by triggering
    sparse warnings when mixing with other types. The driver's
    endian-converters provide correct and warning-free conversions.

    Driver-specific bitwise types are used instead of the standard
    endian-specific types because the attached device can be of either
    endian. This is also why the driver has its own endian-conversion
    functions, which consider endianness of both the cpu and the attached
    device.

    Introducing the new types to the converters fixes the sparse warnings:

    CHECK drivers/staging/gdm724x/gdm_endian.c
    drivers/staging/gdm724x/gdm_endian.c:28:24: warning: incorrect type in return expression (different base types)
    drivers/staging/gdm724x/gdm_endian.c:28:24: expected unsigned short
    drivers/staging/gdm724x/gdm_endian.c:28:24: got restricted __le16 [usertype]
    drivers/staging/gdm724x/gdm_endian.c:30:24: warning: incorrect type in return expression (different base types)
    drivers/staging/gdm724x/gdm_endian.c:30:24: expected unsigned short
    drivers/staging/gdm724x/gdm_endian.c:30:24: got restricted __be16 [usertype]
    drivers/staging/gdm724x/gdm_endian.c:36:24: warning: cast to restricted __le16
    drivers/staging/gdm724x/gdm_endian.c:38:24: warning: cast to restricted __be16
    drivers/staging/gdm724x/gdm_endian.c:44:24: warning: incorrect type in return expression (different base types)
    drivers/staging/gdm724x/gdm_endian.c:44:24: expected unsigned int
    drivers/staging/gdm724x/gdm_endian.c:44:24: got restricted __le32 [usertype]
    drivers/staging/gdm724x/gdm_endian.c:46:24: warning: incorrect type in return expression (different base types)
    drivers/staging/gdm724x/gdm_endian.c:46:24: expected unsigned int
    drivers/staging/gdm724x/gdm_endian.c:46:24: got restricted __be32 [usertype]
    drivers/staging/gdm724x/gdm_endian.c:52:24: warning: cast to restricted __le32
    drivers/staging/gdm724x/gdm_endian.c:54:24: warning: cast to restricted __be32

    Signed-off-by: Eric S. Stone
    Signed-off-by: Greg Kroah-Hartman

    Eric S. Stone
     

30 Nov, 2016

2 commits


16 Sep, 2016

1 commit