summaryrefslogtreecommitdiff
path: root/drivers/staging/ks7010
AgeCommit message (Collapse)Author
2016-10-02Staging : ks7010 : Fix block comments warninigMuraru Mihaela
Move final */ to a new line, to conform to the kernel coding style for block comments. Issue found by checkpatch. Signed-off-by: Muraru Mihaela <mihaela.muraru21@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-28staging: ks7010: declare private functions staticSergio Paracuellos
Private functions in ks7010_sdio.c can be declared static. Fixes sparse warnings 'was not declared. Should it be static?'. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27staging: ks7010: Use __packed over __attribute__((packed))Matt Kilgore
This replaces uses of __attribute__((packed)) with __packed, which is recommended to be used over the direct __attribute__. This patch then includes <linux/compiler.h> as necessary to use __packed. Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27staging: ks7010: Fix warnings on printk() usageSabitha George
This patch fixes the following warnings on ks7010_sdio.c 1. printk() should include KERN_ facility level 2. Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: Sabitha George <sabitha.george@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27staging: ks7010: ks_wlan_net: Use netdev_info instead of printkGeorgiana Rodica Chelu
Pass the net_device structure to print_hif_event function in order to use netdev_info instead of printk. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27staging: ks7010: ks_wlan_net: Use netdev_ instead of printkGeorgiana Rodica Chelu
The checkpatch.pl script found the following warning: WARNING: printk() should include KERN_ facility level After adding the KERN_ facility level to printk(), the script showed another warning: WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... The warning is similar for KERN_ERR and KERN_DEBUG. In conclusion, use netdev_info(), netdev_err() or netdev_dbg() when there is a netdev device. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-25staging: ks7010: ks_wlan_net: Remove return statement from void functionGeorgiana Rodica Chelu
Remove the return statement from the end of a void function to clean up the code. Issue found by checkpatch.pl script. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-25staging: ks7010: ks_wlan_net: Remove unnecessary variable used to store ↵Georgiana Rodica Chelu
return value Remove unneeded code in order to make clear that the function returns 0(success) in all cases. Done using returnvar.cocci script. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-23Staging: ks7010: remove unused function in ks_wlan_net.cBaoyou Xie
We get 1 warning when building kernel with W=1: drivers/staging/ks7010/ks_wlan_net.c:3520:5: warning: no previous prototype for 'ks_wlan_reset' [-Wmissing-prototypes] In fact, these functions are unused in ks_wlan_net.c, but should be removed. So this patch removes the unused function. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-23staging: ks7010: add blank line after variable declarationsJohan Svensson
Fixes warnings found by checkpatch Missing a blank line after declarations Signed-off-by: Johan Svensson <johan.svensson692@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22staging: ks7010: Remove unnecessary variable used to store return valuesayli karnik
This patch removes an unnecessary variable used to store return values in order to reduce memory usage. Done using coccinelle: @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret return - ret + C ; Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: ks7010: michael_mic: Use "foo *bar" instead of "foo * bar".Sandhya Bankar
This issue was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: ks7010: Use "foo *bar" instead of "foo * bar".Sandhya Bankar
This issue was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: ks7010: Use "foo *bar" instead of "foo * bar"Sandhya Bankar
This patch was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: ks7010: Use sizeof structure *pointer over sizeof structure in ↵Sandhya Bankar
kzalloc() This issue was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20staging: ks7010: Remove unnecessary variable used to store return valuesayli karnik
This patch removes an unnecessary variable used to store return values in order to reduce memory usage. Done using coccinelle: @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret return - ret + C ; Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20staging: ks7010: fixes typo in ks_hostif.cHariharan R
Fixes typo, FAILUER -> FAILURE Recieve -> Receive Signed-off-by: Hariharan R <hariharanrangasamy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18Staging: ks7010: Drop memory allocation cast.Sandhya Bankar
Drop cast on the result of kzalloc. The semantic patch that makes this change is as follows: @@ type T; @@ - (T *) (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...)) Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: ks7010: Remove extra round braces around expressions/variablessayli karnik
This patch removes excess round braces around expressions/variables. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: ks7010: Remove the space after a type castsayli karnik
The patch removes an unnecessary space after a cast, as detected by checkpatch.pl. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: ks7010: Remove unnecessary blank lines and commented codesayli karnik
The patch removes unnecessary blank lines as detected by checkpatch.pl. Also, it removes a commented line of unrequired code. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: ks7010: Remove space after '(' and before ')'sayli karnik
The patch fixes the following errors detected by checkpatch.pl: ERROR: space prohibited before that close parenthesis ')' ERROR: space prohibited after that open parenthesis '(' Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: ks7010: Remove braces following single statement blockssayli karnik
The patch removes braces {} for single statement blocks, as suggested by checkpatch.pl. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: ks7010: Use #include <linux/atomic.h> instead of <asm/atomic.h>sayli karnik
This patch replaces <asm/atomic.h> with <linux/atomic.h>, as suggested by checkpatch.pl. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-17Staging: ks7010: Remove extern keyword from function declarationBhumika Goyal
Remove extern specifier from function declaration as they have it by default. Also move extern declaration from .c files to their respective header file 'ks_hostif.h'. Coccinelle was used to remove extern and other changes were done by hand. Script: @@ identifier func; type T; @@ - extern T func(...); Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-17Staging: ks7010: Replace memset with eth_zero_addrBhumika Goyal
Use eth_zero_addr to assign zero address to the given address array instead of memset when the second argument in memset is address of zero. Coccinelle was used to do the replacement and add the header file linux/etherdevice.h if not already present. Script: @header@ @@ #include <linux/etherdevice.h> @r1@ expression e; @@ -memset(e,0,ETH_ALEN); +eth_zero_addr(e); @includeheader depends on r1 && !header@ @@ + #include <linux/etherdevice.h> #include <...> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: ks7010: remove unused including <linux/version.h>Wei Yongjun
Remove including <linux/version.h> that don't need it. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: ks7010: Remove the explicit cast on kmallocsayli karnik
The assignment operator implicitly converts a void pointer to the type of the pointer it is assigned to. Hence an explicit cast on the result of the kmalloc function is not required. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: ks7010: Remove whitespace before newlineRehas Sachdeva
This patch fixes the checkpatch.pl warning: WARNING: unnecessary whitespace before a quoted newline. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: ks7010: Remove the explicit NULL comparisonsayli karnik
The patch removes the explicit null comparisons entirely for the ks7010 driver. This was detected by checkpatch.pl Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: ks7010: fix two memory leaks on error return pathColin Ian King
On the error case where there is an invalid MAC address there is memory leak on packet and pp on the error return. Free these first before returning to fix the leak. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: ks7010: avoid dereferencing packet if it is nullColin Ian King
Updating tx_bytes from packet->len if packet is null will cause a null pointer dereference, so only update tx_bytes if it packet is not null. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: ks7010: fix warning on return for void functionsHariharan R
This patch fixes the checkpatch warning in ks7010_sdio.c 'void function return statements are not generally useful' Signed-off-by: Hariharan R <hariharanrangasamy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: ks7010: fix memory leakSudip Mukherjee
If the firmware request failed we were just returning but we missed freeing the memory and releasing the MMC Host. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: ks7010: return on failureSudip Mukherjee
On failure we were jumping to error_out0 where we were trying sdio_release_host() but at this point of execution we still have not done sdio_claim_host() and as a result host->claimed can still be 0. And if host->claimed is 0 then WARN_ON(!host->claimed) will give a warning. Moreover, if it is still not claimed then mmc_host->claim_cnt will be 0 and mmc_release_host() will do "if (--host->claim_cnt)" and thus the condition will become true. Lets just return the value on allocation failure instead of trying to release the host before claiming it. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: ks7010: don't print skb->dev->name if skb is nullColin Ian King
A null pointer dereference will occur when skb is null and skb->dev->name is printed. Replace the skb->dev->name with plain text "ks_wlan" to fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: ks7010: declare private functions staticNicholas Mc Guire
Private functions in ks_hostif.c can be declared static. Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: ks7010: fix wait_for_completion_interruptible_timeout return handlingNicholas Mc Guire
wait_for_completion_interruptible_timeout return 0 on timeout and -ERESTARTSYS if interrupted. The check for !wait_for_completion_interruptible_timeout() would report an interrupt as timeout. Further, while HZ/50 will work most of the time it could fail for HZ < 50, so this is switched to msecs_to_jiffies(20). Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository") Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: ks7010: do not dereference priv if priv is nullColin Ian King
priv is being dereferenced before a check for it being null is made, so there is a possibililty a null pointer deference can occur. Instead, only dereference priv if it is non-null. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15Staging: ks7010: michael_mic: fixed macros coding style issueBing Sun
Fixed coding style issue: Enclose multiple statements macros definition in a do while loop. Use one space around binary operators. Signed-off-by: Bing Sun <sunbing@redflag-linux.com> Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: ks7010: Delete a variable in write_to_device()Markus Elfring
The local variable "rc" was assigned a zero at one place. But it was not read within this function. Thus delete it. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: ks7010: Delete unnecessary assignments for buffer variablesMarkus Elfring
A few variables were assigned a null pointer despite of the detail that they were immediately reassigned by the following statement. Thus remove such unnecessary assignments. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: ks7010: Delete unnecessary checks before the function call "kfree"Markus Elfring
The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: remove bogus NULL checksDan Carpenter
enc->rx_seq[] and enc->key[] are arrays, not pointers and they can't be NULL. Let's remove these NULL checks. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: drop private handler for driver versionWolfram Sang
We are upstream now, we don't need seperate driver versioning. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: report interface as wlan not ethWolfram Sang
Until we switch to cfg80211 (if ever), we must do this manually. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: bail out when registering netdevice failsWolfram Sang
There is no need to continue then. Also, this enables us to remove an ugly static variable. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: sdio: remove forward declarationsWolfram Sang
Move read/write functions to the top and driver struct to the end, so we can remove all forward declarations. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: unify naming to ks7010Wolfram Sang
No 79xx anymore, this is confusing. Add a comment saying that old versions were probably named 7910/79xx. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: export sdio idsWolfram Sang
So the module will be loaded automatically on card insertion. Rename the array while here. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>