diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-04-24 08:02:34 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-06-01 08:16:33 -0400 |
commit | 37291fc61253cd34db40b7a60be4497db776db41 (patch) | |
tree | ebde9b83d383d21ffe6fc6d7fb50f26cd507a16f /drivers/net/wireless/ath/ath6kl | |
parent | 8c40e4e0e158aca76c657533ae57fa3e33655778 (diff) |
ath6kl: Unify sg_sz and buf_sz in ath6kl_sdio_alloc_prep_scat_req()
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>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/sdio.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index fb141454c6d2..7126bdd4236c 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c | |||
@@ -345,17 +345,17 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio, | |||
345 | { | 345 | { |
346 | struct hif_scatter_req *s_req; | 346 | struct hif_scatter_req *s_req; |
347 | struct bus_request *bus_req; | 347 | struct bus_request *bus_req; |
348 | int i, scat_req_sz, scat_list_sz, sg_sz, buf_sz; | 348 | int i, scat_req_sz, scat_list_sz, size; |
349 | u8 *virt_buf; | 349 | u8 *virt_buf; |
350 | 350 | ||
351 | scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item); | 351 | scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item); |
352 | scat_req_sz = sizeof(*s_req) + scat_list_sz; | 352 | scat_req_sz = sizeof(*s_req) + scat_list_sz; |
353 | 353 | ||
354 | if (!virt_scat) | 354 | if (!virt_scat) |
355 | sg_sz = sizeof(struct scatterlist) * n_scat_entry; | 355 | size = sizeof(struct scatterlist) * n_scat_entry; |
356 | else | 356 | else |
357 | buf_sz = 2 * L1_CACHE_BYTES + | 357 | size = 2 * L1_CACHE_BYTES + |
358 | ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER; | 358 | ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER; |
359 | 359 | ||
360 | for (i = 0; i < n_scat_req; i++) { | 360 | for (i = 0; i < n_scat_req; i++) { |
361 | /* allocate the scatter request */ | 361 | /* allocate the scatter request */ |
@@ -364,7 +364,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio, | |||
364 | return -ENOMEM; | 364 | return -ENOMEM; |
365 | 365 | ||
366 | if (virt_scat) { | 366 | if (virt_scat) { |
367 | virt_buf = kzalloc(buf_sz, GFP_KERNEL); | 367 | virt_buf = kzalloc(size, GFP_KERNEL); |
368 | if (!virt_buf) { | 368 | if (!virt_buf) { |
369 | kfree(s_req); | 369 | kfree(s_req); |
370 | return -ENOMEM; | 370 | return -ENOMEM; |
@@ -374,7 +374,7 @@ static int ath6kl_sdio_alloc_prep_scat_req(struct ath6kl_sdio *ar_sdio, | |||
374 | (u8 *)L1_CACHE_ALIGN((unsigned long)virt_buf); | 374 | (u8 *)L1_CACHE_ALIGN((unsigned long)virt_buf); |
375 | } else { | 375 | } else { |
376 | /* allocate sglist */ | 376 | /* allocate sglist */ |
377 | s_req->sgentries = kzalloc(sg_sz, GFP_KERNEL); | 377 | s_req->sgentries = kzalloc(size, GFP_KERNEL); |
378 | 378 | ||
379 | if (!s_req->sgentries) { | 379 | if (!s_req->sgentries) { |
380 | kfree(s_req); | 380 | kfree(s_req); |