[PATCH 3/3] Staging: rtl8723au: core: rtw_ieee80211: Fixed space and brace coding style issue.
Fixed the space and brace coding style error. ERROR: space required before that '=' ERROR: that open brace { should be on the previous line. Signed-off-by: Rakhi Sharma --- drivers/staging/rtl8723au/core/rtw_ieee80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index 3b0d782..0c933e4 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -65,8 +65,8 @@ static u8 WIFI_OFDMRATES[] = { int rtw_get_bit_value_from_ieee_value23a(u8 val) { - unsigned char dot11_rate_table[] = - {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; + unsigned char dot11_rate_table[] = { + 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; int i = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: Fixes unnecessary return warning
Julian Calaby writes: > Hi Bhaktipriya, > > On Sat, Jan 30, 2016 at 5:00 AM, Jes Sorensen wrote: >> Bhaktipriya Shridhar writes: >> If you insist on pushing this rather unncessary change, please do it >> properly, and remove the blank line before the return statement as well. > > As Jes said, you need to remove the blank lines before the returns > too. checkpatch should have picked this up, you did run the patch > through checkpatch before you sent it, right? > > Jes, > > I know you have strong feelings on coding style, but there are a lot > of people out there who see deviations from the standard as bugs to be > fixed, so stuff like this isn't going to stop until it matches the > coding style document's spec. Julian, rtl8723au is pretty dead development wise, so I don't care too much. checkpatch is broken and has effectively turned into a policing tool for a few people who wish to apply their narrow view onto everyone else. I'll continue top reject broken patches to my code pushed out under those rules. Maybe it's time to introduce checkpatchconsideredharmful.com Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: rtl8723au: Fixes unnecessary return warning
Bhaktipriya Shridhar writes: > This patch fixes checkpatch.pl warning in rtw_mlme_ext.c file. > WARNING: void function return statements are not generally useful > > Signed-off-by: Bhaktipriya Shridhar > --- > Changes in v2: >- Removed the unnecessary blank lines. > drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 20 > 1 file changed, 20 deletions(-) Harmless, albeit pointless, so fine with me. Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] Staging: rtl8723au: core: rtw_ieee80211: Fixed space and brace coding style issue.
Rakhi Sharma writes: > Fixed the space and brace coding style error. > ERROR: space required before that '=' > ERROR: that open brace { should be on the previous line. > > Signed-off-by: Rakhi Sharma > --- > drivers/staging/rtl8723au/core/rtw_ieee80211.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c > b/drivers/staging/rtl8723au/core/rtw_ieee80211.c > index 3b0d782..0c933e4 100644 > --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c > +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c > @@ -65,8 +65,8 @@ static u8 WIFI_OFDMRATES[] = { > > int rtw_get_bit_value_from_ieee_value23a(u8 val) > { > - unsigned char dot11_rate_table[] = > - {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; > + unsigned char dot11_rate_table[] = { > + 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; > > int i = 0; This is a great example of checkpatch doing the wrong thing. What you did here was to make the code uglier rather than better. NACK Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723au: use list_for_each_entry*()
Use list_for_each_entry*() instead of list_for_each*() to simplify the code. Fix coding style by the way. Signed-off-by: Geliang Tang --- drivers/staging/rtl8723au/core/rtw_ap.c | 166 -- drivers/staging/rtl8723au/core/rtw_mlme.c | 38 ++--- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 13 +- drivers/staging/rtl8723au/core/rtw_recv.c | 43 ++ drivers/staging/rtl8723au/core/rtw_sta_mgt.c | 34 ++--- drivers/staging/rtl8723au/core/rtw_xmit.c | 84 --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 22 +-- drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 9 +- 8 files changed, 140 insertions(+), 269 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 1aa9b26..66315f9 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -171,24 +171,20 @@ static u8 chk_sta_is_alive(struct sta_info *psta) return ret; } -void expire_timeout_chk23a(struct rtw_adapter *padapter) +void expire_timeout_chk23a(struct rtw_adapter *padapter) { - struct list_head *phead, *plist, *ptmp; + struct list_head *phead; u8 updated = 0; - struct sta_info *psta; + struct sta_info *psta, *ptmp; struct sta_priv *pstapriv = &padapter->stapriv; u8 chk_alive_num = 0; struct sta_info *chk_alive_list[NUM_STA]; int i; spin_lock_bh(&pstapriv->auth_list_lock); - phead = &pstapriv->auth_list; - /* check auth_queue */ - list_for_each_safe(plist, ptmp, phead) { - psta = container_of(plist, struct sta_info, auth_list); - + list_for_each_entry_safe(psta, ptmp, phead, auth_list) { if (psta->expire_to > 0) { psta->expire_to--; if (psta->expire_to == 0) { @@ -206,19 +202,13 @@ void expire_timeout_chk23a(struct rtw_adapter *padapter) spin_lock_bh(&pstapriv->auth_list_lock); } } - } - spin_unlock_bh(&pstapriv->auth_list_lock); spin_lock_bh(&pstapriv->asoc_list_lock); - phead = &pstapriv->asoc_list; - /* check asoc_queue */ - list_for_each_safe(plist, ptmp, phead) { - psta = container_of(plist, struct sta_info, asoc_list); - + list_for_each_entry_safe(psta, ptmp, phead, asoc_list) { if (chk_sta_is_alive(psta) || !psta->expire_to) { psta->expire_to = pstapriv->expire_to; psta->keep_alive_trycnt = 0; @@ -283,7 +273,6 @@ voidexpire_timeout_chk23a(struct rtw_adapter *padapter) } } } - spin_unlock_bh(&pstapriv->asoc_list_lock); if (chk_alive_num) { @@ -299,51 +288,55 @@ void expire_timeout_chk23a(struct rtw_adapter *padapter) SelectChannel23a(padapter, pmlmeext->cur_channel); } - /* issue null data to check sta alive */ - for (i = 0; i < chk_alive_num; i++) { + /* issue null data to check sta alive */ + for (i = 0; i < chk_alive_num; i++) { - int ret = _FAIL; + int ret = _FAIL; - psta = chk_alive_list[i]; - if (!(psta->state & _FW_LINKED)) - continue; + psta = chk_alive_list[i]; + if (!(psta->state & _FW_LINKED)) + continue; - if (psta->state & WIFI_SLEEP_STATE) - ret = issue_nulldata23a(padapter, psta->hwaddr, 0, 1, 50); - else - ret = issue_nulldata23a(padapter, psta->hwaddr, 0, 3, 50); + if (psta->state & WIFI_SLEEP_STATE) + ret = issue_nulldata23a(padapter, psta->hwaddr, + 0, 1, 50); + else + ret = issue_nulldata23a(padapter, psta->hwaddr, + 0, 3, 50); + + psta->keep_alive_trycnt++; + if (ret == _SUCCESS) { + DBG_8723A("asoc check, sta(%pM) is alive\n", + psta->hwaddr); + psta->expire_to = pstapriv->expire_to; + psta->keep_alive_trycnt = 0; + continue; + } else if (psta->keep_alive_trycnt <= 3) { + DBG_8723A("ack check for asoc expire, keep_alive_trycnt = %d\n", + psta->keep_alive_trycnt); + psta->expire_to = 1; +
[staging:staging-linus 3/4] drivers/staging/speakup/serialio.c:21:2: error: unknown field 'iomem_base' specified in initializer
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-linus head: 88867e3d0b7eea256c1cd432b0a3c7a21e8edf07 commit: 327b882d3bcc1fba82dbd39b5cf5a838c81218e2 [3/4] Staging: speakup: Fix getting port information config: mn10300-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 327b882d3bcc1fba82dbd39b5cf5a838c81218e2 # save the attached .config to linux build tree make.cross ARCH=mn10300 All error/warnings (new ones prefixed by >>): >> drivers/staging/speakup/serialio.c:21:2: error: unknown field 'iomem_base' >> specified in initializer SERIAL_PORT_DFNS ^ >> drivers/staging/speakup/serialio.c:21:2: warning: excess elements in struct >> initializer drivers/staging/speakup/serialio.c:21:2: warning: (near initialization for 'rs_table[0]') >> drivers/staging/speakup/serialio.c:21:2: error: unknown field >> 'iomem_reg_shift' specified in initializer >> drivers/staging/speakup/serialio.c:21:2: warning: excess elements in struct >> initializer drivers/staging/speakup/serialio.c:21:2: warning: (near initialization for 'rs_table[0]') >> drivers/staging/speakup/serialio.c:21:2: error: unknown field 'io_type' >> specified in initializer >> drivers/staging/speakup/serialio.c:21:2: warning: excess elements in struct >> initializer drivers/staging/speakup/serialio.c:21:2: warning: (near initialization for 'rs_table[0]') >> drivers/staging/speakup/serialio.c:21:2: error: unknown field 'iomem_base' >> specified in initializer >> drivers/staging/speakup/serialio.c:21:2: warning: excess elements in struct >> initializer drivers/staging/speakup/serialio.c:21:2: warning: (near initialization for 'rs_table[1]') >> drivers/staging/speakup/serialio.c:21:2: error: unknown field >> 'iomem_reg_shift' specified in initializer >> drivers/staging/speakup/serialio.c:21:2: warning: excess elements in struct >> initializer drivers/staging/speakup/serialio.c:21:2: warning: (near initialization for 'rs_table[1]') >> drivers/staging/speakup/serialio.c:21:2: error: unknown field 'io_type' >> specified in initializer >> drivers/staging/speakup/serialio.c:21:2: warning: excess elements in struct >> initializer drivers/staging/speakup/serialio.c:21:2: warning: (near initialization for 'rs_table[1]') vim +/iomem_base +21 drivers/staging/speakup/serialio.c 5e6dc548 Chen Gang 2013-10-31 15 #define SERIAL_PORT_DFNS 5e6dc548 Chen Gang 2013-10-31 16 #endif 5e6dc548 Chen Gang 2013-10-31 17 c6e3fd22 William Hubbs 2010-10-07 18 static void start_serial_interrupt(int irq); c6e3fd22 William Hubbs 2010-10-07 19 3ee0017e Jiri Slaby2012-03-05 20 static const struct old_serial_port rs_table[] = { c6e3fd22 William Hubbs 2010-10-07 @21 SERIAL_PORT_DFNS c6e3fd22 William Hubbs 2010-10-07 22 }; 3ee0017e Jiri Slaby2012-03-05 23 static const struct old_serial_port *serstate; c6e3fd22 William Hubbs 2010-10-07 24 static int timeouts; :: The code at line 21 was first introduced by commit :: c6e3fd22cd538365bfeb82997d5b89562e077d42 Staging: add speakup to the staging directory :: TO: William Hubbs :: CC: Greg Kroah-Hartman --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: use list_for_each_entry*()
Geliang Tang writes: > Use list_for_each_entry*() instead of list_for_each*() to simplify > the code. Fix coding style by the way. > > Signed-off-by: Geliang Tang > --- > drivers/staging/rtl8723au/core/rtw_ap.c | 166 > -- > drivers/staging/rtl8723au/core/rtw_mlme.c | 38 ++--- > drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 13 +- > drivers/staging/rtl8723au/core/rtw_recv.c | 43 ++ > drivers/staging/rtl8723au/core/rtw_sta_mgt.c | 34 ++--- > drivers/staging/rtl8723au/core/rtw_xmit.c | 84 --- > drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 22 +-- > drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 9 +- > 8 files changed, 140 insertions(+), 269 deletions(-) In principle this is fine, but you need to stick to doing one thing per patch. Do the list_for_each_entry() in one patch, and the formatting issues in another. Jes > diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c > b/drivers/staging/rtl8723au/core/rtw_ap.c > index 1aa9b26..66315f9 100644 > --- a/drivers/staging/rtl8723au/core/rtw_ap.c > +++ b/drivers/staging/rtl8723au/core/rtw_ap.c > @@ -171,24 +171,20 @@ static u8 chk_sta_is_alive(struct sta_info *psta) > return ret; > } > > -void expire_timeout_chk23a(struct rtw_adapter *padapter) > +void expire_timeout_chk23a(struct rtw_adapter *padapter) > { > - struct list_head *phead, *plist, *ptmp; > + struct list_head *phead; > u8 updated = 0; > - struct sta_info *psta; > + struct sta_info *psta, *ptmp; > struct sta_priv *pstapriv = &padapter->stapriv; > u8 chk_alive_num = 0; > struct sta_info *chk_alive_list[NUM_STA]; > int i; > > spin_lock_bh(&pstapriv->auth_list_lock); > - > phead = &pstapriv->auth_list; > - > /* check auth_queue */ > - list_for_each_safe(plist, ptmp, phead) { > - psta = container_of(plist, struct sta_info, auth_list); > - > + list_for_each_entry_safe(psta, ptmp, phead, auth_list) { > if (psta->expire_to > 0) { > psta->expire_to--; > if (psta->expire_to == 0) { > @@ -206,19 +202,13 @@ voidexpire_timeout_chk23a(struct rtw_adapter > *padapter) > spin_lock_bh(&pstapriv->auth_list_lock); > } > } > - > } > - > spin_unlock_bh(&pstapriv->auth_list_lock); > > spin_lock_bh(&pstapriv->asoc_list_lock); > - > phead = &pstapriv->asoc_list; > - > /* check asoc_queue */ > - list_for_each_safe(plist, ptmp, phead) { > - psta = container_of(plist, struct sta_info, asoc_list); > - > + list_for_each_entry_safe(psta, ptmp, phead, asoc_list) { > if (chk_sta_is_alive(psta) || !psta->expire_to) { > psta->expire_to = pstapriv->expire_to; > psta->keep_alive_trycnt = 0; > @@ -283,7 +273,6 @@ void expire_timeout_chk23a(struct rtw_adapter > *padapter) > } > } > } > - > spin_unlock_bh(&pstapriv->asoc_list_lock); > > if (chk_alive_num) { > @@ -299,51 +288,55 @@ voidexpire_timeout_chk23a(struct rtw_adapter > *padapter) > SelectChannel23a(padapter, pmlmeext->cur_channel); > } > > - /* issue null data to check sta alive */ > - for (i = 0; i < chk_alive_num; i++) { > + /* issue null data to check sta alive */ > + for (i = 0; i < chk_alive_num; i++) { > > - int ret = _FAIL; > + int ret = _FAIL; > > - psta = chk_alive_list[i]; > - if (!(psta->state & _FW_LINKED)) > - continue; > + psta = chk_alive_list[i]; > + if (!(psta->state & _FW_LINKED)) > + continue; > > - if (psta->state & WIFI_SLEEP_STATE) > - ret = issue_nulldata23a(padapter, psta->hwaddr, 0, 1, > 50); > - else > - ret = issue_nulldata23a(padapter, psta->hwaddr, 0, 3, > 50); > + if (psta->state & WIFI_SLEEP_STATE) > + ret = issue_nulldata23a(padapter, psta->hwaddr, > + 0, 1, 50); > + else > + ret = issue_nulldata23a(padapter, psta->hwaddr, > + 0, 3, 50); > + > + psta->keep_alive_trycnt++; > + if (ret == _SUCCESS) { > + DBG_8723A("asoc check, sta(%pM) is alive\n", > + psta->hwaddr); > + psta->expire_to = pstapriv->expire_to; > + psta->keep_alive_trycnt = 0; > + continue; > + } else if (
[GIT PULL] Staging driver fixes for 4.5-rc2
The following changes since commit 9f9499ae8e6415cefc4fe0a96ad0e27864353c89: Linux 4.4-rc5 (2015-12-13 17:42:58 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ tags/staging-4.5-rc2 for you to fetch changes up to 88867e3d0b7eea256c1cd432b0a3c7a21e8edf07: Staging: speakup: fix read scrolled-back VT (2016-01-28 22:55:40 -0800) Staging fixes for 4.5-rc2 Here are some small staging driver fixes for 4.5-rc2. One of them predated 4.4-final, but I missed that merge window due to the holliday. The others fix reported issues that have come up recently. The tty change is needed for the speakup driver fix and has the ack of the tty driver maintainer as well, i.e. myself :) All have been in linux-next with no reported issues. Signed-off-by: Greg Kroah-Hartman Greg Kroah-Hartman (1): Merge tag 'iio-fixes-for-4.4c' of git://git.kernel.org/.../jic23/iio into staging-linus Lars-Peter Clausen (1): iio: adis_buffer: Fix out-of-bounds memory access Samuel Thibault (2): Staging: speakup: Fix getting port information Staging: speakup: fix read scrolled-back VT Sudip Mukherjee (1): Revert "Staging: panel: usleep_range is preferred over udelay" drivers/iio/imu/adis_buffer.c | 2 +- drivers/staging/panel/panel.c | 34 +++--- drivers/staging/speakup/main.c | 21 + drivers/staging/speakup/serialio.c | 13 - drivers/tty/vt/vt.c| 1 + 5 files changed, 42 insertions(+), 29 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: gs_fpgaboot: fixed coding style issues in gs_fpgaboot.c
Signed-off-by: Ben Marsh --- drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index a3a10f9..f29a75d 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -9,9 +9,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include @@ -34,7 +31,7 @@ #define DEVICE_NAME "device" #define CLASS_NAME "fpgaboot" -static uint8_t bits_magic[] = { +static u8 bits_magic[] = { 0x0, 0x9, 0xf, 0xf0, 0xf, 0xf0, 0xf, 0xf0, 0xf, 0xf0, 0x0, 0x0, 0x1}; @@ -54,7 +51,7 @@ static void read_bitstream(char *bitdata, char *buf, int *offset, int rdsize) static void readinfo_bitstream(char *bitdata, char *buf, int *offset) { char tbuf[64]; - int32_t len; + s32 len; /* read section char */ read_bitstream(bitdata, tbuf, offset, 1); @@ -93,7 +90,6 @@ static int readlength_bitstream(char *bitdata, int *lendata, int *offset) return 0; } - /* * read first 13 bytes to check bitstream magic number */ @@ -201,7 +197,7 @@ static int gs_download_image(struct fpgaimage *fimage, enum wbus bus_bytes) #endif /* DEBUG_FPGA */ if (!xl_supported_prog_bus_width(bus_bytes)) { pr_err("unsupported program bus width %d\n", - bus_bytes); + bus_bytes); return -1; } @@ -222,7 +218,7 @@ static int gs_download_image(struct fpgaimage *fimage, enum wbus bus_bytes) pr_info("device init done\n"); for (i = 0; i < size; i += bus_bytes) - xl_shift_bytes_out(bus_bytes, bitdata+i); + xl_shift_bytes_out(bus_bytes, bitdata + i); pr_info("program done\n"); @@ -277,7 +273,7 @@ static int gs_set_download_method(struct fpgaimage *fimage) static int init_driver(void) { firmware_pdev = platform_device_register_simple("fpgaboot", -1, -NULL, 0); + NULL, 0); return PTR_ERR_OR_ZERO(firmware_pdev); } @@ -291,7 +287,7 @@ static int gs_fpgaboot(void) int err; struct fpgaimage*fimage; - fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL); + fimage = kmalloc(sizeof(*fimage), GFP_KERNEL); if (!fimage) return -ENOMEM; @@ -336,7 +332,6 @@ err_out1: kfree(fimage); return -1; - } static int __init gs_fpgaboot_init(void) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] Staging: rtl8723au: core: rtw_ieee80211: Fixed space and brace coding style issue.
On Sun, 2016-01-31 at 09:36 -0500, Jes Sorensen wrote: > Rakhi Sharma writes: > > Fixed the space and brace coding style error. > > ERROR: space required before that '=' > > ERROR: that open brace { should be on the previous line. > > > > Signed-off-by: Rakhi Sharma > > --- > > drivers/staging/rtl8723au/core/rtw_ieee80211.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c > > b/drivers/staging/rtl8723au/core/rtw_ieee80211.c > > index 3b0d782..0c933e4 100644 > > --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c > > +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c > > @@ -65,8 +65,8 @@ static u8 WIFI_OFDMRATES[] = { > > > > int rtw_get_bit_value_from_ieee_value23a(u8 val) > > { > > - unsigned char dot11_rate_table[] = > > - {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; > > + unsigned char dot11_rate_table[] = { > > + 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; > > > > int i = 0; > > This is a great example of checkpatch doing the wrong thing. What you > did here was to make the code uglier rather than better. > > NACK Here's the original code: int rtw_get_bit_value_from_ieee_value23a(u8 val) { unsigned char dot11_rate_table[]= {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; int i = 0; while (dot11_rate_table[i] != 0) { if (dot11_rate_table[i] == val) return BIT(i); i++; } return 0; } It has several nominal style defects: o compares different types (unsigned char to u8) o uses a while loop and test of a known sized array o array isn't declared static const o array initialization is different style from others in the same file. "type foo[] = { bar, baz };" o the function argument is tested on the right side tested on left side is more common. So this could be transformed into something like: int rtw_get_bit_value_from_ieee_value23a(u8 val) { int i; static const u8 dot11_rate_table[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; for (i = 0; i < ARRAY_SIZE(dot11_rate_table); i++) { if (val == dot11_rate_table[i]) return BIT(i); } return 0; } Rakhi, do please strive to make the code "better" rather than merely shut up checkpatch. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/7] staging: wilc1000: wilc_msgqueue.c: removes debug print log
This patches removes unnecessary debug print logs. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_msgqueue.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 098390c..5c09cab 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -59,15 +59,11 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle, unsigned long flags; Message *pstrMessage = NULL; - if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) { - PRINT_ER("pHandle or pvSendBuffer is null\n"); + if (!pHandle || (u32SendBufferSize == 0) || !pvSendBuffer) return -EFAULT; - } - if (pHandle->bExiting) { - PRINT_ER("pHandle fail\n"); + if (pHandle->bExiting) return -EFAULT; - } /* construct a new message */ pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC); @@ -117,16 +113,12 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, Message *pstrMessage; unsigned long flags; - if ((!pHandle) || (u32RecvBufferSize == 0) - || (!pvRecvBuffer) || (!pu32ReceivedLength)) { - PRINT_ER("pHandle or pvRecvBuffer is null\n"); + if (!pHandle || (u32RecvBufferSize == 0) || !pvRecvBuffer || + !pu32ReceivedLength) return -EINVAL; - } - if (pHandle->bExiting) { - PRINT_ER("pHandle fail\n"); + if (pHandle->bExiting) return -EFAULT; - } spin_lock_irqsave(&pHandle->strCriticalSection, flags); pHandle->u32ReceiversCount++; @@ -134,24 +126,20 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle, down(&pHandle->hSem); - if (pHandle->bExiting) { - PRINT_ER("pHandle fail\n"); + if (pHandle->bExiting) return -EFAULT; - } spin_lock_irqsave(&pHandle->strCriticalSection, flags); pstrMessage = pHandle->pstrMessageList; if (!pstrMessage) { spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); - PRINT_ER("pstrMessage is null\n"); return -EFAULT; } /* check buffer size */ if (u32RecvBufferSize < pstrMessage->u32Length) { spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); up(&pHandle->hSem); - PRINT_ER("u32RecvBufferSize overflow\n"); return -EOVERFLOW; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err
This patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 86 --- 1 file changed, 31 insertions(+), 55 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index ccfd26a..8e15534 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -405,10 +405,8 @@ static void CfgScanResult(enum scan_event scan_event, if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && (((s32)network_info->s8rssi * 100) < 0 || - ((s32)network_info->s8rssi * 100) > 100)) { - PRINT_ER("wiphy signal type fial\n"); + ((s32)network_info->s8rssi * 100) > 100)) return; - } if (network_info) { s32Freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ); @@ -436,10 +434,6 @@ static void CfgScanResult(enum scan_event scan_event, (size_t)network_info->u16IEsLen, (((s32)network_info->s8rssi) * 100), GFP_KERNEL); cfg80211_put_bss(wiphy, bss); } - - - } else { - PRINT_ER("Discovered networks exceeded the max limit\n"); } } else { u32 i; @@ -531,7 +525,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, if (!pstrWFIDrv->p2p_connect) wlan_channel = INVALID_CHANNEL; - PRINT_ER("Unspecified failure: Connection status %d : MAC status = %d\n", u16ConnectStatus, u8MacStatus); + netdev_err(dev, "Unspecified failure\n"); } if (u16ConnectStatus == WLAN_STATUS_SUCCESS) { @@ -572,8 +566,6 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, u16ConnectStatus, GFP_KERNEL); } else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF){ wilc_optaining_ip = false; - PRINT_ER("Received MAC_DISCONNECTED from firmware with reason %d on dev [%p]\n", -pstrDisconnectNotifInfo->u16reason, priv->dev); p2p_local_random = 0x01; p2p_recv_random = 0x00; wilc_ie = false; @@ -612,7 +604,7 @@ static int set_channel(struct wiphy *wiphy, result = wilc_set_mac_chnl_num(vif, channelnum); if (result != 0) - PRINT_ER("Error in setting channel %d\n", channelnum); + netdev_err(priv->dev, "Error in setting channel\n"); return result; } @@ -680,8 +672,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) (void *)priv, NULL); } } else { - PRINT_ER("Requested num of scanned channels is greater than the max, supported" -" channels\n"); + netdev_err(priv->dev, "Requested scanned channels over\n"); } if (s32Error != 0) { @@ -843,7 +834,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, } else { s32Error = -ENOTSUPP; - PRINT_ER("Not supported cipher: Error(%d)\n", s32Error); + netdev_err(dev, "Not supported cipher\n"); wilc_connecting = 0; return s32Error; } @@ -909,7 +900,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, pstrNetworkInfo->u8channel, pstrNetworkInfo->pJoinParams); if (s32Error != 0) { - PRINT_ER("wilc_set_join_req(): Error(%d)\n", s32Error); + netdev_err(dev, "wilc_set_join_req(): Error\n"); s32Error = -ENOENT; wilc_connecting = 0; return s32Error; @@ -944,7 +935,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co s32Error = wilc_disconnect(vif, reason_code); if (s32Error != 0) { - PRINT_ER("Error in disconnecting: Error(%d)\n", s32Error); + netdev_err(priv->dev, "Error in disconnecting\n"); s32Error = -EINVAL; } @@ -1211,7 +1202,7 @@ static int add_key(str
[PATCH 5/7] staging: wilc1000: remove unused log message using the CORECONFIG_DBG tag
From: Chris Park This patch remove unused log messages using the CORECONFIG_DBG tag Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 1 - drivers/staging/wilc1000/linux_wlan_common.h | 2 -- drivers/staging/wilc1000/wilc_debugfs.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 20 +--- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index a0b80bf..11e3ce0 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -315,7 +315,6 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) rx_len = wid_len - 1; network_info->u16CapInfo = get_cap_info(msa); network_info->u32Tsf = get_beacon_timestamp_lo(msa); - PRINT_D(CORECONFIG_DBG, "TSF :%x\n", network_info->u32Tsf); tsf_lo = get_beacon_timestamp_lo(msa); tsf_hi = get_beacon_timestamp_hi(msa); diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h index 5d40f05..5e1d3ad 100644 --- a/drivers/staging/wilc1000/linux_wlan_common.h +++ b/drivers/staging/wilc1000/linux_wlan_common.h @@ -6,7 +6,6 @@ enum debug_region { Hostapd_debug, Hostinf_debug, CFG80211_debug, - Coreconfig_debug, Interrupt_debug, TX_debug, RX_debug, @@ -24,7 +23,6 @@ enum debug_region { #define GENERIC_DBG (1 << Generic_debug) #define HOSTAPD_DBG (1 << Hostapd_debug) #define HOSTINF_DBG (1 << Hostinf_debug) -#define CORECONFIG_DBG (1 << Coreconfig_debug) #define CFG80211_DBG(1 << CFG80211_debug) #define INT_DBG (1 << Interrupt_debug) #define TX_DBG (1 << TX_debug) diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index 27c653a..8d665d9 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -24,7 +24,7 @@ static struct dentry *wilc_dir; * */ -#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | HOSTINF_DBG | CORECONFIG_DBG | CFG80211_DBG | INT_DBG | TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) +#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | HOSTINF_DBG | CFG80211_DBG | INT_DBG | TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) #define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR) atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG); EXPORT_SYMBOL_GPL(WILC_REGION); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 8e15534..07e50ccb 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -192,7 +192,6 @@ static void clear_shadow_scan(void) if (op_ifcs == 0) { del_timer_sync(&hAgingTimer); - PRINT_INFO(CORECONFIG_DBG, "destroy aging timer\n"); for (i = 0; i < last_scanned_cnt; i++) { if (last_scanned_shadow[last_scanned_cnt].pu8IEs) { @@ -424,8 +423,6 @@ static void CfgScanResult(enum scan_event scan_event, PRINT_D(CFG80211_DBG, "Network %s found\n", network_info->au8ssid); priv->u32RcvdChCount++; - if (!join_params) - PRINT_INFO(CORECONFIG_DBG, ">> Something really bad happened\n"); add_network_to_shadow(network_info, priv, join_params); if (!(memcmp("DIRECT-", network_info->au8ssid, 7))) { @@ -762,24 +759,14 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, PRINT_INFO(CFG80211_DBG, "sme->crypto.n_ciphers_pairwise=%d\n", sme->crypto.n_ciphers_pairwise); - if (INFO) { - for (i = 0; i < sme->crypto.n_ciphers_pairwise; i++) - PRINT_D(CORECONFIG_DBG, "sme->crypto.ciphers_pairwise[%d]=%x\n", i, sme->crypto.ciphers_pairwise[i]); - } - if (sme->crypto.cipher_group != NO_ENCRYPT) { pcwpa_version = "Default"; - PRINT_D(CORECONFIG_DBG, ">> sme->crypto.wpa_versions: %x\n", sme->crypto.wpa_versions); if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) { u8security = ENCRYPT_ENABLED | WEP; pcgroup_encrypt_val = "WEP40"; pccipher_group = "WLAN_CIPHER_SUITE_WEP40";
[PATCH 6/7] staging: wilc1000: remove unused log message using the HOSTINF_DBG tag
From: Chris Park This patch remove unused log message using the HOSTINF_DBG tag Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/host_interface.c | 198 +- drivers/staging/wilc1000/linux_wlan_common.h | 2 - drivers/staging/wilc1000/wilc_debugfs.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 - 4 files changed, 10 insertions(+), 194 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index ad54db2..e6a6a03 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -309,8 +309,6 @@ static s32 handle_set_channel(struct wilc_vif *vif, wid.val = (char *)&hif_set_ch->set_ch; wid.size = sizeof(char); - PRINT_D(HOSTINF_DBG, "Setting channel\n"); - result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); @@ -386,9 +384,6 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx) if (ip_addr[0] < 192) ip_addr[0] = 0; - PRINT_INFO(HOSTINF_DBG, "Indx = %d, Handling set IP = %pI4\n", - idx, ip_addr); - memcpy(set_ip[idx], ip_addr, IP_ALEN); wid.id = (u16)WID_IP_ADDRESS; @@ -406,8 +401,6 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx) return -EINVAL; } - PRINT_INFO(HOSTINF_DBG, "IP address set\n"); - return result; } @@ -424,8 +417,6 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx) result = wilc_send_config_pkt(vif, GET_CFG, &wid, 1, wilc_get_vif_idx(vif)); - PRINT_INFO(HOSTINF_DBG, "%pI4\n", wid.val); - memcpy(get_ip[idx], wid.val, IP_ALEN); kfree(wid.val); @@ -438,10 +429,6 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx) return -EINVAL; } - PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = %d\n", idx); - PRINT_INFO(HOSTINF_DBG, "%pI4\n", get_ip[idx]); - PRINT_INFO(HOSTINF_DBG, "\n"); - return result; } @@ -508,8 +495,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif, down(&hif_drv->sem_cfg_values); - PRINT_D(HOSTINF_DBG, "Setting CFG params\n"); - if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) { if (cfg_param_attr->cfg_attr_info.bss_type < 6) { wid_list[wid_cnt].id = WID_BSS_TYPE; @@ -814,9 +799,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, u8 *pu8HdnNtwrksWidVal = NULL; struct host_if_drv *hif_drv = vif->hif_drv; - PRINT_D(HOSTINF_DBG, "Setting SCAN params\n"); - PRINT_D(HOSTINF_DBG, "Scanning: In [%d] state\n", hif_drv->hif_state); - hif_drv->usr_scan_req.scan_result = pstrHostIFscanAttr->result; hif_drv->usr_scan_req.arg = pstrHostIFscanAttr->arg; @@ -836,8 +818,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, goto ERRORHANDLER; } - PRINT_D(HOSTINF_DBG, "Setting SCAN params\n"); - hif_drv->usr_scan_req.rcvd_ch_cnt = 0; strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ; @@ -852,8 +832,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.u8ssidnum; - PRINT_D(HOSTINF_DBG, "In Handle_ProbeRequest number of ssid %d\n", pstrHostIFscanAttr->hidden_network.u8ssidnum); - for (i = 0; i < pstrHostIFscanAttr->hidden_network.u8ssidnum; i++) { *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo[i].u8ssidlen; memcpy(pu8Buffer, pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo[i].pu8ssid, pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo[i].u8ssidlen); @@ -912,8 +890,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, if (result) PRINT_ER("Failed to send scan paramters config packet\n"); - else - PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config packet\n"); ERRORHANDLER: if (result) { @@ -942,8 +918,6 @@ static s32 Handle_ScanDone(struct wilc_vif *vif, struct wid wid; struct host_if_drv *hif_drv = vif->hif_drv; - PRINT_D(HOSTINF_DBG, "in Handle_ScanDone()\n"); - if (enuEvent == SCAN_EVENT_ABORTED) { PRINT_D(GENERIC_DBG, "Abort running scan\n"); u8abort_running_scan = 1; @@ -994,8 +968,6 @@ static s32 Handle_Connect(struct wilc_vif *vif, return result; } - PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n"); - ptstrJoinBssParam = (struct join_bss_param *)pstrHostIFconnectAttr->params; if (!ptstrJoinBssParam) { PRINT_ER("Required BSSID not f
[PATCH 7/7] staging: wilc1000: remove unused log message using the TX_DBG tag
From: Chris Park This patch remove unused log message using the TX_DBG tag Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/linux_wlan.c| 4 drivers/staging/wilc1000/linux_wlan_common.h | 2 -- drivers/staging/wilc1000/wilc_debugfs.c | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 9 +++-- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 9e5dea4..202be15 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1047,10 +1047,6 @@ static void linux_wlan_tx_complete(void *priv, int status) { struct tx_complete_data *pv_data = (struct tx_complete_data *)priv; - if (status == 1) - PRINT_D(TX_DBG, "Packet sent successfully - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb); - else - PRINT_D(TX_DBG, "Couldn't send packet - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb); dev_kfree_skb(pv_data->skb); kfree(pv_data); } diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h index 5374f36..617bc53 100644 --- a/drivers/staging/wilc1000/linux_wlan_common.h +++ b/drivers/staging/wilc1000/linux_wlan_common.h @@ -6,7 +6,6 @@ enum debug_region { Hostapd_debug, CFG80211_debug, Interrupt_debug, - TX_debug, RX_debug, Lock_debug, Tcp_enhance, @@ -23,7 +22,6 @@ enum debug_region { #define HOSTAPD_DBG (1 << Hostapd_debug) #define CFG80211_DBG(1 << CFG80211_debug) #define INT_DBG (1 << Interrupt_debug) -#define TX_DBG (1 << TX_debug) #define RX_DBG (1 << RX_debug) #define LOCK_DBG(1 << Lock_debug) #define TCP_ENH (1 << Tcp_enhance) diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index 1e38d1b..fd0e58f 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -24,7 +24,7 @@ static struct dentry *wilc_dir; * */ -#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INT_DBG | TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) +#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | CFG80211_DBG | INT_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) #define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR) atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG); EXPORT_SYMBOL_GPL(WILC_REGION); diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c19ae00..01c5857 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -652,13 +652,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) } } while (1); - if (i == 0) { - PRINT_D(TX_DBG, "Nothing in TX-Q\n"); + if (i == 0) break; - } else { - PRINT_D(TX_DBG, "Mark the last entry in VMM table - number of previous entries = %d\n", i); + else vmm_table[i] = 0x0; - } + acquire_bus(wilc, ACQUIRE_AND_WAKEUP); counter = 0; do { @@ -807,7 +805,6 @@ _end_: up(&wilc->txq_add_to_head_cs); wilc->txq_exit = 1; - PRINT_D(TX_DBG, "THREAD: Exiting txq\n"); *txq_count = wilc->txq_entries; return ret; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/7] staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err
This patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/linux_mon.c | 38 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index e550027..99f4ba3b 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -169,24 +169,18 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) { struct tx_complete_mon_data *mgmt_tx = NULL; - if (dev == NULL) { - PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n"); + if (!dev) return -EFAULT; - } netif_stop_queue(dev); mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC); - if (mgmt_tx == NULL) { - PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); + if (!mgmt_tx) return -EFAULT; - } mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); - if (mgmt_tx->buff == NULL) { - PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); + if (!mgmt_tx->buff) { kfree(mgmt_tx); return -EFAULT; - } mgmt_tx->size = len; @@ -221,18 +215,13 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, return -EFAULT; mon_priv = netdev_priv(wilc_wfi_mon); - - if (mon_priv == NULL) { - PRINT_ER("Monitor interface private structure is NULL\n"); + if (!mon_priv) return -EFAULT; - } - rtap_len = ieee80211_get_radiotap_len(skb->data); - if (skb->len < rtap_len) { - PRINT_ER("Error in radiotap header\n"); + if (skb->len < rtap_len) return -1; - } + /* skip the radiotap header */ PRINT_INFO(HOSTAPD_DBG, "Radiotap len: %d\n", rtap_len); @@ -292,7 +281,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, /* if source address and bssid fields are equal>>Mac header */ /*send it to mgmt frames handler */ if (!(memcmp(srcAdd, bssid, 6))) { - mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); + ret = mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); + if (ret) + netdev_err(dev, "fail to mgmt tx\n"); dev_kfree_skb(skb); } else ret = wilc_mac_xmit(skb, mon_priv->real_ndev); @@ -327,12 +318,9 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi } wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv)); - if (!wilc_wfi_mon) { - PRINT_ER("failed to allocate memory\n"); + if (!wilc_wfi_mon) return NULL; - } - wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(wilc_wfi_mon->name, name, IFNAMSIZ); wilc_wfi_mon->name[IFNAMSIZ - 1] = 0; @@ -340,14 +328,12 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi ret = register_netdevice(wilc_wfi_mon); if (ret) { - PRINT_ER(" register_netdevice failed (%d)\n", ret); + netdev_err(real_dev, "register_netdevice failed\n"); return NULL; } priv = netdev_priv(wilc_wfi_mon); - if (priv == NULL) { - PRINT_ER("private structure is NULL\n"); + if (!priv) return NULL; - } priv->real_ndev = real_dev; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] staging: wilc1000: wilc_wlan.c: replaces PRINT_ER with netdev_err
This patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 1efd61a..c19ae00 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1496,7 +1496,6 @@ int wilc_wlan_init(struct net_device *dev) if (!wilc->tx_buffer) { ret = -ENOBUFS; - PRINT_ER("Can't allocate Tx Buffer"); goto _fail_; } @@ -1505,7 +1504,6 @@ int wilc_wlan_init(struct net_device *dev) if (!wilc->rx_buffer) { ret = -ENOBUFS; - PRINT_ER("Can't allocate Rx Buffer"); goto _fail_; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: fbtft: Use monotonic clock
Wall time obtained from getnstimeofday is susceptible to sudden jumps due to user setting the time or due to NTP. Monotonic time is constantly increasing time better suited for comparing two timestamps Signed-off-by: Abhilash Jindal --- drivers/staging/fbtft/fbtft-core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 53b748b..af1817a 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -372,7 +372,7 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned start_line, if (unlikely(par->debug & (DEBUG_TIME_FIRST_UPDATE | DEBUG_TIME_EACH_UPDATE))) { if ((par->debug & DEBUG_TIME_EACH_UPDATE) || ((par->debug & DEBUG_TIME_FIRST_UPDATE) && !par->first_update_done)) { - getnstimeofday(&ts_start); + ktime_get_ts(&ts_start); timeit = true; } } @@ -409,7 +409,7 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned start_line, __func__); if (unlikely(timeit)) { - getnstimeofday(&ts_end); + ktime_get_ts(&ts_end); if (par->update_time.tv_nsec == 0 && par->update_time.tv_sec == 0) { par->update_time.tv_sec = ts_start.tv_sec; par->update_time.tv_nsec = ts_start.tv_nsec; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lirc_parallel.c: Use monotonic clock
Wall time obtained from do_gettimeofday is susceptible to sudden jumps due to user setting the time or due to NTP. Monotonic time is constantly increasing time better suited for comparing two timestamps. Signed-off-by: Abhilash Jindal --- drivers/staging/media/lirc/lirc_parallel.c | 42 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_parallel.c b/drivers/staging/media/lirc/lirc_parallel.c index c140834..de2ec2e 100644 --- a/drivers/staging/media/lirc/lirc_parallel.c +++ b/drivers/staging/media/lirc/lirc_parallel.c @@ -144,33 +144,29 @@ static void lirc_off(void) static unsigned int init_lirc_timer(void) { - struct timeval tv, now; - unsigned int level, newlevel, timeelapsed, newtimer; + ktime_t tm, now; + unsigned int elapsedus, level, newlevel, newtimer; int count = 0; - do_gettimeofday(&tv); - tv.tv_sec++; /* wait max. 1 sec. */ + tm = ktime_get(); level = lirc_get_timer(); do { newlevel = lirc_get_timer(); if (level == 0 && newlevel != 0) count++; level = newlevel; - do_gettimeofday(&now); - } while (count < 1000 && (now.tv_sec < tv.tv_sec -|| (now.tv_sec == tv.tv_sec -&& now.tv_usec < tv.tv_usec))); - - timeelapsed = (now.tv_sec + 1 - tv.tv_sec)*100 -+ (now.tv_usec - tv.tv_usec); - if (count >= 1000 && timeelapsed > 0) { + now = ktime_get(); + elapsedus = ktime_us_delta(now, tm); + } while (count < 1000 && elapsedus < 100);/* wait max. 1 sec. */ + + if (count >= 1000 && elapsedus > 0) { if (default_timer == 0) { /* autodetect timer */ - newtimer = (100*count)/timeelapsed; + newtimer = (100*count)/elapsedus; pr_info("%u Hz timer detected\n", newtimer); return newtimer; } - newtimer = (100*count)/timeelapsed; + newtimer = (100*count)/elapsedus; if (abs(newtimer - default_timer) > default_timer/10) { /* bad timer */ pr_notice("bad timer: %u Hz\n", newtimer); @@ -220,10 +216,10 @@ static void rbuf_write(int signal) static void lirc_lirc_irq_handler(void *blah) { - struct timeval tv; - static struct timeval lasttv; + ktime_t tm; + static ktime_t lasttm; static int init; - long signal; + long signal, elapsedus; int data; unsigned int level, newlevel; unsigned int timeout; @@ -244,16 +240,14 @@ static void lirc_lirc_irq_handler(void *blah) #ifdef LIRC_TIMER if (init) { - do_gettimeofday(&tv); - - signal = tv.tv_sec - lasttv.tv_sec; + tm = ktime_get(); + elapsedus = ktime_us_delta(tm, lasttm); + signal = elapsedus/USEC_PER_SEC; if (signal > 15) /* really long time */ data = PULSE_MASK; else - data = (int) (signal*100 + -tv.tv_usec - lasttv.tv_usec + -LIRC_SFH506_DELAY); + data = (int) (elapsedus + LIRC_SFH506_DELAY); rbuf_write(data); /* space */ } else { @@ -301,7 +295,7 @@ static void lirc_lirc_irq_handler(void *blah) data = 1; rbuf_write(PULSE_BIT|data); /* pulse */ } - do_gettimeofday(&lasttv); + lasttm = ktime_get(); #else /* add your code here */ #endif -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192u: Fix block comments use * on subsequent lines in r8192U_wx.c
clean up checkpatch warning: WARNING: Block comments use * on subsequent lines Signed-off-by: Byeoungwook Kim --- drivers/staging/rtl8192u/r8192U_wx.c | 38 +++- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index 4911fef..f828e64 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -1,21 +1,23 @@ -/* - This file contains wireless extension handlers. - - This is part of rtl8180 OpenSource driver. - Copyright (C) Andrea Merello 2004-2005 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part - of the official realtek driver. - - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon. - - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. - - We want to thank the Authors of those projects and the Ndiswrapper - project Authors. -*/ +/** + * + * This file contains wireless extension handlers. + * + * This is part of rtl8180 OpenSource driver. + * Copyright (C) Andrea Merello 2004-2005 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part + * of the official realtek driver. + * + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon. + * + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. + * + * We want to thank the Authors of those projects and the Ndiswrapper + * project Authors. + * + */ #include #include "r8192U.h" -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192u: Fix block comments use * on subsequent lines in r8192U_wx.c
clean up checkpatch warning: WARNING: Block comments use * on subsequent lines Signed-off-by: Byeoungwook Kim --- drivers/staging/rtl8192u/r8192U_wx.c | 38 +++- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index 4911fef..f828e64 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -1,21 +1,23 @@ -/* - This file contains wireless extension handlers. - - This is part of rtl8180 OpenSource driver. - Copyright (C) Andrea Merello 2004-2005 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part - of the official realtek driver. - - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon. - - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. - - We want to thank the Authors of those projects and the Ndiswrapper - project Authors. -*/ +/** + * + * This file contains wireless extension handlers. + * + * This is part of rtl8180 OpenSource driver. + * Copyright (C) Andrea Merello 2004-2005 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part + * of the official realtek driver. + * + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon. + * + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. + * + * We want to thank the Authors of those projects and the Ndiswrapper + * project Authors. + * + */ #include #include "r8192U.h" -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192u: Fix block comments use * on subsequent lines in r8192U_wx.c
clean up checkpatch warning: WARNING: Block comments use * on subsequent lines Signed-off-by: Byeoungwook Kim --- drivers/staging/rtl8192u/r8192U_wx.c | 38 +++- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index 4911fef..f828e64 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -1,21 +1,23 @@ -/* - This file contains wireless extension handlers. - - This is part of rtl8180 OpenSource driver. - Copyright (C) Andrea Merello 2004-2005 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part - of the official realtek driver. - - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon. - - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. - - We want to thank the Authors of those projects and the Ndiswrapper - project Authors. -*/ +/** + * + * This file contains wireless extension handlers. + * + * This is part of rtl8180 OpenSource driver. + * Copyright (C) Andrea Merello 2004-2005 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part + * of the official realtek driver. + * + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon. + * + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. + * + * We want to thank the Authors of those projects and the Ndiswrapper + * project Authors. + * + */ #include #include "r8192U.h" -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] android: binder: Sanity check at binder ioctl
Sanity check at binder ioctl function, Only allow the shared mm_struct to use the same binder-object to do binder operate. And add proc->vma_vm_mm = current->mm at the open function. The libbinder do ioctl before mmap called. V2: Fix compile error for error commit V3: Change the condition to proc->vma_vm_mm Signed-off-by: Chen Feng Signed-off-by: Wei Dong Signed-off-by: Junmin Zhao Reviewed-by: Zhuangluan Su --- drivers/android/binder.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index a39e85f..f080a8b 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2737,6 +2737,10 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/ + if (unlikely(current->mm != proc->vma_vm_mm)) { + pr_err("current mm mismatch proc mm\n"); + return -EINVAL; + } trace_binder_ioctl(cmd, arg); ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2); @@ -2951,6 +2955,7 @@ static int binder_open(struct inode *nodp, struct file *filp) return -ENOMEM; get_task_struct(current); proc->tsk = current; + proc->vma_vm_mm = current->mm; INIT_LIST_HEAD(&proc->todo); init_waitqueue_head(&proc->wait); proc->default_priority = task_nice(current); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: Fix block comments use * on subsequent lines in r8192U_wx.c
On Mon, 1 Feb 2016, Byeoungwook Kim wrote: > clean up checkpatch warning: > WARNING: Block comments use * on subsequent lines > > Signed-off-by: Byeoungwook Kim > --- > drivers/staging/rtl8192u/r8192U_wx.c | 38 > +++- > 1 file changed, 20 insertions(+), 18 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r8192U_wx.c > b/drivers/staging/rtl8192u/r8192U_wx.c > index 4911fef..f828e64 100644 > --- a/drivers/staging/rtl8192u/r8192U_wx.c > +++ b/drivers/staging/rtl8192u/r8192U_wx.c > @@ -1,21 +1,23 @@ > -/* > - This file contains wireless extension handlers. > - > - This is part of rtl8180 OpenSource driver. > - Copyright (C) Andrea Merello 2004-2005 > - Released under the terms of GPL (General Public Licence) > - > - Parts of this driver are based on the GPL part > - of the official realtek driver. > - > - Parts of this driver are based on the rtl8180 driver skeleton > - from Patric Schenke & Andres Salomon. > - > - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. > - > - We want to thank the Authors of those projects and the Ndiswrapper > - project Authors. > -*/ > +/** Is the row of *s needed? julia > + * > + * This file contains wireless extension handlers. > + * > + * This is part of rtl8180 OpenSource driver. > + * Copyright (C) Andrea Merello 2004-2005 > + * Released under the terms of GPL (General Public Licence) > + * > + * Parts of this driver are based on the GPL part > + * of the official realtek driver. > + * > + * Parts of this driver are based on the rtl8180 driver skeleton > + * from Patric Schenke & Andres Salomon. > + * > + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. > + * > + * We want to thank the Authors of those projects and the Ndiswrapper > + * project Authors. > + * > + > */ > > #include > #include "r8192U.h" > -- > 2.5.0 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: Fix block comments use * on subsequent lines in r8192U_wx.c
The current realtek driver was written like my patch comments. but Documentation/CodingStyle isn't before. So I wrote patch like current realtek driver. How should i do it? Regards, Byeoungwook. 2016-02-01 16:01 GMT+09:00 Julia Lawall : > > > On Mon, 1 Feb 2016, Byeoungwook Kim wrote: > >> clean up checkpatch warning: >> WARNING: Block comments use * on subsequent lines >> >> Signed-off-by: Byeoungwook Kim >> --- >> drivers/staging/rtl8192u/r8192U_wx.c | 38 >> +++- >> 1 file changed, 20 insertions(+), 18 deletions(-) >> >> diff --git a/drivers/staging/rtl8192u/r8192U_wx.c >> b/drivers/staging/rtl8192u/r8192U_wx.c >> index 4911fef..f828e64 100644 >> --- a/drivers/staging/rtl8192u/r8192U_wx.c >> +++ b/drivers/staging/rtl8192u/r8192U_wx.c >> @@ -1,21 +1,23 @@ >> -/* >> - This file contains wireless extension handlers. >> - >> - This is part of rtl8180 OpenSource driver. >> - Copyright (C) Andrea Merello 2004-2005 >> - Released under the terms of GPL (General Public Licence) >> - >> - Parts of this driver are based on the GPL part >> - of the official realtek driver. >> - >> - Parts of this driver are based on the rtl8180 driver skeleton >> - from Patric Schenke & Andres Salomon. >> - >> - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. >> - >> - We want to thank the Authors of those projects and the Ndiswrapper >> - project Authors. >> -*/ >> +/** > > Is the row of *s needed? > > julia > >> + * >> + * This file contains wireless extension handlers. >> + * >> + * This is part of rtl8180 OpenSource driver. >> + * Copyright (C) Andrea Merello 2004-2005 >> + * Released under the terms of GPL (General Public Licence) >> + * >> + * Parts of this driver are based on the GPL part >> + * of the official realtek driver. >> + * >> + * Parts of this driver are based on the rtl8180 driver skeleton >> + * from Patric Schenke & Andres Salomon. >> + * >> + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. >> + * >> + * We want to thank the Authors of those projects and the Ndiswrapper >> + * project Authors. >> + * >> + >> */ >> >> #include >> #include "r8192U.h" >> -- >> 2.5.0 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: Fix block comments use * on subsequent lines in r8192U_wx.c
On Mon, 1 Feb 2016, ByeoungWook Kim wrote: > The current realtek driver was written like my patch comments. but > Documentation/CodingStyle isn't before. > So I wrote patch like current realtek driver. That is probably fine, then. Sorry for the noise. I looked at some other code in the kernel, and it didn't have it. julia > > How should i do it? > > Regards, > Byeoungwook. > > 2016-02-01 16:01 GMT+09:00 Julia Lawall : > > > > > > On Mon, 1 Feb 2016, Byeoungwook Kim wrote: > > > >> clean up checkpatch warning: > >> WARNING: Block comments use * on subsequent lines > >> > >> Signed-off-by: Byeoungwook Kim > >> --- > >> drivers/staging/rtl8192u/r8192U_wx.c | 38 > >> +++- > >> 1 file changed, 20 insertions(+), 18 deletions(-) > >> > >> diff --git a/drivers/staging/rtl8192u/r8192U_wx.c > >> b/drivers/staging/rtl8192u/r8192U_wx.c > >> index 4911fef..f828e64 100644 > >> --- a/drivers/staging/rtl8192u/r8192U_wx.c > >> +++ b/drivers/staging/rtl8192u/r8192U_wx.c > >> @@ -1,21 +1,23 @@ > >> -/* > >> - This file contains wireless extension handlers. > >> - > >> - This is part of rtl8180 OpenSource driver. > >> - Copyright (C) Andrea Merello 2004-2005 > >> - Released under the terms of GPL (General Public Licence) > >> - > >> - Parts of this driver are based on the GPL part > >> - of the official realtek driver. > >> - > >> - Parts of this driver are based on the rtl8180 driver skeleton > >> - from Patric Schenke & Andres Salomon. > >> - > >> - Parts of this driver are based on the Intel Pro Wireless 2100 GPL > >> driver. > >> - > >> - We want to thank the Authors of those projects and the Ndiswrapper > >> - project Authors. > >> -*/ > >> +/** > > > > Is the row of *s needed? > > > > julia > > > >> + * > >> + * This file contains wireless extension handlers. > >> + * > >> + * This is part of rtl8180 OpenSource driver. > >> + * Copyright (C) Andrea Merello 2004-2005 > >> + * Released under the terms of GPL (General Public Licence) > >> + * > >> + * Parts of this driver are based on the GPL part > >> + * of the official realtek driver. > >> + * > >> + * Parts of this driver are based on the rtl8180 driver skeleton > >> + * from Patric Schenke & Andres Salomon. > >> + * > >> + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL > >> driver. > >> + * > >> + * We want to thank the Authors of those projects and the Ndiswrapper > >> + * project Authors. > >> + * > >> + > >> */ > >> > >> #include > >> #include "r8192U.h" > >> -- > >> 2.5.0 > >> > >> -- > >> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" > >> in > >> the body of a message to majord...@vger.kernel.org > >> More majordomo info at http://vger.kernel.org/majordomo-info.html > >> > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCHv3 1/1] staging/ion: Add support to get ion handle from dma buf
Kindly review the patch. Patchv2 had refcount issue which is fixed here. On Tue, 12 Jan 2016 09:31:46 +0530 Rohit kumar wrote: > Currently we can only import dma buf fd's to get ion_handle. > Adding support to import dma buf handles to support kernel > specific use cases. > > An example use case is in linux platforms such as Tizen, in which > DRM-GEM is used for buffer management for graphics. It has gem_handle > corresponding to a buffer and uses gem_name for sharing the buffer > with other processes. However,it also uses dma_buf fd for 3d > operations. For wayland, there are multiple calls for gem_handle to > dma_buf fd conversion. So, we store dma_buf associated with buffer. > But, there is no api for getting ion_handle from dma_buf. This patch > exposes api to retrieve the ion handle from dma_buf for similar use > cases. With this patch, we can integrate ION within DRM-GEM for > buffer management and dma_buf sharing. > > Signed-off-by: Rohit kumar > --- > v2: Updated commit message with use case explanation, as suggested by > Laura Abbott > v3: Fixed dmabuf refcount issue in ion_import_dma_buf. dma_buf_put() > was being called without dma_buf_get(), so moving it to > ion_import_dma_buf_fd(). > > drivers/staging/android/ion/ion.c | 26 ++ > drivers/staging/android/ion/ion.h | 20 > 2 files changed, 34 insertions(+), 12 deletions(-) > > diff --git a/drivers/staging/android/ion/ion.c > b/drivers/staging/android/ion/ion.c index e237e9f..7e86e18 100644 > --- a/drivers/staging/android/ion/ion.c > +++ b/drivers/staging/android/ion/ion.c > @@ -1151,22 +1151,18 @@ int ion_share_dma_buf_fd(struct ion_client > *client, struct ion_handle *handle) } > EXPORT_SYMBOL(ion_share_dma_buf_fd); > > -struct ion_handle *ion_import_dma_buf(struct ion_client *client, int > fd) +struct ion_handle *ion_import_dma_buf(struct ion_client *client, > + struct dma_buf *dmabuf) > { > - struct dma_buf *dmabuf; > struct ion_buffer *buffer; > struct ion_handle *handle; > int ret; > > - dmabuf = dma_buf_get(fd); > - if (IS_ERR(dmabuf)) > - return ERR_CAST(dmabuf); > /* if this memory came from ion */ > > if (dmabuf->ops != &dma_buf_ops) { > pr_err("%s: can not import dmabuf from another > exporter\n", __func__); > - dma_buf_put(dmabuf); > return ERR_PTR(-EINVAL); > } > buffer = dmabuf->priv; > @@ -1194,11 +1190,25 @@ struct ion_handle *ion_import_dma_buf(struct > ion_client *client, int fd) } > > end: > - dma_buf_put(dmabuf); > return handle; > } > EXPORT_SYMBOL(ion_import_dma_buf); > > +struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, > int fd) +{ > + struct dma_buf *dmabuf; > + struct ion_handle *handle; > + > + dmabuf = dma_buf_get(fd); > + if (IS_ERR(dmabuf)) > + return ERR_CAST(dmabuf); > + > + handle = ion_import_dma_buf(client, dmabuf); > + dma_buf_put(dmabuf); > + return handle; > +} > +EXPORT_SYMBOL(ion_import_dma_buf_fd); > + > static int ion_sync_for_device(struct ion_client *client, int fd) > { > struct dma_buf *dmabuf; > @@ -1306,7 +1316,7 @@ static long ion_ioctl(struct file *filp, > unsigned int cmd, unsigned long arg) { > struct ion_handle *handle; > > - handle = ion_import_dma_buf(client, data.fd.fd); > + handle = ion_import_dma_buf_fd(client, data.fd.fd); > if (IS_ERR(handle)) > ret = PTR_ERR(handle); > else > diff --git a/drivers/staging/android/ion/ion.h > b/drivers/staging/android/ion/ion.h index b860c5f..a1331fc 100644 > --- a/drivers/staging/android/ion/ion.h > +++ b/drivers/staging/android/ion/ion.h > @@ -192,14 +192,26 @@ struct dma_buf *ion_share_dma_buf(struct > ion_client *client, int ion_share_dma_buf_fd(struct ion_client > *client, struct ion_handle *handle); > /** > - * ion_import_dma_buf() - given an dma-buf fd from the ion exporter > get handle > + * ion_import_dma_buf() - get ion_handle from dma-buf > + * @client: the client > + * @dmabuf: the dma-buf > + * > + * Get the ion_buffer associated with the dma-buf and return the > ion_handle. > + * If no ion_handle exists for this buffer, return newly created > ion_handle. > + * If dma-buf from another exporter is passed, return > ERR_PTR(-EINVAL) > + */ > +struct ion_handle *ion_import_dma_buf(struct ion_client *client, > + struct dma_buf *dmabuf); > + > +/** > + * ion_import_dma_buf_fd() - given a dma-buf fd from the ion > exporter get handle > * @client: the client > * @fd: the dma-buf fd > * > - * Given an dma-buf fd that was allocated through ion via > ion_share_dma_buf, > - * import that fd and return a handle representing it. If a dma-buf > from > + * Given an dma-buf fd that was allocated through ion via > ion