summaryrefslogtreecommitdiffstats
path: root/drivers/staging/slicoss
AgeCommit message (Collapse)Author
2013-12-06staging: slicoss: Remove last reference to compare_ether_addrJoe Perches
And use the normal is_<foo>_ether_addr functions and ETH_ALEN too. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02staging: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-27Staging: slicoss: Replace seq_printf with seq_putsRashika Kheria
This patch fixes the following checkpatch.pl warning in slicoss.c: WARNING: Prefer seq_puts to seq_printf Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19Staging: slicoss: Fix quoted string split across linesRashika Kheria
This patch fixes the following checkpatch.pl warning in slicoss.c- WARNING: quoted string split across lines Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19Staging: slicoss: Refactor code by introducing new function ↵Rashika Kheria
slic_interrupt_card_up() This patch fixes the following checkpatch.pl warning in slicoss.c: WARNING: Too many leading tabs - consider code refactoring Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19Staging: slicoss: Replace printk() with pr_debug() or dev_dbg() as requiredRashika Kheria
This patch fixes the following checkpatch.pl warning in slicoss.c: WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19Staging: slicoss: Removal of if check since debugfs_remove(NULL) is safeRashika Kheria
This patch fixes the following checkpatch.pl warning in slicoss.c: WARNING: debugfs_remove(NULL) is safe this check is probably not required Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17Staging: Convert uses of compare_ether_addr to ether_addr_equalJoe Perches
Preliminary to removing compare_ether_addr altogether: Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Additionally: Used is_zero_ether_addr, removed now unused variable Converted uses of &foo[0] to foo Done via cocci script: (and a little typing) $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13staging: slicoss: fix error return code in slic_entry_probe()Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: slicoss: information leak in ETHTOOL_GSETDan Carpenter
There are some fields in "edata" which have not been cleared. One example is edata.cmd. It leaks uninitialized stack information to the user. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: slicoss: Remove dma_addr_t cast compilation warningsJoe Perches
Eliminate some warnings by casting to unsigned long before casting a dma_addr_t value to a pointer. btw: Does slicoss always work on x86-32? Is a pshmem guaranteed to be accessible by a 32 bit address? Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Use ether_crc for mac hash calculationPeter Huewe
Instead of performing the hash calculation for the mac address by ourself, we can simply reuse ether_crc and shift only the result according to our needs. The code was tested against the previous implementation by verifying both implementations against each other in userspace for 16200000000 different mac addresses, changing the vendor bits of the mac address first. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Fix buffer possible overflow in slic_card_locatePeter Huewe
smatch complains about a possible buffer overflow slicoss.c:3651 slic_card_locate() error: buffer overflow 'physcard->adapter' 4 <= 4 If the for loop is not exited prematurely i++ is executed after the last iteration and thus i can be 4, which is out of bounds for physcard->adapter. -> Add check for this condition and simplify the if statement by inverting the condition. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Fix operation may be undefined warningPeter Huewe
gcc complains about an undefined operation: slicoss.c:1417:19: warning: operation on 'rspq->pageindex' may be undefined [-Wsequence-point] The intended operation was (probably) to retrieve the pageindex + 1 and let it wrap around if it reaches the num_pages. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Remove always true if statementPeter Huewe
skbtype is assigned once to NORMAL_ETHFRAME and then checked if it is NORMAL_ETHFRAME -> remove the checks. This also gets rid of the (false positive) smatch warning: slicoss.c:2829 slic_xmit_start() error: potential NULL dereference 'hcmd'. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Check pointer before dereferencingPeter Huewe
Smatch complains that the variable adapter is dereferenced before it is checked: slicoss.c:906 slic_timer_load_check() warn: variable dereferenced before check 'adapter' (see line 904) -> move the assignment after the check. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17staging: slicoss: Fix space-related checkpatch.pl warningsCruz Julian Bishop
This fixes all instances of "Please, no spaces at start of a new line" "Please, no spaces before tabs" Please note that I probably got the warning names wrong, but they should be close enough for usage here :) Additional post-commit note: There is one comment on line 230ish in slic.h that appears to have lost it's formatting. It was fine when I was working in Geany, but it caught my eye in the below diff. Sorry if it actually happened! Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17staging: slicoss: Fix three checkpatch.pl errors in slicoss.cCruz Julian Bishop
The errors fixed are all instances of "ERROR: do not use assignment in if condition" Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17staging: slicoss: Stop swearing in slicoss.cCruz Julian Bishop
I'm assuming that "CRC shit reg" is referencing the CRC register/registry. Please ignore this patch if "shit" is actually in context Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: slicoss: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: slicoss: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: slicoss: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-26staging: slicoss: fix a leak when kzalloc failDevendra Naga
slic_card_locate does a kzalloc of physcard, and if it fails, in my previous patch i returned -ENOMEM, but left the driver leak the memory if card_hostid == SLIC_HOSTID_DEFAULT, fix this memory leak if the above condition is true Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: slicoss: get rid of slic_cmdqmem_init functionDevendra Naga
this function memset's the cmdqmem, instead do it in slic_cmdq_init. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: slicoss: remove default case in irqhandlerDevendra Naga
this default statement does nothing in the irqhandler, so remove it Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: slicoss: return -ENOMEM if kzalloc failDevendra Naga
this takes up the error path cleanup, fixes a crash too due to null deref Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: slicoss: remove ASSERT macro altogetherDevendra Naga
remove ASSERT and remove all its callers altogether in the code Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: slicoss: fail out if we dont have a valid firmware fileDevendra Naga
fail instead calling request_firmware with filename as a null string and return -ENOENT Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: fix a null deref when pci_alloc_consistent failDevendra Naga
we are dereferencing the pshmem , and the pci_alloc_consistent can fail returning null, do a memcpy if we have a valid pshmem Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: remove return statement at the end of slic_mcast_set_listDevendra Naga
this function return void, means return at the end of this function is not needed Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: clean the spinlock code in slic_entry_openDevendra Naga
the locked variable is used for checking whether the function acquired lock, then unlock. actually with out this we can achieve the same lock and unlock senario, remove the locked variable and also cleanup the code around. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: remove default case after we done with request_firmwareDevendra Naga
we are returning -ENOENT when there is no firmware file for a matching device id. then we start calling request_firmware, after this we do checks on the firmware length of corresponding device id, since the default case is handled in the begining itself there is no need of a default case at the firmware length checks Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: slicoss: release firmware before returningDevendra Naga
we request_firmware in slic_card_download_gbrcv and we return out with out calling release_firmware, where we compare against a firmware lengths of certain device ids. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: slicoss: return early before calling request_firmware with empty ↵Devendra Naga
firmware filename when the device id doesn't match in slic_card_download_gbrcv the filename is "", i.e an empty name, and we try calling request_firmware with that name, actually we can just fail out at default case before even calling request_firmware Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11staging/slicoss: disable pci device at removeDevendra Naga
at probe we enabled the device, and we should disable it at remove. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09staging/slicoss: return -ENODEV if no devid matchesDevendra Naga
if no case matches we are simply asserting and doing break. and i think we may need to return that -ENODEV , no device is present, rather assert'ing. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09staging/slicoss: remove not-needed ASSERTDevendra Naga
As the private pointer is valid at the remove of driver, and remove wont' be called if probe fails, so no point for checking of ASSERT Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18staging: slicoss: Fix a typo.Justin P. Mattock
The below patch fixes a typo found while reading through staging/slicoss Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-15staging: clean up Greg's email address in some TODO filesGreg Kroah-Hartman
My old email address was in some TODO files, so this fixes that issue. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-11-18staging: slicoss depends on NETRandy Dunlap
The slicoss driver uses network interfaces so it should depend on NET. Fixes the following build errors: ERROR: "eth_change_mtu" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "eth_validate_addr" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "register_netdev" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "alloc_etherdev_mqs" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "__netif_schedule" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "netif_rx" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "eth_type_trans" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "skb_put" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "skb_pull" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "__alloc_skb" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "free_netdev" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "unregister_netdev" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "consume_skb" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "dev_kfree_skb_irq" [drivers/staging/slicoss/slicoss.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Lior Dotan <liodot@gmail.com> Cc: Christopher Harrer <charrer@alacritech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-26Remove stale "depends on NETDEV_1000"in staging driversLinus Torvalds
Mark Einon points out that the Kconfig option for NETDEV_1000 no longer exists, and the merge of the staging drivers should have removed that for the et131x driver. And while checking for it, I noticed that slicoss had the same stale dependency. Remove that one too. Reported-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-17net: remove use of ndo_set_multicast_list in driversJiri Pirko
replace it by ndo_set_rx_mode Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-09-30staging: slicoss: use free_netdev(netdev) instead of kfree()Vasiliy Kulikov
Freeing netdev without free_netdev() leads to net, tx leaks. I might lead to dereferencing freed pointer. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) @@ struct net_device* dev; @@ -kfree(dev) +free_netdev(dev) Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Acked-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31Staging: slicoss: Remove explicit arch dependenciesDenis Kirjanov
Remove explicit arch dependencies Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02Staging: slicoss: Remove net_device_stats from the driver's privateDenis Kirjanov
Remove net_device_stats from the driver's private. Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22Staging: slicoss: kill functions prototypes and reorder functionsDenis Kirjanov
Reorder functions to kill their prototypes. Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08staging: slicoss: error handling with gotoKulikov Vasiliy
This patch makes error handling more readable due to 'goto err' pattern. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Cc: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08staging: slicoss: error handling with gotoKulikov Vasiliy
This patch makes error handling more readable due to 'goto err' pattern. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Cc: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08staging: slicoss: Remove STATUS_XXX defines.Kulikov Vasiliy
Remove defines of STATUS_XXX from header file. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Cc: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>