Catégorie : Linux

cnic: Replace rcu_dereference() with rcu_access_pointer()

Author: Andreea-Cristina Bernat <bernat.ada@gmail.com> The « rcu_dereference() » calls are used directly in conditions. Since their return values are never dereferenced it is recommended to use « rcu_access_pointer() » instead of « rcu_dereference() ». Therefore, this patch makes the replacements. The following Coccinelle semantic patch was used: @@ @@ ( if( ()) {…} | while( ()) {…} ) Signed-off-by: Andreea-Cristina Bernat …

Lire la suite

staging: comedi: dt3000: remove unneeded variable

Author: Chase Southwood <chase.southwood@gmail.com> Coccinelle (using scripts/coccinelle/tests/doublebitand.cocci) found this assignment because 0 is or’d twice. Upon inspection, I found that the variable « mode » is only assigned once and used once, and thus can be cleanly removed. This patch plugs its value straight into writew() and then removes the variable. Signed-off-by: Chase Southwood Reviewed-by: Ian Abbott …

Lire la suite

isdn/bas_gigaset: use USB API functions rather than constants

Author: Himangi Saraogi <himangi774@gmail.com> This patch introduces the use of the function usb_endpoint_num. The Coccinelle semantic patch that makes these changes is as follows: @@ struct usb_endpoint_descriptor *epd; @@ – (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\)) + usb_endpoint_num(epd) Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Acked-by: Tilman Schmidt Signed-off-by: David S. Miller — drivers/isdn/gigaset/bas-gigaset.c | 2 +- 1 file …

Lire la suite

isdn/gigaset: use USB API functions rather than constants

Author: Himangi Saraogi <himangi774@gmail.com> This patch introduces the use of the function usb_endpoint_num. The Coccinelle semantic patch that makes these changes is as follows: @@ struct usb_endpoint_descriptor *epd; @@ – (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\)) + usb_endpoint_num(epd) Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Acked-by: Tilman Schmidt Signed-off-by: David S. Miller — drivers/isdn/gigaset/usb-gigaset.c | 2 +- 1 file …

Lire la suite

[media] rc-core: use USB API functions rather than constants

Author: Himangi Saraogi <himangi774@gmail.com> This patch introduces the use of !usb_endpoint_dir_in(epd) and !usb_endpoint_xfer_int(epd). The Coccinelle semantic patch that makes these changes is as follows: – ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) != – \(USB_DIR_IN\|0x80\)) + !usb_endpoint_dir_in(epd) @@ struct usb_endpoint_descriptor *epd; @@ – ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) != – \(USB_ENDPOINT_XFER_INT\|3\)) + !usb_endpoint_xfer_int(epd) Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: Mauro …

Lire la suite

[media] radio-si470x-usb: use USB API functions rather than constants

Author: Himangi Saraogi <himangi774@gmail.com> This patch introduces the use of the function usb_endpoint_is_int_in. The Coccinelle semantic patch that makes these changes is as follows: @@ struct usb_endpoint_descriptor *epd; @@ – ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) == – \(USB_DIR_IN\|0x80\)) + usb_endpoint_dir_in(epd) @@ struct usb_endpoint_descriptor *epd; @@ – ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) == – \(USB_ENDPOINT_XFER_INT\|3\)) + usb_endpoint_xfer_int(epd) @@ struct usb_endpoint_descriptor …

Lire la suite

[media] media/rc/imon.c: use USB API functions rather than constants

Author: Himangi Saraogi <himangi774@gmail.com> This patch introduces the use of the function usb_endpoint_type. The Coccinelle semantic patch that makes these changes is as follows: @@ struct usb_endpoint_descriptor *epd; @@ – (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) + usb_endpoint_type(epd) Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: Mauro Carvalho Chehab — drivers/media/rc/imon.c | 2 +- 1 file changed, 1 insertion(+), …

Lire la suite

Drivers: ide: Remove typedef atiixp_ide_timing

Author: Himangi Saraogi <himangi774@gmail.com> The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedef for atiixp_ide_timing. The following Coccinelle semantic patch detects the case: @tn1@ type td; @@ typedef struct { … } td; @script:python tf@ td

atmel_cs: Remove typedef local_info_t

Author: Himangi Saraogi <himangi774@gmail.com> The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedef for local_info_t. Also, the name of the struct is changed to drop the _t, to make the name look less typedef-like. The following Coccinelle semantic patch detects the case: @tn@ identifier …

Lire la suite

Bluetooth: Remove typedef bluecard_info_t

Author: Himangi Saraogi <himangi774@gmail.com> The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedef for bluecard_info_t. Also, the name of the struct is changed to drop the _t, to make the name look less typedef-like. The following Coccinelle semantic patch detects the case: @tn@ identifier …

Lire la suite