Skip to contentSkip to conversation

staging: nvec: Remove unnecessary cast on void pointer

PATCH In review simran singhal 2 participants 3 messages Mar 2, 2017 – Mar 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: nvec: Remove unnecessary cast on void pointer

The following Coccinelle script was used to detect this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)

---
 drivers/staging/nvec/nvec_kbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/nvec/nvec_kbd.c +1 -1
index e881e6b..a01f486 100644
@@ -58,7 +58,7 @@ static int nvec_keys_notifier(struct notifier_block *nb,
 			      unsigned long event_type, void *data)
 {
 	int code, state;
-	unsigned char *msg = (unsigned char *)data;
+	unsigned char *msg = data;
 
 	if (event_type == NVEC_KB_EVT) {
 		int _size = (msg[0] & (3 << 5)) >> 5;
Signature · 1 line
2.7.4
#1 lore raw

Please ignore this patch.
I have send this again as a part of patch series.

Quoted 43 lines · SIMRAN SINGHAL

The following Coccinelle script was used to detect this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)

---

 drivers/staging/nvec/nvec_kbd.c | 2 +- 
 1 file changed, 1 insertion(+), 1 deletion(-) 
drivers/staging/nvec/nvec_kbd.c +1 -1
index e881e6b..a01f486 100644 
@@ -58,7 +58,7 @@ static int nvec_keys_notifier(struct notifier_block *nb, 
                               unsigned long event_type, void *data) 
 { 
         int code, state; 
-        unsigned char *msg = (unsigned char *)data; 
+        unsigned char *msg = data; 
 
         if (event_type == NVEC_KB_EVT) { 
                 int _size = (msg[0] & (3 << 5)) >> 5; 
Signature · 1 line
2.7.4 
Acked-by on v1 1/1
#2 lore raw
In reply to simran singhal
Quoted 19 lines · simran singhal

The following Coccinelle script was used to detect this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)

Quoted 4 lines
---
 drivers/staging/nvec/nvec_kbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel