wimax/i2400m: remove redundant variables ack_status, bcf and protocol
authorColin Ian King <colin.king@canonical.com>
Mon, 9 Jul 2018 12:23:13 +0000 (13:23 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jul 2018 05:54:25 +0000 (22:54 -0700)
Variables ack_status, bcf and protocol are being assigned but are
never used hence they are redundant and can be removed.

Also declare ack_type as unsigned int rather than unsigned to clean
up a checkpatch warning.

Cleans up clang warnings:
warning: variable 'ack_status' set but not used [-Wunused-but-set-variable]
warning: variable 'bcf' set but not used [-Wunused-but-set-variable]
warning: variable 'protocol' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wimax/i2400m/control.c
drivers/net/wimax/i2400m/fw.c
drivers/net/wimax/i2400m/netdev.c

index 4c41790..094cea7 100644 (file)
@@ -566,13 +566,12 @@ static void i2400m_msg_ack_hook(struct i2400m *i2400m,
 {
        int result;
        struct device *dev = i2400m_dev(i2400m);
-       unsigned ack_type, ack_status;
+       unsigned int ack_type;
        char strerr[32];
 
        /* Chew on the message, we might need some information from
         * here */
        ack_type = le16_to_cpu(l3l4_hdr->type);
-       ack_status = le16_to_cpu(l3l4_hdr->status);
        switch (ack_type) {
        case I2400M_MT_CMD_ENTER_POWERSAVE:
                /* This is just left here for the sake of example, as
index a89b568..e9fc168 100644 (file)
@@ -1552,7 +1552,6 @@ int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags)
        int ret, itr;
        struct device *dev = i2400m_dev(i2400m);
        struct i2400m_fw *i2400m_fw;
-       const struct i2400m_bcf_hdr *bcf;       /* Firmware data */
        const struct firmware *fw;
        const char *fw_name;
 
@@ -1574,7 +1573,7 @@ int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags)
        }
 
        /* Load firmware files to memory. */
-       for (itr = 0, bcf = NULL, ret = -ENOENT; ; itr++) {
+       for (itr = 0, ret = -ENOENT; ; itr++) {
                fw_name = i2400m->bus_fw_names[itr];
                if (fw_name == NULL) {
                        dev_err(dev, "Could not find a usable firmware image\n");
index a654687..9ab3f0f 100644 (file)
@@ -535,14 +535,12 @@ void i2400m_net_erx(struct i2400m *i2400m, struct sk_buff *skb,
 {
        struct net_device *net_dev = i2400m->wimax_dev.net_dev;
        struct device *dev = i2400m_dev(i2400m);
-       int protocol;
 
        d_fnstart(2, dev, "(i2400m %p skb %p [%u] cs %d)\n",
                  i2400m, skb, skb->len, cs);
        switch(cs) {
        case I2400M_CS_IPV4_0:
        case I2400M_CS_IPV4:
-               protocol = ETH_P_IP;
                i2400m_rx_fake_eth_header(i2400m->wimax_dev.net_dev,
                                          skb->data - ETH_HLEN,
                                          cpu_to_be16(ETH_P_IP));