greybus: loopback: drop unneeded casts for void pointers
authorAlex Elder <elder@linaro.org>
Mon, 3 Aug 2015 17:57:11 +0000 (12:57 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 4 Aug 2015 03:11:49 +0000 (20:11 -0700)
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: Alex Elder <elder@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c

index 08f77808e99d3851de0ae8a3e80c049339b602da..66059a96bb177598cddd5792a1053e2206184208 100644 (file)
@@ -84,8 +84,7 @@ static ssize_t field##_show(struct device *dev,                               \
                            char *buf)                                  \
 {                                                                      \
        struct gb_connection *connection = to_gb_connection(dev);       \
-       struct gb_loopback *gb =                                        \
-               (struct gb_loopback *)connection->private;              \
+       struct gb_loopback *gb = connection->private;                   \
        return sprintf(buf, "%"#type"\n", gb->field);                   \
 }                                                                      \
 static DEVICE_ATTR_RO(field)
@@ -96,8 +95,7 @@ static ssize_t name##_##field##_show(struct device *dev,              \
                            char *buf)                                  \
 {                                                                      \
        struct gb_connection *connection = to_gb_connection(dev);       \
-       struct gb_loopback *gb =                                        \
-               (struct gb_loopback *)connection->private;              \
+       struct gb_loopback *gb = connection->private;                   \
        return sprintf(buf, "%"#type"\n", gb->name.field);              \
 }                                                                      \
 static DEVICE_ATTR_RO(name##_##field)
@@ -113,8 +111,7 @@ static ssize_t field##_show(struct device *dev,                             \
                            char *buf)                                  \
 {                                                                      \
        struct gb_connection *connection = to_gb_connection(dev);       \
-       struct gb_loopback *gb =                                        \
-               (struct gb_loopback *)connection->private;              \
+       struct gb_loopback *gb = connection->private;                   \
        return sprintf(buf, "%"#type"\n", gb->field);                   \
 }                                                                      \
 static ssize_t field##_store(struct device *dev,                       \
@@ -124,8 +121,7 @@ static ssize_t field##_store(struct device *dev,                    \
 {                                                                      \
        int ret;                                                        \
        struct gb_connection *connection = to_gb_connection(dev);       \
-       struct gb_loopback *gb =                                        \
-               (struct gb_loopback *)connection->private;              \
+       struct gb_loopback *gb = connection->private;                   \
        mutex_lock(&gb->mutex);                                         \
        ret = sscanf(buf, "%"#type, &gb->field);                        \
        if (ret != 1)                                                   \
@@ -423,7 +419,7 @@ static int gb_loopback_fn(void *data)
 {
        int error = 0;
        int ms_wait;
-       struct gb_loopback *gb = (struct gb_loopback *)data;
+       struct gb_loopback *gb = data;
 
        while (1) {
                if (!gb->type)