ath6kl: Unify sg_sz and buf_sz in ath6kl_sdio_alloc_prep_scat_req()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 24 Apr 2013 12:02:34 +0000 (14:02 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Sat, 1 Jun 2013 12:16:33 +0000 (15:16 +0300)
sg_sz and buf_sz are initialized and used in a mutual exclusive way.
However, some versions of gcc are not smart enough to see this:

drivers/net/wireless/ath/ath6kl/sdio.c: In function ‘ath6kl_sdio_alloc_prep_scat_req’:
drivers/net/wireless/ath/ath6kl/sdio.c:338: warning: ‘sg_sz’ may be used uninitialized in this function

Unify the sg_sz and buf_sz variables into a single size variable to kill
the compiler warning.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/sdio.c

index fb141454c6d2f3c9de1d82135aeace81b69276fd..7126bdd4236c2b1e78dd3a9d2c600dbadbb53f0e 100644 (file)
@@ -345,17 +345,17 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio,
 {
        struct hif_scatter_req *s_req;
        struct bus_request *bus_req;
-       int i, scat_req_sz, scat_list_sz, sg_sz, buf_sz;
+       int i, scat_req_sz, scat_list_sz, size;
        u8 *virt_buf;
 
        scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item);
        scat_req_sz = sizeof(*s_req) + scat_list_sz;
 
        if (!virt_scat)
-               sg_sz = sizeof(struct scatterlist) * n_scat_entry;
+               size = sizeof(struct scatterlist) * n_scat_entry;
        else
-               buf_sz =  2 * L1_CACHE_BYTES +
-                         ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER;
+               size =  2 * L1_CACHE_BYTES +
+                       ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER;
 
        for (i = 0; i < n_scat_req; i++) {
                /* allocate the scatter request */
@@ -364,7 +364,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio,
                        return -ENOMEM;
 
                if (virt_scat) {
-                       virt_buf = kzalloc(buf_sz, GFP_KERNEL);
+                       virt_buf = kzalloc(size, GFP_KERNEL);
                        if (!virt_buf) {
                                kfree(s_req);
                                return -ENOMEM;
@@ -374,7 +374,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio,
                                (u8 *)L1_CACHE_ALIGN((unsigned long)virt_buf);
                } else {
                        /* allocate sglist */
-                       s_req->sgentries = kzalloc(sg_sz, GFP_KERNEL);
+                       s_req->sgentries = kzalloc(size, GFP_KERNEL);
 
                        if (!s_req->sgentries) {
                                kfree(s_req);