[PATCH] staging: wlan-ng: use netdev_() instead of printk()

2014-05-17 Thread Vitaly Osipov
Replaced all uses of printk() in wlan-ng with netdev_err / _warn where a netdev exists. If a few cases where a netdev does not yet exist, dev_ or pr_ was used. Checkpatch complains about lines over 80 chars or split string constants - the messages are just too long, keeping it completely happy w

[PATCH] staging: rtl8723au: rtw_sta_mgt: change rtw_alloc_stainfo23a to use gfp_t instead if int

2014-05-17 Thread Karim Raslan
This should fix a few sparse warnings like the following: CHECK drivers/staging/rtl8723au/core/rtw_ap.c drivers/staging/rtl8723au/core/rtw_ap.c:1054:45: warning: incorrect type in argument 3 (different base types) drivers/staging/rtl8723au/core/rtw_ap.c:1054:45:expected int [signed] gfp d

Re: [PATCH 1/2] staging: slicoss: rewrite eeprom checksum code

2014-05-17 Thread David Matlack
On Sat, May 17, 2014 at 9:12 PM, Joe Perches wrote: > On Sat, 2014-05-17 at 21:00 -0700, David Matlack wrote: > [] >> diff --git a/drivers/staging/slicoss/slicoss.c >> b/drivers/staging/slicoss/slicoss.c > [] >> +static inline u16 __reduce(u32 checksum) >> +{ >> + u16 lower_16 = checksum & 0x

Re: [PATCH 1/2] staging: slicoss: rewrite eeprom checksum code

2014-05-17 Thread Joe Perches
On Sat, 2014-05-17 at 21:00 -0700, David Matlack wrote: [] > diff --git a/drivers/staging/slicoss/slicoss.c > b/drivers/staging/slicoss/slicoss.c [] > +static inline u16 __reduce(u32 checksum) > +{ > + u16 lower_16 = checksum & 0x; > + u16 upper_16 = (checksum >> 16) & 0x; > + > +

[PATCH 1/2] staging: slicoss: rewrite eeprom checksum code

2014-05-17 Thread David Matlack
Rewrite slic_eeprom_cksum() to fix bugs and make readable. The original implementation had the following issues: 1. 2 of the 3 unrolled loops had the following bug: while ((len -= 32) >= 0) { [...] sum += w[15]; w = (u16 *)((ulong) w + 16);

[PATCH 2/2] staging: slicoss: remove slic_reg_params struct

2014-05-17 Thread David Matlack
Remove uninitialized struct that is only used to regulate whether incorrect eeprom checksums are ignored. Signed-off-by: David Matlack --- drivers/staging/slicoss/slic.h| 7 --- drivers/staging/slicoss/slicoss.c | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drive

[PATCH 0/2] staging: slicoss: cleanup checksum computation

2014-05-17 Thread David Matlack
This patchset fixes a broken checksum function and removes a struct that was being used to ignore bad checksum values. David Matlack (2): staging: slicoss: rewrite eeprom checksum code staging: slicoss: remove slic_reg_params struct drivers/staging/slicoss/slic.h| 7 -- drivers/staging

[PATCH v2 2/3] staging: dgnc: dgnc_neo: Clean up if statement

2014-05-17 Thread Masaru Nomura
Fix line over 80 characters and indenting of condition part. Also, remove unnecessary braces to meet coding style. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_neo.c b

[PATCH v2 1/3] staging: dgnc: Put else statements on the right line

2014-05-17 Thread Masaru Nomura
Fix indenting of if-else statement in dgnc_neo.c and dgnc_tty.c so that following else-if or else statement meets coding style. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c | 48 +-- drivers/staging/dgnc/dgnc_tty.c | 36 ++--

[PATCH v2 0/3] Fix coding style of if statement

2014-05-17 Thread Masaru Nomura
This is the modified patches of [PATCH x/4] Fix coding style of if statment The following pateches fix the errors and warnings below in dgnc_neo.c and dgnc_tty.c to meet kernel coding style. ERROR: else should follow close brace '}' ERROR: that open brace { should be on the previous line WARNING

[PATCH v2 3/3] staging: dgnc: Remove extra curly braces

2014-05-17 Thread Masaru Nomura
Remove unnecessary curly braces of if statements in dgnc_neo.c and dgnc_tty.c to meet kernel coding style. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c | 60 - drivers/staging/dgnc/dgnc_tty.c | 110 ++- 2 files change

Re: [PATCH 3/4] staging: dgnc: dgnc_neo: Fix conditional part of if statement

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 10:14:52PM +0100, Masaru Nomura wrote: > > Also just fold this patch and [patch 2/4] together into one patch. We > > don't need two patches to fix one if statement. > > > > The one thing per patch rule is a bit tricky. It means that you have to > > say which one thing you

Re: [PATCH 3/4] staging: dgnc: dgnc_neo: Fix conditional part of if statement

2014-05-17 Thread Masaru Nomura
Hi Dan, Thank you for your detailed explanation! > This isn't the right way. Write it like this: > > if ((ch->ch_digi.digi_flags & CTSPACE) || > (ch->ch_digi.digi_flags & RTSPACE) || > (ch->ch_c_cflag & CRTSCTS) || > !(ch->ch_digi.digi_flags & DIGI_FOR

[PATCH] staging: unisys: visorutil: Add a blank line

2014-05-17 Thread Masaru Nomura
Add a blank line after declarations to meet kernel coding style. Signed-off-by: Masaru Nomura --- drivers/staging/unisys/visorutil/charqueue.c |2 ++ drivers/staging/unisys/visorutil/easyproc.c |6 ++ drivers/staging/unisys/visorutil/periodic_work.c |1 + drivers/stag

Re: [PATCH 3/4] staging: dgnc: dgnc_neo: Fix conditional part of if statement

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 05:30:53PM +0100, Masaru Nomura wrote: > diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c > index 8988346..c211f9f 100644 > --- a/drivers/staging/dgnc/dgnc_neo.c > +++ b/drivers/staging/dgnc/dgnc_neo.c > @@ -838,9 +838,11 @@ static void neo_para

Re: [PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 08:56:35PM +0200, Christian Engelmayer wrote: > On Sat, 17 May 2014 17:44:23 +0300, Dan Carpenter > wrote: > > On Sat, May 17, 2014 at 12:38:57PM +0200, Christian Engelmayer wrote: > > > Function rtw_drv_init() is written in a way that assumes 'status' != > > > _SUCCESS >

[PATCH 2/2] staging: rtl8821ae: fix not declared symbols should be static in sw.c

2014-05-17 Thread Konrad Zapalowicz
This commit fixes the following sparse warnings: drivers/staging/rtl8821ae/rtl8821ae/sw.c: - 48:6: warning: symbol 'rtl8821ae_init_aspm_vars' was not declared. Should it be static? - 228:5: warning: symbol 'rtl8812ae_rx_command_packet_handler' was not declared. Should it be sta

[PATCH 1/2] staging: rtl8821ae: fix double const in sw.c

2014-05-17 Thread Konrad Zapalowicz
This commit fixes the following sparse warning: drivers/staging/rtl8821ae/rtl8821ae/sw.c: - 449:14: warning: duplicate const Signed-off-by: Konrad Zapalowicz --- drivers/staging/rtl8821ae/rtl8821ae/sw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8

[PATCH 0/2] staging: rtl8821ae: fix sparse warnings in sw.c

2014-05-17 Thread Konrad Zapalowicz
This patch set fixes sparse warnings in sw.c file of rtl8821ae driver. In particular it deals with: 1) double const definition 2) missing 'static' for a few local symbols Konrad Zapalowicz (2): staging: rtl8821ae: fix double const in sw.c staging: rtl8821ae: fix not declared symbols sh

Re: [PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 08:21:03PM +0300, Antti Palosaari wrote: > On 05/17/2014 07:05 PM, Martin Kepplinger wrote: > >don't reinvent dev_dbg(). remove dprintk() in as102_drv.c. > >use the common kernel coding style. > > > >Signed-off-by: Martin Kepplinger > > Reviewed-by: Antti Palosaari > > >

Re: [PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
On Sat, 17 May 2014 17:44:23 +0300, Dan Carpenter wrote: > On Sat, May 17, 2014 at 12:38:57PM +0200, Christian Engelmayer wrote: > > Function rtw_drv_init() is written in a way that assumes 'status' != > > _SUCCESS > > as long as not explicitly set. Thus initialize 'status' to FAIL, in order to

Re: [PATCH] Fix for possible null pointer dereference in node.c

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 03:21:56PM +0200, Rickard Strandqvist wrote: > Okay, everyone agrees with Dan..? > You can audit it yourself, there are only 4 callers. The node_allocate() is total garbage so the second delete_node() is a bit complicated to read but it's not that hard. > I have made a n

Re: [PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Gianluca Gennari
Il 17/05/2014 19:52, Martin Kepplinger ha scritto: > Am 2014-05-17 19:21, schrieb Antti Palosaari: >> On 05/17/2014 07:05 PM, Martin Kepplinger wrote: >>> don't reinvent dev_dbg(). remove dprintk() in as102_drv.c. >>> use the common kernel coding style. >>> >>> Signed-off-by: Martin Kepplinger >>

Re: [PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Martin Kepplinger
Am 2014-05-17 19:21, schrieb Antti Palosaari: > On 05/17/2014 07:05 PM, Martin Kepplinger wrote: >> don't reinvent dev_dbg(). remove dprintk() in as102_drv.c. >> use the common kernel coding style. >> >> Signed-off-by: Martin Kepplinger > > Reviewed-by: Antti Palosaari > >> --- >> this applies

Re: [PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Antti Palosaari
On 05/17/2014 07:05 PM, Martin Kepplinger wrote: don't reinvent dev_dbg(). remove dprintk() in as102_drv.c. use the common kernel coding style. Signed-off-by: Martin Kepplinger Reviewed-by: Antti Palosaari --- this applies to next-20140516. any more suggestions? more cleanup can be done wh

[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-17 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions, only leaving support for the current version: 22 Signed-off-by: Joel Pelaez Jorge --- drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 - drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 5 +-- drivers/staging/r

[PATCH 3/4] staging: dgnc: dgnc_neo: Fix conditional part of if statement

2014-05-17 Thread Masaru Nomura
Fix line over 80 characters of if-condition part and also indent the lines to tell the difference between the condition and body of the if statement. Then I think we can keep the readability and meet coding style with this change. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c

[PATCH 1/4] staging: dgnc: Fix indenting of if-else statement

2014-05-17 Thread Masaru Nomura
Fix indenting of if-else statement in dgnc_neo.c and dgnc_tty.c so that following else-if or else statement meets coding style. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c | 48 +-- drivers/staging/dgnc/dgnc_tty.c | 36 ++--

[PATCH 2/4] staging: dgnc: dgnc_neo: Fix indenting of if statement

2014-05-17 Thread Masaru Nomura
Fix indenting of if statement in dgnc_neo.c so that an open brace follows if-condition part to meet kernel coding style. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_neo.c b/dri

[PATCH 0/4] Fix coding style of if statement

2014-05-17 Thread Masaru Nomura
The following pateches fix the errors and warnings in dgnc_neo.c and dgnc_tty.c to meet kernel coding style. ERROR: else should follow close brace '}' ERROR: that open brace { should be on the previous line WARNING: line over 80 characters WARNING: braces {} are not necessary for single statement

[PATCH 4/4] staging: dgnc: Remove unnecessary braces

2014-05-17 Thread Masaru Nomura
Remove unnecessary braces of if-else statements in dgnc_neo.c and dgnc_tty.c to meet kernel coding style. Signed-off-by: Masaru Nomura --- drivers/staging/dgnc/dgnc_neo.c | 20 drivers/staging/dgnc/dgnc_tty.c | 10 -- 2 files changed, 12 insertions(+), 18 deletio

[PATCHv2] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Martin Kepplinger
don't reinvent dev_dbg(). remove dprintk() in as102_drv.c. use the common kernel coding style. Signed-off-by: Martin Kepplinger --- this applies to next-20140516. any more suggestions? more cleanup can be done when dprintk() is completely gone. drivers/staging/media/as102/as102_drv.c | 15 +++

Re: [PATCH] staging: dgap: implement error handling in dgap_tty_register()

2014-05-17 Thread DaeSeok Youn
2014-05-17 8:09 GMT+09:00, Greg KH : > On Fri, Apr 25, 2014 at 04:04:59PM +0900, Daeseok Youn wrote: >> - alloc_tty_driver() is deprecated so it is changed to >> tty_alloc_driver() >> - Pointers which are allocated by alloc_tty_driver() and kzalloc() >> can be NULL so it need to check NULL for them

Re: [PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 12:38:57PM +0200, Christian Engelmayer wrote: > Function rtw_drv_init() is written in a way that assumes 'status' != _SUCCESS > as long as not explicitly set. Thus initialize 'status' to FAIL, in order to > prevent undefined behaviour if going through the exit paths. Detecte

Re: [PATCH] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Antti Palosaari
you forget to remove debug parameter itself. Antti On 05/17/2014 04:16 PM, Martin Kepplinger wrote: don't reinvent dev_dbg(). use the common kernel coding style. Signed-off-by: Martin Kepplinger --- this applies to next-20140516. drivers/staging/media/as102/as102_drv.c | 11 +++

Re: [PATCH] Fix for possible null pointer dereference in node.c

2014-05-17 Thread Rickard Strandqvist
Okay, everyone agrees with Dan..? I have made a new patch, which does not check if hnode is NULL. Best regards Rickard Strandqvist 2014-05-16 0:43 GMT+02:00 Dan Carpenter : > On Thu, May 15, 2014 at 11:53:53PM +0200, Rickard Strandqvist wrote: >> There is otherwise a risk of a possible null p

[PATCH] staging: media: as102: replace custom dprintk() with dev_dbg()

2014-05-17 Thread Martin Kepplinger
don't reinvent dev_dbg(). use the common kernel coding style. Signed-off-by: Martin Kepplinger --- this applies to next-20140516. drivers/staging/media/as102/as102_drv.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/as102/as102_drv.c b/

Re: [PATCH 2/5] dma-mapping: Add devm_ interface for dma_map_single()

2014-05-17 Thread Eli Billauer
Hello Tejun, On 17/05/14 00:08, Tejun Heo wrote: Don't we wanna map the underlying operation - dma_map_single_attrs() - instead? I'll resubmit this patch promptly, with a follow-up patch for the diff to implement dmam_map_single_attrs() instead. Plus a define-statement for dmam_map_sing

[PATCH 3/3] dma-mapping: pci: Add devm_ interface for pci_map_single

2014-05-17 Thread Eli Billauer
Signed-off-by: Eli Billauer --- Documentation/driver-model/devres.txt |2 ++ include/asm-generic/pci-dma-compat.h | 17 + 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 21

[PATCH 1/3] dma-mapping: Add devm_ interface for dma_map_single()

2014-05-17 Thread Eli Billauer
dmam_map_single() and dmam_unmap_single() are the managed counterparts for the respective dma_* functions. Note that dmam_map_single() returns zero on failure, and not a value to be handled by dma_mapping_error(): The error check is done by dmam_map_single() to avoid the registration of a mapping

[PATCH 2/3] dma-mapping: Add devm_ interface for dma_map_single_attrs()

2014-05-17 Thread Eli Billauer
dmam_map_single_attrs() and dmam_unmap_single_attrs() replace the non-*_attrs functions, which are implemented as defines instead. The case of a non-NULL @attrs parameter has not been tested. Suggested-by: Tejun Heo Signed-off-by: Eli Billauer --- Documentation/driver-model/devres.txt|

Re: [PATCH 0/2] staging: rtl8188eu: fix Coverity defects in rtw_drv_init()

2014-05-17 Thread Jes Sorensen
Christian Engelmayer writes: > This addresses two issues currently reported by static analysis for function > rtw_drv_init() in drivers/staging/rtl8188eu/os_dep/usb_intf.c. > >CID 1077553 - Logically dead code >CID 1077832 - Uninitialized scalar variable > > Compile tested only. Applies ag

[PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
Function rtw_drv_init() is written in a way that assumes 'status' != _SUCCESS as long as not explicitly set. Thus initialize 'status' to FAIL, in order to prevent undefined behaviour if going through the exit paths. Detected by Coverity - CID 1077832. Signed-off-by: Christian Engelmayer --- driv

[PATCH 2/2] staging: rtl8188eu: remove dead code in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
(status != _SUCCESS) immediately after 'status = _SUCCESS' will never evaluate true. Thus remove the logically dead code. Detected by Coverity - CID 1077553. Signed-off-by: Christian Engelmayer --- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/d

[PATCH 0/2] staging: rtl8188eu: fix Coverity defects in rtw_drv_init()

2014-05-17 Thread Christian Engelmayer
This addresses two issues currently reported by static analysis for function rtw_drv_init() in drivers/staging/rtl8188eu/os_dep/usb_intf.c. CID 1077553 - Logically dead code CID 1077832 - Uninitialized scalar variable Compile tested only. Applies against branch staging-next of tree git.kern

Re: [PATCH] Staging: speakup: fixed reporting_keystroke variable type

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 12:46:43AM +, Son P. Nguyen wrote: > From: "Son P. Nguyen" > > Fixed reporting_keystroke type to int instead of bool to quiet sparse > complaints of error cannot size expression. > > This is a part of eudyptula-challenge. > This is a bug in Sparse. The original cod