[PATCH] Staging: rtl8192e: dot11d: Fixed coding style issues
Replaced 'printk' with 'netdev_info' and 'netdev_err' wherever necessary. Also fixed the coding issue cooresponding to line gap after the declarations. Signed-off-by: Raghavendra --- drivers/staging/rtl8192e/dot11d.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index 53da610..ef9da86 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -49,6 +49,7 @@ static struct channel_list ChannelPlan[] = { void dot11d_init(struct rtllib_device *ieee) { struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee); + pDot11dInfo->bEnabled = false; pDot11dInfo->State = DOT11D_STATE_NONE; @@ -133,12 +134,12 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr, pTriple = (struct chnl_txpow_triple *)(pCoutryIe + 3); for (i = 0; i < NumTriples; i++) { if (MaxChnlNum >= pTriple->FirstChnl) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); return; } if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); return; } @@ -165,7 +166,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel) u8 MaxTxPwrInDbm = 255; if (MAX_CHANNEL_NUMBER < Channel) { - printk(KERN_INFO "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); + netdev_info(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); return MaxTxPwrInDbm; } if (pDot11dInfo->channel_map[Channel]) @@ -204,7 +205,7 @@ int ToLegalChannel(struct rtllib_device *dev, u8 channel) } if (MAX_CHANNEL_NUMBER < channel) { - printk(KERN_ERR "%s(): Invalid Channel\n", __func__); + netdev_err(dev->dev, "%s(): Invalid Channel\n", __func__); return default_chn; } -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: fix coding style issues in comedi_fops.c
>From 7bdc654b12895889a539450528b52328901e6dc0 Mon Sep 17 00:00:00 2001 From: Raghavendra Ganiga Date: Fri, 25 Apr 2014 23:11:22 +0530 Subject: [PATCH] staging: comedi: fix coding style issues in comedi_fops.c This is a patch to fix coding style warnings found by the checkpatch.pl tool Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/comedi_fops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index ea6dc36..0cd67d0 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1435,13 +1435,15 @@ static int __comedi_get_user_cmd(struct comedi_device *dev, s = &dev->subdevices[cmd->subdev]; if (s->type == COMEDI_SUBD_UNUSED) { - dev_dbg(dev->class_dev, "%d not valid subdevice\n", cmd->subdev); + dev_dbg(dev->class_dev, + "%d not valid subdevice\n", cmd->subdev); return -EIO; } if (!s->do_cmd || !s->do_cmdtest || !s->async) { dev_dbg(dev->class_dev, - "subdevice %d does not support commands\n", cmd->subdev); + "subdevice %d does not support commands\n", + cmd->subdev); return -EIO; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: fix coding style issues in comedi_fops.c
This is a patch to fix coding style warnings found by the checkpatch.pl tool Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/comedi_fops.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index acc8019..a62d639 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1435,13 +1435,15 @@ static int __comedi_get_user_cmd(struct comedi_device *dev, s = &dev->subdevices[cmd->subdev]; if (s->type == COMEDI_SUBD_UNUSED) { - dev_dbg(dev->class_dev, "%d not valid subdevice\n", cmd->subdev); + dev_dbg(dev->class_dev, "%d not valid subdevice\n", + cmd->subdev); return -EIO; } if (!s->do_cmd || !s->do_cmdtest || !s->async) { dev_dbg(dev->class_dev, - "subdevice %d does not support commands\n", cmd->subdev); + "subdevice %d does not support commands\n", + cmd->subdev); return -EIO; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: fix coding style issues in comedi_fops.c
This is a patch to fix coding style warnings found by checkpatch.pl tool Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/comedi_fops.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 70545e6..b24bf9b 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -668,6 +668,7 @@ static int do_devconfig_ioctl(struct comedi_device *dev, return -EBUSY; if (dev->attached) { struct module *driver_module = dev->driver->module; + comedi_device_detach(dev); module_put(driver_module); } @@ -2653,6 +2654,7 @@ static int __init comedi_init(void) /* create devices files for legacy/manual use */ for (i = 0; i < comedi_num_legacy_minors; i++) { struct comedi_device *dev; + dev = comedi_alloc_board_minor(NULL); if (IS_ERR(dev)) { comedi_cleanup_board_minors(); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: fixed warning shown by checkpatch tool on cb_das16_cs.c file
This is a patch to fix the warnings shown by checkpatch tool on file cb_das16_cs.c file Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/drivers/cb_das16_cs.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c index 645fcb0..eb1b92d 100644 --- a/drivers/staging/comedi/drivers/cb_das16_cs.c +++ b/drivers/staging/comedi/drivers/cb_das16_cs.c @@ -184,6 +184,7 @@ static int das16cs_ao_winsn(struct comedi_device *dev, for (bit = 15; bit >= 0; bit--) { int b = (d >> bit) & 0x1; + b <<= 1; outw(status1 | b | 0x, dev->iobase + DAS16CS_MISC1); udelay(1); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: fixed warnings reported by checkpatch tool on comedi_test.c file
This is a patch to remove warnings reported by checkpatch tool on comedi_test.c file Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/drivers/comedi_test.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index ad5014a..9896a16 100644 --- a/drivers/staging/comedi/drivers/comedi_test.c +++ b/drivers/staging/comedi/drivers/comedi_test.c @@ -188,6 +188,7 @@ static void waveform_ai_interrupt(unsigned long arg) if (cmd->stop_src == TRIG_COUNT) { unsigned int remaining = cmd->stop_arg - devpriv->ai_count; + if (num_scans >= remaining) { /* about to finish */ num_scans = remaining; @@ -198,6 +199,7 @@ static void waveform_ai_interrupt(unsigned long arg) for (i = 0; i < num_scans; i++) { for (j = 0; j < cmd->chanlist_len; j++) { unsigned short sample; + sample = fake_waveform(dev, CR_CHAN(cmd->chanlist[j]), CR_RANGE(cmd->chanlist[j]), devpriv->usec_current + -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: removing warnings reported by checkpatch tool on cb_pcimdas.c
This is a patch to remove warnings reported by checkpatch tool on cb_pcimdas.c file Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/drivers/cb_pcimdas.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c index d3141c8..50e522e 100644 --- a/drivers/staging/comedi/drivers/cb_pcimdas.c +++ b/drivers/staging/comedi/drivers/cb_pcimdas.c @@ -31,7 +31,8 @@ Configuration Options: Developed from cb_pcidas and skel by Richard Bytheway (moce...@sucs.org). Only supports DIO, AO and simple AI in it's present form. -No interrupts, multi channel or FIFO AI, although the card looks like it could support this. +No interrupts, multi channel or FIFO AI, +although the card looks like it could support this. See http://www.mccdaq.com/PDFs/Manuals/pcim-das1602-16.pdf for more details. */ @@ -128,8 +129,12 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device *dev, d = d & 0xfd; outb(d, devpriv->BADR3 + 5); } - outb(0x01, devpriv->BADR3 + 6); /* set bursting off, conversions on */ - outb(0x00, devpriv->BADR3 + 7); /* set range to 10V. UP/BP is controlled by a switch on the board */ + + /* set bursting off, conversions on */ + outb(0x01, devpriv->BADR3 + 6); + + /* set range to 10V. UP/BP is controlled by a switch on the board */ + outb(0x00, devpriv->BADR3 + 7); /* * write channel limits to multiplexer, set Low (bits 0-3) and -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: comedi: fixed warning shown by checkpatch tool on cb_das16_cs.c file
This is a patch to fix the warnings shown by checkpatch tool on file cb_das16_cs.c Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/drivers/cb_das16_cs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c index 645fcb0..eb1b92d 100644 --- a/drivers/staging/comedi/drivers/cb_das16_cs.c +++ b/drivers/staging/comedi/drivers/cb_das16_cs.c @@ -184,6 +184,7 @@ static int das16cs_ao_winsn(struct comedi_device *dev, for (bit = 15; bit >= 0; bit--) { int b = (d >> bit) & 0x1; + b <<= 1; outw(status1 | b | 0x, dev->iobase + DAS16CS_MISC1); udelay(1); -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: comedi: fixed warnings reported by checkpatch tool on comedi_test.c file
This is a patch to remove warnings reported by checkpatch tool on comedi_test.c file Signed-off-by: Raghavendra Chandra Ganiga --- drivers/staging/comedi/drivers/comedi_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index ad5014a..9896a16 100644 --- a/drivers/staging/comedi/drivers/comedi_test.c +++ b/drivers/staging/comedi/drivers/comedi_test.c @@ -188,6 +188,7 @@ static void waveform_ai_interrupt(unsigned long arg) if (cmd->stop_src == TRIG_COUNT) { unsigned int remaining = cmd->stop_arg - devpriv->ai_count; + if (num_scans >= remaining) { /* about to finish */ num_scans = remaining; @@ -198,6 +199,7 @@ static void waveform_ai_interrupt(unsigned long arg) for (i = 0; i < num_scans; i++) { for (j = 0; j < cmd->chanlist_len; j++) { unsigned short sample; + sample = fake_waveform(dev, CR_CHAN(cmd->chanlist[j]), CR_RANGE(cmd->chanlist[j]), devpriv->usec_current + -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8192e: dot11d: Fixed coding style issues
From: Raghavendra Fixed coding style issues Signed-off-by: A Raghavendra Rao --- drivers/staging/rtl8192e/dot11d.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index 53da610..ef9da86 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -49,6 +49,7 @@ static struct channel_list ChannelPlan[] = { void dot11d_init(struct rtllib_device *ieee) { struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee); + pDot11dInfo->bEnabled = false; pDot11dInfo->State = DOT11D_STATE_NONE; @@ -133,12 +134,12 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr, pTriple = (struct chnl_txpow_triple *)(pCoutryIe + 3); for (i = 0; i < NumTriples; i++) { if (MaxChnlNum >= pTriple->FirstChnl) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); return; } if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); return; } @@ -165,7 +166,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel) u8 MaxTxPwrInDbm = 255; if (MAX_CHANNEL_NUMBER < Channel) { - printk(KERN_INFO "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); + netdev_info(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); return MaxTxPwrInDbm; } if (pDot11dInfo->channel_map[Channel]) @@ -204,7 +205,7 @@ int ToLegalChannel(struct rtllib_device *dev, u8 channel) } if (MAX_CHANNEL_NUMBER < channel) { - printk(KERN_ERR "%s(): Invalid Channel\n", __func__); + netdev_err(dev->dev, "%s(): Invalid Channel\n", __func__); return default_chn; } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8192e: dot11d: Fixed printk coding style issues
Replaced 'printk' with 'netdev_' function Signed-off-by: A Raghavendra Rao --- drivers/staging/rtl8192e/dot11d.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index 53da610..ef9da86 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -49,6 +49,7 @@ static struct channel_list ChannelPlan[] = { void dot11d_init(struct rtllib_device *ieee) { struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee); + pDot11dInfo->bEnabled = false; pDot11dInfo->State = DOT11D_STATE_NONE; @@ -133,12 +134,12 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr, pTriple = (struct chnl_txpow_triple *)(pCoutryIe + 3); for (i = 0; i < NumTriples; i++) { if (MaxChnlNum >= pTriple->FirstChnl) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); return; } if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); return; } @@ -165,7 +166,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel) u8 MaxTxPwrInDbm = 255; if (MAX_CHANNEL_NUMBER < Channel) { - printk(KERN_INFO "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); + netdev_info(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); return MaxTxPwrInDbm; } if (pDot11dInfo->channel_map[Channel]) @@ -204,7 +205,7 @@ int ToLegalChannel(struct rtllib_device *dev, u8 channel) } if (MAX_CHANNEL_NUMBER < channel) { - printk(KERN_ERR "%s(): Invalid Channel\n", __func__); + netdev_err(dev->dev, "%s(): Invalid Channel\n", __func__); return default_chn; } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8192e: dot11d: Fixed printk coding style issues
Replaced 'printk' with 'netdev_' function Signed-off-by: A Raghavendra Rao --- drivers/staging/rtl8192e/dot11d.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index 53da610..bfcc935 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -133,12 +133,12 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr, pTriple = (struct chnl_txpow_triple *)(pCoutryIe + 3); for (i = 0; i < NumTriples; i++) { if (MaxChnlNum >= pTriple->FirstChnl) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it1\n"); return; } if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) { - printk(KERN_INFO "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); + netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it2\n"); return; } @@ -165,7 +165,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct rtllib_device *dev, u8 Channel) u8 MaxTxPwrInDbm = 255; if (MAX_CHANNEL_NUMBER < Channel) { - printk(KERN_INFO "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); + netdev_info(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n"); return MaxTxPwrInDbm; } if (pDot11dInfo->channel_map[Channel]) @@ -204,7 +204,7 @@ int ToLegalChannel(struct rtllib_device *dev, u8 channel) } if (MAX_CHANNEL_NUMBER < channel) { - printk(KERN_ERR "%s(): Invalid Channel\n", __func__); + netdev_err(dev->dev, "%s(): Invalid Channel\n", __func__); return default_chn; } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192u: fix sparse warnings in r8192U_core.c
Fix the following sparse warnings: drivers/staging/rtl8192u/r8192U_core.c:670:6: warning: symbol 'dump_eprom' was not declared. Should it be static? drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning: symbol 'txqueue2outpipe' was not declared. Should it be static? drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning: symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static? Signed-off-by: A Raghavendra Rao --- drivers/staging/rtl8192u/r8192U_core.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 7640386..b41b21a 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev) /* this is only for debug */ -void dump_eprom(struct net_device *dev) +static void dump_eprom(struct net_device *dev) { int i; for (i = 0; i < 63; i++) @@ -1553,7 +1553,8 @@ u16 N_DBPSOfRate(u16 DataRate) return N_DBPS; } -unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue) +static unsigned int txqueue2outpipe(struct r8192_priv *priv, + unsigned int tx_queue) { if (tx_queue >= 9) { RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__); @@ -4873,7 +4874,8 @@ static void query_rxdesc_status(struct sk_buff *skb, } -u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats *Status, bool bIsRxAggrSubframe) +static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats *Status, + bool bIsRxAggrSubframe) { #ifdef USB_RX_AGGREGATION_SUPPORT if (bIsRxAggrSubframe) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8192u: fix sparse warnings in r8192U_core.c
Fix the following sparse warnings: drivers/staging/rtl8192u/r8192U_core.c:670:6: warning: symbol 'dump_eprom' was not declared. Should it be static? drivers/staging/rtl8192u/r8192U_core.c:1556:14: warning: symbol 'txqueue2outpipe' was not declared. Should it be static? drivers/staging/rtl8192u/r8192U_core.c:4876:5: warning: symbol 'GetRxPacketShiftBytes819xUsb' was not declared. Should it be static? Signed-off-by: A Raghavendra Rao --- drivers/staging/rtl8192u/r8192U_core.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 7640386..6ad767a 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -667,12 +667,14 @@ static void tx_timeout(struct net_device *dev) /* this is only for debug */ -void dump_eprom(struct net_device *dev) +#ifdef DEBUG_EPROM +static void dump_eprom(struct net_device *dev) { int i; for (i = 0; i < 63; i++) RT_TRACE(COMP_EPROM, "EEPROM addr %x : %x", i, eprom_read(dev, i)); } +#endif void rtl8192_update_msr(struct net_device *dev) { @@ -1553,7 +1555,9 @@ u16 N_DBPSOfRate(u16 DataRate) return N_DBPS; } -unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue) +#ifndef USE_ONE_PIPE +static unsigned int txqueue2outpipe(struct r8192_priv *priv, + unsigned int tx_queue) { if (tx_queue >= 9) { RT_TRACE(COMP_ERR, "%s():Unknown queue ID!!!\n", __func__); @@ -1561,6 +1565,7 @@ unsigned int txqueue2outpipe(struct r8192_priv *priv, unsigned int tx_queue) } return priv->txqueue_to_outpipemap[tx_queue]; } +#endif short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb) { @@ -4873,17 +4878,18 @@ static void query_rxdesc_status(struct sk_buff *skb, } -u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats *Status, bool bIsRxAggrSubframe) -{ #ifdef USB_RX_AGGREGATION_SUPPORT +static u32 GetRxPacketShiftBytes819xUsb(struct ieee80211_rx_stats *Status, + bool bIsRxAggrSubframe) +{ if (bIsRxAggrSubframe) return (sizeof(rx_desc_819x_usb) + Status->RxDrvInfoSize + Status->RxBufShift + 8); else -#endif return (sizeof(rx_desc_819x_usb) + Status->RxDrvInfoSize + Status->RxBufShift); } +#endif static void rtl8192_rx_nomal(struct sk_buff *skb) { -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: wlan-ng: fix sparse warning in prism2fw.c
Fix the following sparse warning : In file included from drivers/staging/wlan-ng/prism2usb.c:5:0: drivers/staging/wlan-ng/prism2fw.c: In function ‘read_cardpda.constprop.43’: drivers/staging/wlan-ng/prism2fw.c:792:1: warning: the frame size of 1068 bytes is larger than 1024 bytes [-Wframe-larger-than=] The variable to 'struct p80211msg_p2req_readpda' was previously being created on the stack, which inturn exeeded the frame size limit, resulting in a sparse warning. This patch alloctes the memory to the structure dynamically and the operations are left unchanged. Signed-off-by: A Raghavendra Rao --- drivers/staging/wlan-ng/prism2fw.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 42c14b0..3f5f7cc 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -764,30 +764,35 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks, static int read_cardpda(struct pda *pda, wlandevice_t *wlandev) { int result = 0; - struct p80211msg_p2req_readpda msg; + struct p80211msg_p2req_readpda *msg; + + msg = kzalloc(sizeof(*msg), GFP_KERNEL); + if (!msg) + return -ENOMEM; /* set up the msg */ - msg.msgcode = DIDmsg_p2req_readpda; - msg.msglen = sizeof(msg); - strcpy(msg.devname, wlandev->name); - msg.pda.did = DIDmsg_p2req_readpda_pda; - msg.pda.len = HFA384x_PDA_LEN_MAX; - msg.pda.status = P80211ENUM_msgitem_status_no_value; - msg.resultcode.did = DIDmsg_p2req_readpda_resultcode; - msg.resultcode.len = sizeof(u32); - msg.resultcode.status = P80211ENUM_msgitem_status_no_value; - - if (prism2mgmt_readpda(wlandev, &msg) != 0) { + msg->msgcode = DIDmsg_p2req_readpda; + msg->msglen = sizeof(msg); + strcpy(msg->devname, wlandev->name); + msg->pda.did = DIDmsg_p2req_readpda_pda; + msg->pda.len = HFA384x_PDA_LEN_MAX; + msg->pda.status = P80211ENUM_msgitem_status_no_value; + msg->resultcode.did = DIDmsg_p2req_readpda_resultcode; + msg->resultcode.len = sizeof(u32); + msg->resultcode.status = P80211ENUM_msgitem_status_no_value; + + if (prism2mgmt_readpda(wlandev, msg) != 0) { /* prism2mgmt_readpda prints an errno if appropriate */ result = -1; - } else if (msg.resultcode.data == P80211ENUM_resultcode_success) { - memcpy(pda->buf, msg.pda.data, HFA384x_PDA_LEN_MAX); + } else if (msg->resultcode.data == P80211ENUM_resultcode_success) { + memcpy(pda->buf, msg->pda.data, HFA384x_PDA_LEN_MAX); result = mkpdrlist(pda); } else { /* resultcode must've been something other than success */ result = -1; } + kfree(msg); return result; } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel