linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: nvec: Remove unnecessary cast on void pointer
@ 2017-03-02 20:15 simran singhal
  2017-03-08 12:49 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: simran singhal @ 2017-03-02 20:15 UTC (permalink / raw)
  To: marvin24
  Cc: gregkh, ac100, linux-tegra, devel, linux-kernel, outreachy-kernel

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
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 drivers/staging/nvec/nvec_kbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index e881e6b..a01f486 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: nvec: Remove unnecessary cast on void pointer
  2017-03-02 20:15 [PATCH] staging: nvec: Remove unnecessary cast on void pointer simran singhal
@ 2017-03-08 12:49 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2017-03-08 12:49 UTC (permalink / raw)
  To: simran singhal
  Cc: marvin24, gregkh, ac100, linux-tegra, devel, linux-kernel,
	outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

On Fri, Mar 03, 2017 at 01:45:11AM +0530, simran singhal wrote:
> 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
> )
> 
> Signed-off-by: simran singhal <singhalsimran0@gmail.com>
> ---
>  drivers/staging/nvec/nvec_kbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-08 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 20:15 [PATCH] staging: nvec: Remove unnecessary cast on void pointer simran singhal
2017-03-08 12:49 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).