Commit 3f12c3ed authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: loopback: drop unneeded casts for void pointers

There is no need to cast a void pointer to a particular type.
Drop the casts used in this way, mainly in the attribute definition
macros.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 006335a0
...@@ -84,8 +84,7 @@ static ssize_t field##_show(struct device *dev, \ ...@@ -84,8 +84,7 @@ static ssize_t field##_show(struct device *dev, \
char *buf) \ char *buf) \
{ \ { \
struct gb_connection *connection = to_gb_connection(dev); \ struct gb_connection *connection = to_gb_connection(dev); \
struct gb_loopback *gb = \ struct gb_loopback *gb = connection->private; \
(struct gb_loopback *)connection->private; \
return sprintf(buf, "%"#type"\n", gb->field); \ return sprintf(buf, "%"#type"\n", gb->field); \
} \ } \
static DEVICE_ATTR_RO(field) static DEVICE_ATTR_RO(field)
...@@ -96,8 +95,7 @@ static ssize_t name##_##field##_show(struct device *dev, \ ...@@ -96,8 +95,7 @@ static ssize_t name##_##field##_show(struct device *dev, \
char *buf) \ char *buf) \
{ \ { \
struct gb_connection *connection = to_gb_connection(dev); \ struct gb_connection *connection = to_gb_connection(dev); \
struct gb_loopback *gb = \ struct gb_loopback *gb = connection->private; \
(struct gb_loopback *)connection->private; \
return sprintf(buf, "%"#type"\n", gb->name.field); \ return sprintf(buf, "%"#type"\n", gb->name.field); \
} \ } \
static DEVICE_ATTR_RO(name##_##field) static DEVICE_ATTR_RO(name##_##field)
...@@ -113,8 +111,7 @@ static ssize_t field##_show(struct device *dev, \ ...@@ -113,8 +111,7 @@ static ssize_t field##_show(struct device *dev, \
char *buf) \ char *buf) \
{ \ { \
struct gb_connection *connection = to_gb_connection(dev); \ struct gb_connection *connection = to_gb_connection(dev); \
struct gb_loopback *gb = \ struct gb_loopback *gb = connection->private; \
(struct gb_loopback *)connection->private; \
return sprintf(buf, "%"#type"\n", gb->field); \ return sprintf(buf, "%"#type"\n", gb->field); \
} \ } \
static ssize_t field##_store(struct device *dev, \ static ssize_t field##_store(struct device *dev, \
...@@ -124,8 +121,7 @@ static ssize_t field##_store(struct device *dev, \ ...@@ -124,8 +121,7 @@ static ssize_t field##_store(struct device *dev, \
{ \ { \
int ret; \ int ret; \
struct gb_connection *connection = to_gb_connection(dev); \ struct gb_connection *connection = to_gb_connection(dev); \
struct gb_loopback *gb = \ struct gb_loopback *gb = connection->private; \
(struct gb_loopback *)connection->private; \
mutex_lock(&gb->mutex); \ mutex_lock(&gb->mutex); \
ret = sscanf(buf, "%"#type, &gb->field); \ ret = sscanf(buf, "%"#type, &gb->field); \
if (ret != 1) \ if (ret != 1) \
...@@ -423,7 +419,7 @@ static int gb_loopback_fn(void *data) ...@@ -423,7 +419,7 @@ static int gb_loopback_fn(void *data)
{ {
int error = 0; int error = 0;
int ms_wait; int ms_wait;
struct gb_loopback *gb = (struct gb_loopback *)data; struct gb_loopback *gb = data;
while (1) { while (1) {
if (!gb->type) if (!gb->type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment