ath10k: remove unnecessary 'out of memory' message
PATCH 1/2 ath10k: remove unnecessary 'out of memory' message
Fixes checkpatch warning:
drivers/net/wireless/ath/ath10k/swap.c:110: Possible unnecessary 'out of memory' message
--- drivers/net/wireless/ath/ath10k/swap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/swap.c +1 -3
@@ -106,10 +106,8 @@ ath10k_swap_code_seg_alloc(struct ath10k *ar, size_t swap_bin_len) virt_addr =dma_alloc_coherent (ar->dev, swap_bin_len, &paddr,GFP_KERNEL ); -if (!virt_addr) { -ath10k_err (ar,"failed to allocate dma coherent memory\n" ); +if (!virt_addr)return NULL ; - } seg_info->seg_hw_info.bus_addr[0 ] =__cpu_to_le32 (paddr); seg_info->seg_hw_info.size =__cpu_to_le32 (swap_bin_len);
Signature · 7 lines
2.7.4 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH 2/2 ath10k: pci: remove unnecessary casts
Fixes checkpatch warnings:
drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/madrivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/m
While at it, also remove unnecessary initialisation of data_buf variable in both cases.
--- drivers/net/wireless/ath/ath10k/pci.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +6 -10
@@ -909,7 +909,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,/* Host buffer address in CE space */ u32 ce_data;dma_addr_t ce_data_base =0 ; -void *data_buf =NULL ; +void *data_buf;int i;mutex_lock (&ar_pci->ce_diag_mutex);
@@ -923,10 +923,8 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,*/ alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT); - data_buf = (unsigned char *)dma_alloc_coherent (ar->dev, alloc_nbytes, - &ce_data_base, -GFP_ATOMIC ); - + data_buf =dma_alloc_coherent (ar->dev, alloc_nbytes, &ce_data_base, +GFP_ATOMIC );if (!data_buf) { ret = -ENOMEM ; goto done;
@@ -1054,7 +1052,7 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,u32 *buf;unsigned int completed_nbytes, alloc_nbytes, remaining_bytes;struct ath10k_ce_pipe *ce_diag; -void *data_buf =NULL ; +void *data_buf;dma_addr_t ce_data_base =0 ;int i;
@@ -1069,10 +1067,8 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,*/ alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT); - data_buf = (unsigned char *)dma_alloc_coherent (ar->dev, - alloc_nbytes, - &ce_data_base, -GFP_ATOMIC ); + data_buf =dma_alloc_coherent (ar->dev, alloc_nbytes, &ce_data_base, +GFP_ATOMIC );if (!data_buf) { ret = -ENOMEM ; goto done;
Signature · 7 lines
2.7.4 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH 2/2] ath10k: pci: remove unnecessary casts
Quoted 4 lines · Kalle Valo
Fixes checkpatch warnings:
drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/madrivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/m
I think you cut off the link there, did you mean
http://c-faq.com/malloc/mallocnocast.html perhaps?
johannes
Re: [PATCH 2/2] ath10k: pci: remove unnecessary casts
Quoted 8 lines · Johannes Berg
Quoted 4 lines · Kalle Valo
Fixes checkpatch warnings:
drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/madrivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/mI think you cut off the link there, did you mean
http://c-faq.com/malloc/mallocnocast.html perhaps?
Which I should've read before replying ... WHAT? We consider calling undeclared functions an *error* in the kernel, this is quite pointless.
johannes
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH 2/2] ath10k: pci: remove unnecessary casts
Quoted 11 lines · Johannes Berg
Quoted 10 lines · Johannes Berg
Quoted 6 lines · Kalle Valo
Fixes checkpatch warnings:
drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/madrivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/mI think you cut off the link there, did you mean
http://c-faq.com/malloc/mallocnocast.html perhaps?
Yes, thanks. Fixed now in the pending branch.
Quoted 2 lines
Which I should've read before replying ... WHAT? We consider calling undeclared functions an *error* in the kernel, this is quite pointless.
Yeah, the link checkpatch provides is pointless. TBH I didn't even read it until you commented on it :) But the patch is still good to have as there's no point of use casting on void pointers, it's just extra cruft. Right?
Signature · 6 lines
Kalle Valo _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 5 lines · Kalle Valo
Fixes checkpatch warning:
drivers/net/wireless/ath/ath10k/swap.c:110: Possible unnecessary 'out of memory' messageSigned-off-by Kalle Valo <[email protected]>
2 patches applied to ath-next branch of ath.git, thanks.
2189135437d0 ath10k: remove unnecessary 'out of memory' message d44c732cffe5 ath10k: pci: remove unnecessary casts
Signature · 3 lines
https://patchwork.kernel.org/patch/11020277/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 5 lines · Kalle Valo
Fixes checkpatch warning:
drivers/net/wireless/ath/ath10k/swap.c:110: Possible unnecessary 'out of memory' messageSigned-off-by Kalle Valo <[email protected]>
2 patches applied to ath-next branch of ath.git, thanks.
2189135437d0 ath10k: remove unnecessary 'out of memory' message d44c732cffe5 ath10k: pci: remove unnecessary casts
Signature · 9 lines
https://patchwork.kernel.org/patch/11020277/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k