26 Sep, 2020

1 commit


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 version 2 and
    only version 2 as published by the free software foundation this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     

18 Feb, 2019

1 commit

  • One of the more common cases of allocation size calculations is finding
    the size of a structure that has a zero-sized array at the end, along
    with memory for some number of elements for that array. For example:

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

    size = sizeof(struct foo) + count * sizeof(struct boo);
    instance = alloc(size, GFP_KERNEL)

    Instead of leaving these open-coded and prone to type mistakes, we can
    now use the new struct_size() helper:

    size = struct_size(instance, entry, count);
    instance = alloc(size, GFP_KERNEL)

    This code was detected with the help of Coccinelle.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Marcel Holtmann

    Gustavo A. R. Silva
     

24 Oct, 2018

1 commit

  • In the iov_iter struct, separate the iterator type from the iterator
    direction and use accessor functions to access them in most places.

    Convert a bunch of places to use switch-statements to access them rather
    then chains of bitwise-AND statements. This makes it easier to add further
    iterator types. Also, this can be more efficient as to implement a switch
    of small contiguous integers, the compiler can use ~50% fewer compare
    instructions than it has to use bitwise-and instructions.

    Further, cease passing the iterator type into the iterator setup function.
    The iterator function can set that itself. Only the direction is required.

    Signed-off-by: David Howells

    David Howells
     

30 Oct, 2017

1 commit


16 Jun, 2017

1 commit

  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = {
    skb_pull,
    __skb_pull,
    skb_pull_inline,
    __pskb_pull_tail,
    __pskb_pull,
    pskb_pull
    };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = {
    skb_pull,
    __skb_pull,
    skb_pull_inline,
    __pskb_pull_tail,
    __pskb_pull,
    pskb_pull
    };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

14 Jan, 2017

1 commit

  • Since we need to change the implementation, stop exposing internals.

    Provide kref_read() to read the current reference count; typically
    used for debug messages.

    Kills two anti-patterns:

    atomic_read(&kref->refcount)
    kref->refcount.counter

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Greg Kroah-Hartman
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

30 Jul, 2015

1 commit


15 Feb, 2015

5 commits


10 Dec, 2014

2 commits


03 Jul, 2014

4 commits


13 Mar, 2014

1 commit


08 Mar, 2014

1 commit


13 Feb, 2014

1 commit

  • There's no reason why A2MP should need or deserve its on channel type.
    Instead we should be able to group all fixed CID users under a single
    channel type and reuse as much code as possible for them. Where CID
    specific exceptions are needed the chan-scid value can be used.

    This patch renames the current A2MP channel type to a generic one and
    thereby paves the way to allow converting ATT and SMP (and any future
    fixed channel protocols) to use the new channel type.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

16 Oct, 2013

5 commits

  • The A2MP CID is only valid for BR/EDR transports. We should ignore A2MP
    data on non-BR/EDR links and refuse to create an amp_mgr object.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • The A2MP client for L2CAP channels needs to use l2cap_chan_no_resume
    empty stub function.

    Signed-off-by: Marcel Holtmann
    Signed-off-by: Gustavo Padovan

    Marcel Holtmann
     
  • We need to remove all direct access of struct sock from L2CAP core.
    This change is pretty simple and just add a new L2CAP channel callback to
    do the work in the L2CAP socket side.

    Signed-off-by: Gustavo Padovan
    Signed-off-by: Marcel Holtmann

    Gustavo Padovan
     
  • As part of the work to remove struct sock from l2cap_core.c and make it
    more generic we remove in this commit the direct access to sk->sk_sndtimeo
    member. This objective of this change is purely remove sk usage from
    l2cap_core.c

    Now we have a new l2cap ops to get the current value of sk->sndtimeo. A
    l2cap_chan_no_get_sndtimeo was added for users of L2CAP that doesn't need
    to set a timeout.

    Signed-off-by: Gustavo Padovan
    Signed-off-by: Marcel Holtmann

    Gustavo Padovan
     
  • Instead of creating an new function pointer to report errors we are just
    reusing state_change for that and there is a simple reason for this, one
    place in the l2cap_core.c code needs, in a locked sk, set both the sk_state
    and sk_err. If we create two different functions for this we would need to
    release the lock between the two operation putting the socket in non
    desired state.

    The change is transparent to the l2cap_core.c code, user that only needs
    to set the state won't need any modification.

    This is another step of an ongoing work to make l2cap_core.c totally
    independent from l2cap's struct sock.

    Signed-off-by: Gustavo Padovan
    Signed-off-by: Marcel Holtmann

    Gustavo Padovan
     

13 Oct, 2013

1 commit


11 Oct, 2013

2 commits


07 Oct, 2013

1 commit


06 Oct, 2013

9 commits