* [ath6kl:pending 21/24] drivers/net/wireless/ath/ath11k/pci.c:49:34: warning: Local variable 'msi_config' shadows outer variable [shadowVariable]
@ 2020-05-12 3:11 kbuild test robot
2020-05-12 8:26 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2020-05-12 3:11 UTC (permalink / raw)
To: Govind Singh; +Cc: kbuild-all, ath10k, Kalle Valo
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git pending
head: 6303acc5b03a5fc3bf6cf5fa072ae0dc9aaa5dd0
commit: 398a800c183de17a49a5779550e72fbc3ba1e592 [21/24] ath11k: Add msi config init for QCA6390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/net/wireless/ath/ath11k/pci.c:49:34: warning: Local variable 'msi_config' shadows outer variable [shadowVariable]
const struct ath11k_msi_config *msi_config;
^
drivers/net/wireless/ath/ath11k/pci.c:23:39: note: Shadowed declaration
static const struct ath11k_msi_config msi_config = {
^
drivers/net/wireless/ath/ath11k/pci.c:49:34: note: Shadow variable
const struct ath11k_msi_config *msi_config;
^
vim +/msi_config +49 drivers/net/wireless/ath/ath11k/pci.c
45
46 static int ath11k_pci_enable_msi(struct ath11k_pci *ab_pci)
47 {
48 struct ath11k_base *ab = ab_pci->ab;
> 49 const struct ath11k_msi_config *msi_config;
50 struct msi_desc *msi_desc;
51 int num_vectors;
52 int ret;
53
54 ret = ath11k_pci_get_msi_assignment(ab_pci);
55 if (ret) {
56 ath11k_err(ab, "failed to get MSI assignment, err = %d\n", ret);
57 goto out;
58 }
59
60 msi_config = ab_pci->msi_config;
61 if (!msi_config) {
62 ath11k_err(ab, "msi_config is NULL!\n");
63 ret = -EINVAL;
64 goto out;
65 }
66
67 num_vectors = pci_alloc_irq_vectors(ab_pci->pdev,
68 msi_config->total_vectors,
69 msi_config->total_vectors,
70 PCI_IRQ_MSI);
71 if (num_vectors != msi_config->total_vectors) {
72 ath11k_err(ab, "failed to get enough MSI vectors (%d), available vectors = %d",
73 msi_config->total_vectors, num_vectors);
74 if (num_vectors >= 0)
75 ret = -EINVAL;
76 goto reset_msi_config;
77 }
78
79 msi_desc = irq_get_msi_desc(ab_pci->pdev->irq);
80 if (!msi_desc) {
81 ath11k_err(ab, "msi_desc is NULL!\n");
82 ret = -EINVAL;
83 goto free_msi_vector;
84 }
85
86 ab_pci->msi_ep_base_data = msi_desc->msg.data;
87
88 ath11k_dbg(ab, ATH11K_DBG_PCI, "msi base data is %d\n", ab_pci->msi_ep_base_data);
89
90 return 0;
91
92 free_msi_vector:
93 pci_free_irq_vectors(ab_pci->pdev);
94 reset_msi_config:
95 ab_pci->msi_config = NULL;
96 out:
97 return ret;
98 }
99
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ath6kl:pending 21/24] drivers/net/wireless/ath/ath11k/pci.c:49:34: warning: Local variable 'msi_config' shadows outer variable [shadowVariable]
2020-05-12 3:11 [ath6kl:pending 21/24] drivers/net/wireless/ath/ath11k/pci.c:49:34: warning: Local variable 'msi_config' shadows outer variable [shadowVariable] kbuild test robot
@ 2020-05-12 8:26 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-05-12 8:26 UTC (permalink / raw)
To: kbuild test robot; +Cc: Govind Singh, kbuild-all, ath11k, ath10k
+ ath11k
kbuild test robot <lkp@intel.com> writes:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git pending
> head: 6303acc5b03a5fc3bf6cf5fa072ae0dc9aaa5dd0
> commit: 398a800c183de17a49a5779550e72fbc3ba1e592 [21/24] ath11k: Add msi config init for QCA6390
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
>
>
> cppcheck warnings: (new ones prefixed by >>)
>
>>> drivers/net/wireless/ath/ath11k/pci.c:49:34: warning: Local variable 'msi_config' shadows outer variable [shadowVariable]
> const struct ath11k_msi_config *msi_config;
> ^
> drivers/net/wireless/ath/ath11k/pci.c:23:39: note: Shadowed declaration
> static const struct ath11k_msi_config msi_config = {
> ^
> drivers/net/wireless/ath/ath11k/pci.c:49:34: note: Shadow variable
> const struct ath11k_msi_config *msi_config;
I fixed this in the pending branch by changing renaming the static
variable to ath11k_msi_config:
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=76bce5bd3875bd3d8329a69057e2d63064d90b09
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-12 8:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 3:11 [ath6kl:pending 21/24] drivers/net/wireless/ath/ath11k/pci.c:49:34: warning: Local variable 'msi_config' shadows outer variable [shadowVariable] kbuild test robot
2020-05-12 8:26 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).