21 May, 2019

1 commit


17 Sep, 2018

1 commit

  • The operation ~(p100_inb(VG_LAN_CFG_1) & HP100_LINK_UP) returns a value
    that is always non-zero and hence the wait for the link to drop always
    terminates prematurely. Fix this by using a logical not operator instead
    of a bitwise complement. This issue has been in the driver since
    pre-2.6.12-rc2.

    Detected by CoverityScan, CID#114157 ("Logical vs. bitwise operator")

    Signed-off-by: Colin Ian King
    Signed-off-by: David S. Miller

    Colin Ian King
     

20 Aug, 2017

1 commit

  • eisa_device_id are not supposed to change at runtime. All functions
    working with eisa_device_id provided by work with
    const eisa_device_id. So mark the non-const structs as const.

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     

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 (skb_put, __skb_put and pskb_put) 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_put, __skb_put };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_put, __skb_put };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    which actually doesn't cover pskb_put since there are only three
    users overall.

    A handful of stragglers were converted manually, notably a macro in
    drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
    instances in net/bluetooth/hci_sock.c. In the former file, I also
    had to fix one whitespace problem spatch introduced.

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

    Johannes Berg
     

20 Apr, 2017

1 commit

  • When the kernel is running in secure boot mode, we lock down the kernel to
    prevent userspace from modifying the running kernel image. Whilst this
    includes prohibiting access to things like /dev/mem, it must also prevent
    access by means of configuring driver modules in such a way as to cause a
    device to access or modify the kernel image.

    To this end, annotate module_param* statements that refer to hardware
    configuration and indicate for future reference what type of parameter they
    specify. The parameter parser in the core sees this information and can
    skip such parameters with an error message if the kernel is locked down.
    The module initialisation then runs as normal, but just sees whatever the
    default values for those parameters is.

    Note that we do still need to do the module initialisation because some
    drivers have viable defaults set in case parameters aren't specified and
    some drivers support automatic configuration (e.g. PNP or PCI) in addition
    to manually coded parameters.

    This patch annotates drivers in drivers/net/ethernet/.

    Suggested-by: Alan Cox
    Signed-off-by: David Howells
    cc: Steffen Klassert
    cc: Jaroslav Kysela
    cc: netdev@vger.kernel.org
    cc: linux-parisc@vger.kernel.org

    David Howells
     

13 Oct, 2016

1 commit

  • With centralized MTU checking, there's nothing productive done by
    eth_change_mtu that isn't already done in dev_set_mtu, so mark it as
    deprecated and remove all usage of it in the kernel. All callers have been
    audited for calls to alloc_etherdev* or ether_setup directly, which means
    they all have a valid dev->min_mtu and dev->max_mtu. Now eth_change_mtu
    prints out a netdev_warn about being deprecated, for the benefit of
    out-of-tree drivers that might be utilizing it.

    Of note, dvb_net.c actually had dev->mtu = 4096, while using
    eth_change_mtu, meaning that if you ever tried changing it's mtu, you
    couldn't set it above 1500 anymore. It's now getting dev->max_mtu also set
    to 4096 to remedy that.

    v2: fix up lantiq_etop, missed breakage due to drive not compiling on x86

    CC: netdev@vger.kernel.org
    Signed-off-by: Jarod Wilson
    Signed-off-by: David S. Miller

    Jarod Wilson
     

05 May, 2016

1 commit

  • Replace all trans_start updates with netif_trans_update helper.
    change was done via spatch:

    struct net_device *d;
    @@
    - d->trans_start = jiffies
    + netif_trans_update(d)

    Compile tested only.

    Cc: user-mode-linux-devel@lists.sourceforge.net
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linux1394-devel@lists.sourceforge.net
    Cc: linux-rdma@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: MPT-FusionLinux.pdl@broadcom.com
    Cc: linux-scsi@vger.kernel.org
    Cc: linux-can@vger.kernel.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-omap@vger.kernel.org
    Cc: linux-hams@vger.kernel.org
    Cc: linux-usb@vger.kernel.org
    Cc: linux-wireless@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: devel@driverdev.osuosl.org
    Cc: b.a.t.m.a.n@lists.open-mesh.org
    Cc: linux-bluetooth@vger.kernel.org
    Signed-off-by: Florian Westphal
    Acked-by: Felipe Balbi
    Acked-by: Mugunthan V N
    Acked-by: Antonio Quartulli
    Signed-off-by: David S. Miller

    Florian Westphal
     

