bcma: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP
Subsystems (4)
PATCH 87/176 bcma: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP
In reply to a message not in the archiveBugzilla: 757944
Brew: <https://brewweb.devel.redhat.com/taskinfo?taskID=5738553>
Upstream Status: ccd609538e99d3465a8d498f3655098f44cd253b
Tested: By me. Acceptable. See BZ for details
This will fix warnings like following when CONFIG_PM_SLEEP is not set:
warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]
Because
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).
--- drivers/bcma/host_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/bcma/host_pci.c +3 -3
@@ -238,7 +238,7 @@ static void __devexit bcma_host_pci_remove(struct pci_dev *dev)pci_set_drvdata (dev,NULL ); } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int bcma_host_pci_suspend (struct device *dev) {struct pci_dev *pdev =to_pci_dev (dev);
@@ -261,11 +261,11 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend, bcma_host_pci_resume);#define BCMA_PM_OPS (&bcma_pm_ops) -#else /* CONFIG_PM */ +#else /* CONFIG_PM_SLEEP */ #define BCMA_PM_OPS NULL -#endif /* CONFIG_PM */ +#endif /* CONFIG_PM_SLEEP */ static DEFINE_PCI_DEVICE_TABLE (bcma_pci_bridge_tbl) = { {PCI_DEVICE (PCI_VENDOR_ID_BROADCOM ,0x0576 ) },
Signature · 1 line
1.7.11.7
PATCH 170/176 brcmsmac: avoid 512 byte stack variable
In reply to a message not in the archiveBugzilla: 757944
Brew: <https://brewweb.devel.redhat.com/taskinfo?taskID=5738553>
Upstream Status: 0d61c9177cb9bf48dcec9c3d9205a309085d4318
Tested: By me. Acceptable. See BZ for details
Dynamically allocate the probe response template which avoids potential stack corruption. Observed with smatch:
drivers/net/wireless/brcm80211/brcmsmac/main.c:7412 brcms_c_bss_update_probe_resp()
warn: 'prb_resp' puts 512 bytes on stack
--- drivers/net/wireless/brcm80211/brcmsmac/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmsmac/main.c +7 -1
@@ -7398,9 +7398,13 @@ brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc, struct brcms_bss_cfg *cfg, bool suspend) { -u16 prb_resp[BCN_TMPL_LEN /2 ]; +u16 *prb_resp;int len =BCN_TMPL_LEN ; + prb_resp =kmalloc (BCN_TMPL_LEN ,GFP_ATOMIC ); +if (!prb_resp) +return ; +/* * write the probe response to hardware, or save in * the config structure
@@ -7434,6 +7438,8 @@ brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,if (suspend)brcms_c_enable_mac (wlc); + +kfree (prb_resp); }void brcms_c_update_probe_resp (struct brcms_c_info *wlc,bool suspend)
Signature · 1 line
1.7.11.7
PATCH 169/176 brcmsmac: fix u16 overflow warning
In reply to a message not in the archiveBugzilla: 757944
Brew: <https://brewweb.devel.redhat.com/taskinfo?taskID=5738553>
Upstream Status: 708eb54f20334470ad92042547db0fef0cd60462
Tested: By me. Acceptable. See BZ for details
DOT11_MIN_BEACON_PERIOD and DOT11_MAX_BEACON_PERIOD are superfluous. The only invalid beacon period is 0. Comparing a 16 bit quantity to 0xffff also causes a compile warning:
drivers/net/wireless/brcm80211/brcmsmac/main.c:5560 brcms_c_set_beacon_period()
warn: impossible condition '(period > 65535) => (0-65535 > 65535)'
Observed from smatch analysis.
--- drivers/net/wireless/brcm80211/brcmsmac/main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/main.c +1 -4
@@ -101,8 +101,6 @@#define DOT11_RTS_LEN 16#define DOT11_CTS_LEN 10#define DOT11_BA_BITMAP_LEN 128 -#define DOT11_MIN_BEACON_PERIOD 1 -#define DOT11_MAX_BEACON_PERIOD 0xFFFF#define DOT11_MAXNUMFRAGS 16#define DOT11_MAX_FRAG_LEN 2346
@@ -5548,8 +5546,7 @@ int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs)int brcms_c_set_beacon_period (struct brcms_c_info *wlc,u16 period) { -if (period <DOT11_MIN_BEACON_PERIOD || - period >DOT11_MAX_BEACON_PERIOD ) +if (period ==0 )return -EINVAL ; wlc->default_bss->beacon_period = period;
Signature · 1 line
1.7.11.7