Category: Linux

powerpc/mpic_msgr: Use kcalloc and correct the argument to sizeof

Author: Himangi Saraogi <himangi774@gmail.com> mpic_msgrs has type struct mpic_msgr **, not struct mpic_msgr *, so the elements of the array should have pointer type, not structure type. The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit …

Continue reading

powerpc/fsl-pci: Correct use of ! and &

Author: Himangi Saraogi <himangi774@gmail.com> In commit ae91d60ba88ef0bdb1b5e9b2363bd52fc45d2af7, a bug was fixed that involved converting !x & y to !(x & y). The code below shows the same pattern, and thus should perhaps be fixed in the same way. This is not tested and clearly changes the semantics, so it is only something to consider. The …

Continue reading

parisc: Eliminate memset after alloc_bootmem_pages

Author: HIMANGI SARAOGI <himangi774@gmail.com> alloc_bootmem and related function always return zeroed region of memory. Thus a memset after calls to these functions is unnecessary. The following Coccinelle semantic patch was used for making the change: @@ expression E,E1; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(…) … when != E – memset(E,0,E1); Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: …

Continue reading

m68k/mm: Eliminate memset after alloc_bootmem_pages

Author: Himangi Saraogi <himangi774@gmail.com> alloc_bootmem and related functions always return a zeroed region of memory. Thus a memset after calls to these functions is unnecessary. The following Coccinelle semantic patch was used for making the change: @@ expression E,E1; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(…) … when != E – memset(E,0,E1); Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall …

Continue reading

um: net: Eliminate NULL test after alloc_bootmem

Author: Himangi Saraogi <himangi774@gmail.com> alloc_bootmem and related functions never return NULL. Thus a NULL test or memset after calls to these functions is unnecessary. The following Coccinelle semantic patch was used for making the change: @@ expression E; statement S; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(…) … when != E – if (E == NULL) S Signed-off-by: …

Continue reading

ktime: Kill non-scalar ktime_t implementation for 2038

Author: John Stultz <john.stultz@linaro.org> The non-scalar ktime_t implementation is basically a timespec which has to be changed to support dates past 2038 on 32bit systems. This patch removes the non-scalar ktime_t implementation, forcing the scalar s64 nanosecond version on all architectures. This may have additional performance overhead on some 32bit systems when converting between ktime_t …

Continue reading

target/configfs: Remove unnecessary null test

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the null test on lun_cg. lun_cg is initialized at the beginning of the function to &lun->lun_group. Since lun_cg is dereferenced prior to the null test, it must be a valid pointer. The following Coccinelle script is used for detecting the change: @r@ expression e,f; identifier g,y; statement S1,S2; …

Continue reading

[media] dib7000m: Remove unnecessary null test

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the null test on ch. ch is initialized at the beginning of the function to &demod->dtv_property_cache. Since demod is dereferenced prior to the null test, demod must be a valid pointer, and &demod->dtv_property_cache cannot be null. The following Coccinelle script is used for detecting the change: @r@ expression …

Continue reading

[media] saa7164-dvb: Remove unnecessary null test

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the null test on dvb. dvb is initialized at the beginning of the function to &port->dvb. Since port is dereferenced prior to the null test, port must be a valid pointer, and &port->dvb cannot be null. The following Coccinelle script is used for detecting the change: @r@ expression …

Continue reading

WMI: Remove unnecessary null test

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the null test on block. block is initialized at the beginning of the function to &wblock->gblock. Since wblock is dereferenced prior to the null test, wblock must be a valid pointer, and &wblock->gblock cannot be null. The following Coccinelle script is used for detecting the change: @r@ expression …

Continue reading