Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1614535 > unrolled thread

[PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer

Started bysimran singhal <singhalsimran0@gmail.com>
First post2017-04-01 16:20 +0200
Last post2017-04-02 11:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer simran singhal <singhalsimran0@gmail.com> - 2017-04-01 16:20 +0200
    Re: [PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void  pointer Jonathan Cameron <jic23@kernel.org> - 2017-04-02 11:00 +0200

#1614535 — [PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer

Fromsimran singhal <singhalsimran0@gmail.com>
Date2017-04-01 16:20 +0200
Subject[PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer
Message-ID<trs2J-3Q0-3@gated-at.bofh.it>
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/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index e11653d..f570b48 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -364,7 +364,7 @@ static int st_lsm6dsx_update_fifo(struct iio_dev *iio_dev, bool enable)
 
 static irqreturn_t st_lsm6dsx_handler_irq(int irq, void *private)
 {
-	struct st_lsm6dsx_hw *hw = (struct st_lsm6dsx_hw *)private;
+	struct st_lsm6dsx_hw *hw = private;
 	struct st_lsm6dsx_sensor *sensor;
 	int i;
 
@@ -388,7 +388,7 @@ static irqreturn_t st_lsm6dsx_handler_irq(int irq, void *private)
 
 static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private)
 {
-	struct st_lsm6dsx_hw *hw = (struct st_lsm6dsx_hw *)private;
+	struct st_lsm6dsx_hw *hw = private;
 	int count;
 
 	mutex_lock(&hw->fifo_lock);
-- 
2.7.4

[toc] | [next] | [standalone]


#1614669 — Re: [PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer

FromJonathan Cameron <jic23@kernel.org>
Date2017-04-02 11:00 +0200
SubjectRe: [PATCH] iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer
Message-ID<trJwB-6BS-5@gated-at.bofh.it>
In reply to#1614535
On 01/04/17 15:16, 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>
Applied.
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index e11653d..f570b48 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -364,7 +364,7 @@ static int st_lsm6dsx_update_fifo(struct iio_dev *iio_dev, bool enable)
>  
>  static irqreturn_t st_lsm6dsx_handler_irq(int irq, void *private)
>  {
> -	struct st_lsm6dsx_hw *hw = (struct st_lsm6dsx_hw *)private;
> +	struct st_lsm6dsx_hw *hw = private;
>  	struct st_lsm6dsx_sensor *sensor;
>  	int i;
>  
> @@ -388,7 +388,7 @@ static irqreturn_t st_lsm6dsx_handler_irq(int irq, void *private)
>  
>  static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private)
>  {
> -	struct st_lsm6dsx_hw *hw = (struct st_lsm6dsx_hw *)private;
> +	struct st_lsm6dsx_hw *hw = private;
>  	int count;
>  
>  	mutex_lock(&hw->fifo_lock);
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web