09 Nov, 2019

1 commit


05 Oct, 2019

3 commits


12 Jun, 2018

1 commit

  • Pull hwspinlock updates from Bjorn Andersson:
    "In addition to migrating the files to use SPDX license headers this
    introduces the ability for clients to operate a hwlock without the
    framework taking any additional locks"

    * tag 'hwlock-v4.18' of git://github.com/andersson/remoteproc:
    hwspinlock/u8500: Switch to SPDX license identifier
    hwspinlock: sprd: Switch to SPDX license identifier
    hwspinlock/sirf: Switch to SPDX license identifier
    hwspinlock: qcom: Switch to SPDX license identifier
    hwspinlock/omap: Switch to SPDX license identifier
    hwspinlock/core: Switch to SPDX license identifier
    hwspinlock: Introduce one new mode for hwspinlock
    hwspinlock: Convert to use 'switch' statement

    Linus Torvalds
     

07 Jun, 2018

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;
    void *entry[];
    };

    instance = kmalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

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

    instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL);

    This patch makes the changes for kmalloc()-family (and kvmalloc()-family)
    uses. It was done via automatic conversion with manual review for the
    "CHECKME" non-standard cases noted below, using the following Coccinelle
    script:

    // pkey_cache = kmalloc(sizeof *pkey_cache + tprops->pkey_tbl_len *
    // sizeof *pkey_cache->table, GFP_KERNEL);
    @@
    identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
    expression GFP;
    identifier VAR, ELEMENT;
    expression COUNT;
    @@

    - alloc(sizeof(*VAR) + COUNT * sizeof(*VAR->ELEMENT), GFP)
    + alloc(struct_size(VAR, ELEMENT, COUNT), GFP)

    // mr = kzalloc(sizeof(*mr) + m * sizeof(mr->map[0]), GFP_KERNEL);
    @@
    identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
    expression GFP;
    identifier VAR, ELEMENT;
    expression COUNT;
    @@

    - alloc(sizeof(*VAR) + COUNT * sizeof(VAR->ELEMENT[0]), GFP)
    + alloc(struct_size(VAR, ELEMENT, COUNT), GFP)

    // Same pattern, but can't trivially locate the trailing element name,
    // or variable name.
    @@
    identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
    expression GFP;
    expression SOMETHING, COUNT, ELEMENT;
    @@

    - alloc(sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP)
    + alloc(CHECKME_struct_size(&SOMETHING, ELEMENT, COUNT), GFP)

    Signed-off-by: Kees Cook

    Kees Cook
     

25 May, 2018

1 commit


20 Oct, 2014

1 commit


29 Nov, 2012

3 commits


09 Nov, 2011

1 commit


08 Nov, 2011

2 commits

  • Fix below build error:

    CC drivers/hwspinlock/u8500_hsem.o
    drivers/hwspinlock/u8500_hsem.c: In function 'u8500_hsem_probe':
    drivers/hwspinlock/u8500_hsem.c:113: error: label 'free_state' used but not defined

    Signed-off-by: Axel Lin
    Signed-off-by: Ohad Ben-Cohen

    Axel Lin
     
  • Include module.h to fix below build error:

    CC drivers/hwspinlock/u8500_hsem.o
    drivers/hwspinlock/u8500_hsem.c:177: error: 'THIS_MODULE' undeclared here (not in a function)
    [...]
    drivers/hwspinlock/u8500_hsem.c:196: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
    drivers/hwspinlock/u8500_hsem.c:196: warning: function declaration isn't a prototype
    make[2]: *** [drivers/hwspinlock/u8500_hsem.o] Error 1
    make[1]: *** [drivers/hwspinlock] Error 2
    make: *** [drivers] Error 2

    Signed-off-by: Axel Lin
    Signed-off-by: Paul Gortmaker

    Axel Lin
     

22 Sep, 2011

1 commit

  • Add hwspinlock driver for U8500's Hsem hardware.

    At this point only HSem's protocol 1 is used (i.e. no interrupts).

    Signed-off-by: Mathieu Poirier
    Acked-by: Linus Walleij
    [ohad@wizery.com: adopt recent hwspin_lock_{un}register API changes]
    [ohad@wizery.com: set the owner member of the driver]
    [ohad@wizery.com: mark ->remove() function as __devexit]
    [ohad@wizery.com: write commit log]
    [ohad@wizery.com: small cleanups]
    Signed-off-by: Ohad Ben-Cohen

    Mathieu J. Poirier