From: Aya Mahfouz Date: Tue, 10 Mar 2015 16:55:27 +0000 (+0200) Subject: staging: media: lirc: remove unnecessary cast on function argument X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=505942151da6310df05213413d4ebd10bd5fd450;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git staging: media: lirc: remove unnecessary cast on function argument Removes pointer to pointer cast on a function argument. Issue detected and resolved using the following coccinelle script: @@ expression e; type t; identifier f; @@ f(..., -(t *) e ,...) Signed-off-by: Aya Mahfouz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/media/lirc/lirc_parallel.c b/drivers/staging/media/lirc/lirc_parallel.c index 19c5c21babf5..df556442d9a6 100644 --- a/drivers/staging/media/lirc/lirc_parallel.c +++ b/drivers/staging/media/lirc/lirc_parallel.c @@ -336,7 +336,7 @@ static ssize_t lirc_read(struct file *filep, char __user *buf, size_t n, set_current_state(TASK_INTERRUPTIBLE); while (count < n) { if (rptr != wptr) { - if (copy_to_user(buf+count, (char *) &rbuf[rptr], + if (copy_to_user(buf+count, &rbuf[rptr], sizeof(int))) { result = -EFAULT; break;