Skip to contentSkip to conversation

iio: humidity: hts221_buffer: Remove unnecessary cast on void pointer

PATCH Applied simran singhal 2 participants 2 messages Apr 1, 2017 – Apr 2, 2017

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

PATCH 1/1 iio: humidity: hts221_buffer: 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/iio/humidity/hts221_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hts221_buffer.c +1 -1
index 72ddcda..7d19a3d 100644
@@ -41,7 +41,7 @@ static const struct iio_trigger_ops hts221_trigger_ops = {
 
 static irqreturn_t hts221_trigger_handler_thread(int irq, void *private)
 {
-	struct hts221_hw *hw = (struct hts221_hw *)private;
+	struct hts221_hw *hw = private;
 	u8 status;
 	int err;
 
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 18 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 1 line

I made a miinor change to the title to drop the _buffer. That's naming the exact file, whereas keeping it to the driver is fine (so just hts221).

Applied.

Thanks,

Jonathan

Quoted 18 lines
---
 drivers/iio/humidity/hts221_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/humidity/hts221_buffer.c +1 -1
index 72ddcda..7d19a3d 100644
@@ -41,7 +41,7 @@ static const struct iio_trigger_ops hts221_trigger_ops = {
 
 static irqreturn_t hts221_trigger_handler_thread(int irq, void *private)
 {
-	struct hts221_hw *hw = (struct hts221_hw *)private;
+	struct hts221_hw *hw = private;
 	u8 status;
 	int err;