30 Jan, 2016

1 commit

  • Building the hp100 ethernet driver causes warnings when both the PCI
    and EISA drivers are disabled:

    ethernet/hp/hp100.c: In function 'hp100_module_init':
    ethernet/hp/hp100.c:3047:2: warning: label 'out3' defined but not used [-Wunused-label]
    ethernet/hp/hp100.c: At top level:
    ethernet/hp/hp100.c:2828:13: warning: 'cleanup_dev' defined but not used [-Wunused-function]

    We can easily avoid the warnings and make the driver look slightly
    nicer by removing the #ifdefs that check for the CONFIG_PCI and
    CONFIG_EISA, as all the registration functions are designed to
    have no effect when the buses are disabled.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

14 Dec, 2015

1 commit


23 Jun, 2015

1 commit

  • This howto made sense in the 1990s when users had to manually configure
    ISA cards with jumpers or vendor utilities, but with the implementation
    of PCI it became increasingly less and less relevant, to the point where
    it has been well over a decade since I last updated it. And there is
    no value in anyone else taking over updating it either.

    However the references to it continue to spread as boiler plate text
    from one Kconfig file into the next. We are not doing end users any
    favours by pointing them at this old document, so lets kill it with
    fire, once and for all, to hopefully stop any further spread.

    No code is changed in this commit, just Kconfig help text.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     

10 Dec, 2014

1 commit


09 Sep, 2014

1 commit


13 Aug, 2014

1 commit

  • We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
    meet kernel coding style guidelines. This issue was reported by checkpatch.

    A simplified version of the semantic patch that makes this change is as
    follows (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i;
    declarer name DEFINE_PCI_DEVICE_TABLE;
    initializer z;
    @@

    - DEFINE_PCI_DEVICE_TABLE(i)
    + const struct pci_device_id i[]
    = z;

    //

    [bhelgaas: add semantic patch]
    Signed-off-by: Benoit Taine
    Signed-off-by: Bjorn Helgaas

    Benoit Taine
     

28 Sep, 2013

1 commit


16 Sep, 2013

1 commit


08 Dec, 2012

1 commit


04 Dec, 2012

1 commit

  • CONFIG_HOTPLUG is going away as an option. As result the __dev*
    markings will be going away.

    Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
    and __devexit.

    Signed-off-by: Bill Pemberton
    Cc: Jaroslav Kysela
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

07 Jun, 2012

1 commit

  • Adding casts of objects to the same type is unnecessary
    and confusing for a human reader.

    For example, this cast:

    int y;
    int *p = (int *)&y;

    I used the coccinelle script below to find and remove these
    unnecessary casts. I manually removed the conversions this
    script produces of casts with __force, __iomem and __user.

    @@
    type T;
    T *p;
    @@

    - (T *)p
    + p

    A function in atl1e_main.c was passed a const pointer
    when it actually modified elements of the structure.

    Change the argument to a non-const pointer.

    A function in stmmac needed a __force to avoid a sparse
    warning. Added it.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

07 Feb, 2012

1 commit


01 Feb, 2012

1 commit


27 Aug, 2011

1 commit

  • Based on finds for Stephen Rothwell, where current defconfig's
    enable a ethernet driver and it is not compiled due to the newly
    added NET_VENDOR_* component of Kconfig.

    This patch enables all the "new" Kconfig options so that current
    defconfig's will continue to compile the expected drivers. In
    addition, by enabling all the new Kconfig options does not add
    any un-expected options.

    CC: Stephen Rothwll
    Signed-off-by: Jeff Kirsher

    Jeff Kirsher
     

18 Aug, 2011

1 commit


13 Aug, 2011

1 commit