Catégorie : Linux

staging: comedi: drivers: remove extra parentheses around right bit shift operation

Author: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Removes extra parentheses around bitwise right shift operation. The issue was detected and resolved using the following coccinelle script: @@ expression e, e1; constant c; @@ e = -(e1 +e1 >> -c); +c; @@ identifier i; constant c; type t; expression e; @@ t i = -(e +e >> -c); +c; …

Lire la suite

Staging: rtl8712: Eliminate use of _init_timer

Author: Vaishali Thakkar <vthakkar1994@gmail.com> This patch introduces the use of API function setup_timer instead of driver specific function _init_timer as it is the preferred and standard way to setup and set the timer. To be compatible with the change, argument types of referenced functions are changed. Also, definition of function _init_timer is removed as it …

Lire la suite

staging: lustre: remove initialization of static ints

Author: Supriya Karanth <iskaranth@gmail.com> static ints are initialized to 0 by the compiler. Explicit initialization is not necessary. Found by checkpatch.pl – ERROR: do not initialise statics to 0 or NULL changes made using coccinelle script: @@ type T; identifier var; @@ -static T var = 0; +static T var; Signed-off-by: Supriya Karanth Signed-off-by: Greg …

Lire la suite

staging: rtl8192u: ieee80211: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

Author: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> eth_zero_addr() is a wrapper function for memset if 0 is going to be assigned to a mac address. The replacement was done by the following coccinelle script: @header@ @@ #include @eth_zero_addr@ expression e; @@ -memset(e,0,ETH_ALEN); +eth_zero_addr(e); @eth_broadcast_addr@ identifier e; @@ -memset(e,\(0xff\|0xFF\|255\),ETH_ALEN); +eth_broadcast_addr(e); @linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @ …

Lire la suite

staging: rtl8192u: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

Author: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> eth_zero_addr() is a wrapper function for memset if 0 is going to be assigned to a mac address. The replacement was done by the following coccinelle script: @header@ @@ #include @eth_zero_addr@ expression e; @@ -memset(e,0,ETH_ALEN); +eth_zero_addr(e); @eth_broadcast_addr@ identifier e; @@ -memset(e,\(0xff\|0xFF\|255\),ETH_ALEN); +eth_broadcast_addr(e); @linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @ …

Lire la suite

staging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

Author: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> eth_zero_addr() is a wrapper function for memset if 0 is going to be assigned to a mac address. The replacement was done by the following coccinelle script: @header@ @@ #include @eth_zero_addr@ expression e; @@ -memset(e,0,ETH_ALEN); +eth_zero_addr(e); @eth_broadcast_addr@ identifier e; @@ -memset(e,\(0xff\|0xFF\|255\),ETH_ALEN); +eth_broadcast_addr(e); @linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @ …

Lire la suite

staging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

Author: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> eth_zero_addr() is a wrapper function for memset if 0 is going to be assigned to a mac address. The replacement was done by the following coccinelle script: @header@ @@ #include @eth_zero_addr@ expression e; @@ -memset(e,0,ETH_ALEN); +eth_zero_addr(e); @eth_broadcast_addr@ identifier e; @@ -memset(e,\(0xff\|0xFF\|255\),ETH_ALEN); +eth_broadcast_addr(e); @linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @ …

Lire la suite

staging: comedi: Remove if condition.

Author: Navya Sri Nizamkari <navyasri.tech@gmail.com> This patch removes a if condition which has a semicolon after it. As the conditional check is redundant, the comment before it is also changed. The following coccinelle script was used to detect the pattern of a semicolon after if. @r1@ position p; @@ if (…);@p @script:python@ p0

staging: lustre: lustre: libcfs: Replaced printk() with pr_err() and pr_cont()

Author: Tina Johnson <tinajohnson.1234@gmail.com> The following checkpatch warning was fixed: Prefer [subsystem eg: netdev]_err([subsystem]dev with the help of Coccinelle. pr_cont() was used to replace those printk statements which followed a printk that did not end with a ‘\n’. The following semantic patch was used to replace printk() with pr_err(): @a@ expression e; @@ printk(e,…); @script:python …

Lire la suite

staging: lustre: lustre: libcfs: Replaced printk() with pr_err()

Author: Tina Johnson <tinajohnson.1234@gmail.com> The following checkpatch warning was fixed: Prefer [subsystem eg: netdev]_err([subsystem]dev with the help of Coccinelle. The following semantic patch was used: @a@ expression e; @@ printk(e,…); @script:python b@ e