Catégorie : Linux

fuse: inode: drop cast

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the cast on data of type void * as it is not needed. The following Coccinelle semantic patch was used for making the change: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[…] | ((T *)x)->f | – (T *) e …

Lire la suite

HID: roccat: Drop cast

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes the cast on data of type void* as it is not needed. The following Coccinelle semantic patch was used for making the change: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[…] | ((T *)x)->f | – (T *) e ) …

Lire la suite

net: phy: at803x: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/net/phy/at803x.c:196:26-32: ERROR: application of sizeof to pointer sizeof when applied to a pointer typed expression gives the size of the pointer Generated by: scripts/coccinelle/misc/noderef.cocci Signed-off-by: Fengguang Wu Acked-by: Daniel Mack Signed-off-by: David S. Miller — drivers/net/phy/at803x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c …

Lire la suite

Staging: rtl8192e: adjust error handling

Author: Himangi Saraogi <himangi774@gmail.com> This patch removes a test in error handling code by adding a return path. The Coccinelle semantic match that found the problem is: // @@ expression E,E1,E2; @@ E = alloc_etherdev(…) … when != E = E1 if (…) { … free_netdev(E); … return …; } … when != E = …

Lire la suite

staging: r8192ee: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com> drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c:2491:3-4: Unneeded semicolon Removes unneeded semicolon. Generated by: /kbuild/src/linux/scripts/coccinelle/misc/semicolon.cocci CC: Larry Finger Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)   diff –git a/drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c b/drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c index 7fb5907..244d559 100644 — a/drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c +++ b/drivers/staging/rtl8192ee/btcoexist/halbtc8821a2ant.c @@ -2488,7 +2488,7 @@ static void halbtc8821a2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist) …

Lire la suite

SELinux: use ARRAY_SIZE

Author: Himangi Saraogi <himangi774@gmail.com> ARRAY_SIZE is more concise to use when the size of an array is divided by the size of its type or the size of its first element. The Coccinelle semantic patch that makes this change is as follows: // @@ type T; T[] E; @@ – (sizeof(E)/sizeof(E[…])) + ARRAY_SIZE(E) // Signed-off-by: …

Lire la suite

zorro: Use ARRAY_SIZE

Author: Himangi Saraogi <himangi774@gmail.com> ARRAY_SIZE is more concise to use when the size of an array is divided by the size of its type or the size of its first element. The Coccinelle semantic patch that makes this change is as follows: // @@ type T; T[] E; @@ – (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) // Signed-off-by: …

Lire la suite

usb: gadget: fsl_qe_udc: Introduce use of managed version of kzalloc

Author: Himangi Saraogi <himangi774@gmail.com> This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, the unnecesary labels are removed and some labels are renamed to preserve ordering. The following Coccinelle semantic patch was used for making the change: @platform@ identifier p, …

Lire la suite

i2c: rk3x: add NULL entry to the end of_device_id array

Author: Dan Carpenter <dan.carpenter@oracle.com> drivers/i2c/busses/i2c-rk3x.c:610:69-70: rk3x_i2c_match is not NULL terminated at line 610 Make sure of_device_id tables are NULL terminated Generated by: /kbuild/src/linux/scripts/coccinelle/misc/of_table.cocci Signed-off-by: Dan Carpenter Signed-off-by: Wolfram Sang — drivers/i2c/busses/i2c-rk3x.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 9e3084c..a979150 100644 — a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -608,6 +608,7 @@ …

Lire la suite

aic7xxx: Use kstrdup

Author: Himangi Saraogi <himangi774@gmail.com> Use kstrdup when the goal of an allocation is copy a string into the allocated region. The Coccinelle semantic patch that makes this change is as follows: // @@ expression from,to; expression flag,E1,E2; statement S; @@ – to = kmalloc(strlen(from) + 1,flag); + to = kstrdup(from, flag); … when != \(from …

Lire la suite