summaryrefslogtreecommitdiff
path: root/drivers/staging/slicoss
AgeCommit message (Collapse)Author
2016-09-27staging: slicoss: cleaning up codestyle warningsGrygorii Maistrenko
This removes checkpatch.pl warnings: WARNING: Block comments should align the * on each line Signed-off-by: Grygorii Maistrenko <grygoriimkd@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22staging: slicoss: Move NULL test closer to assignmentRehas Sachdeva
Move the test to check if a variable is NULL, to right after it is being assigned, rather than some statements later. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: slicoss: Remove unnecessary braces {}Rehas Sachdeva
Removes unnecessary braces {} on both arms of an if-else block as they have a single statement each. Issue detected by checkpatch. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: slicoss: Remove blank lines before & after bracesRehas Sachdeva
Removes unnecessary blank lines after an opening brace '{' and before a closing brace '}'. Issue detected by checkpatch.pl. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: slicoss: Remove unnecessary blank lineRehas Sachdeva
Removes unnecessary blank line detected by checkpatch. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: slicoss: add new line after struct declarationGargi Sharma
checkpatch generates a warning for no blank line after struct declaration. Inserted a new line. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01staging: slicoss: constify ethtool_ops structuresJulia Lawall
Check for ethtool_ops structures that are only stored in the ethtool_ops field of a net_device structure or passed as the second argument to netdev_set_default_ethtool_ops. These contexts are declared const, so ethtool_ops structures that have these properties can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct ethtool_ops i@p = { ... }; @ok1@ identifier r.i; struct net_device e; position p; @@ e.ethtool_ops = &i@p; @ok2@ identifier r.i; expression e; position p; @@ netdev_set_default_ethtool_ops(e, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct ethtool_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: simplify struct for statisticsLino Sanfilippo
Merge several structures for statistics to one structure and remove unnecessary union nesting. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: improve implementation concerning the shared memoryLino Sanfilippo
Remove the volatile specifiers of struct slic_shmem. Furthermore store the bus addresses for the isr pointer, link status and statistics separately and access the upper and lower word of these addresses by means of [lower|upper]_32_bits(). By doing this take the endianness into account. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: dont use a structure but offsets for register accessesLino Sanfilippo
Use the new register accessors that use offsets instead of the slic_regs structure to read/write registers. Since not longer needed remove the structure completley. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: avoid PCI write postingLino Sanfilippo
Introduce the function slic_flush_write() which reads from the HOSTID register and can be used to avoid PCI write posting. Use the function at several critical places in the code. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: introduce register accessors that use register offsetsLino Sanfilippo
Introduce accessor functions that read and write registers by using a register offset. This is in preparation to replace the register addressing by means of the slic_regs struct with an addressing by means of offsets. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: start tx queue when interface is brought upLino Sanfilippo
There is no reason to delay tx queue activation until a link is detected. So start the queue when the interface is brought up and stop it when the interface is brought down. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: ensure mapping of io-memory is uncachedLino Sanfilippo
Writes to registers should be done uncached for various reasons. Ensure this by replacing ioremap() with ioremap_nocache(). Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: notifiy network stack about change in link stateLino Sanfilippo
Notify the network stack about link states via netif_carrier_[off|on](). Also set the link state off initially and when the interface is brought down. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: slicoss: handle allocation failure in slic_init_adapterLino Sanfilippo
The memory allocation in slic_init_adapter() can fail. Return an error in this case and unwind properly. Also make sure that the allocated memory is properly freed in case of an error in the calling probe() function. By doing this also replace the alloc() followed by memset to zero the memory with a zalloc() version. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30staging: slicoss: fix missing blank lineClifton Barnes
fix checkpatch.pl warning about 'Missing a blank line after declarations' Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30staging: slicoss: fix bare use of 'unsigned'Clifton Barnes
fix checkpatch.pl warning about 'Prefer 'unsigned int' to bare use of 'unsigned'' Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: slicoss: Add error check for pci_map_singleAmitoj Kaur Chawla
Currently, DMA mapping failure is not detected, causing the hardware to attempt a DMA from an invalid address. This patch adds the corresponding error check for pci_map_single i.e. pci_dma_mapping_error. Problem found using the following Coccinelle semantic patch: // <smpl> @@ expression e1; identifier x; @@ x= ( *dma_map_single(...) | *dma_map_page(...) ) ... when != dma_mapping_error(e1,x) @@ expression e1; identifier x; @@ x = ( *pci_map_single(...) | *pci_map_page(...) ) ... when != pci_dma_mapping_error(e1,x) // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: slicoss: changes comparisons to NULL in slicoss.cBen Marsh
This is a patch to slicoss.c to change the style of NULL comparisons in order to remove checkpatch.pl warnings. Signed-off-by: Ben Marsh <bmarsh94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: slicoss: removes unnecessary blank lines in slicoss.cBen Marsh
This is a patch to slicoss.c to remove unnecessary blank lines as found by checkpatch.pl Signed-off-by: Ben Marsh <bmarsh94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: slicoss: change memory allocation style in slicoss.cBen Marsh
This is a patch to slicoss.c to change the memory allocation style in slicoss.c as found by checkpatch.pl Signed-off-by: Ben Marsh <bmarsh94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: slicoss: changes the style of memory allocation in slicoss.cBen Marsh
This is a patch to slicoss.c to change the memory allocation style as identified by checkpatch.pl Signed-off-by: Ben Marsh <bmarsh94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: slicoss: changes memory allocation style in slicoss.cBen Marsh
This is a patch to slicoss.c that changes the memory allocation style as identified by checkpatch.pl Signed-off-by: Ben Marsh <bmarsh94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: slicoss: memory allocation style change in slicoss.cBen Marsh
This is a patch to slicoss.c to change the memory allocation style as identified by checkpatch.pl Signed-off-by: Ben Marsh <bmarsh94@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: slicoss: Eliminate commented out codeJanani Ravichandran
Remove commented out code to reduce code clutter. Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-12staging: slicoss: Align #define constantsJanani Ravichandran
Aligning the constants in the macros improves code readability. Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging/slicoss: Use ethtool_ops instead of module_param.Kevin Wern
ethtool_ops has attributes in sub struct ethtool_coalesce that correspond to the parameters intagg_delay and dynamic_intagg. It is preferable to set these properties with ethtool rather than module_param, so create these attributes in adapter and set them using ethtool_coalesce's rx_coalesce_usecs and rx_use_adaptive_coalesce. (Outlined in TODO file) Signed-off-by: Kevin Wern <kevin.m.wern@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: slicoss: Fixes block comment styleAmarjargal Gundjalam
This patch fixes the checkpatch.pl warnings: WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: slicoss: Adds space around operatorsAmarjargal Gundjalam
This patch fixes the checkpatch.pl check: CHECK: spaces preferred around that ‘’ Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: slicoss: Removes unnecessary space after a castAmarjargal Gundjalam
This patch fixes the checkpatch.pl check: CHECK: No space is necessary after a cast Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: slicoss: Removes multiple blank linesAmarjargal Gundjalam
This patch fixes the checkpatch.pl check: CHECK: Please don't use multiple blank lines Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17Staging: slicoss: Remove unnecessary cast on void pointerShraddha Barke
void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-19staging: slicoss: use status in isrSudip Mukherjee
If we are not able to setup the LINK UP command then don't increment the interrupt count. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-19staging: slicoss: use status in slic_ioctlSudip Mukherjee
In the ioctl function if we are not able to UP the link after setting the new parameters then return an error code to the userspace. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-19staging: slicoss: use status in slic_if_initSudip Mukherjee
While initializing the interface if we are not able to setup the command to UP the link then we release everything and return the error code. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-19staging: slicoss: return status of slic_link_event_handlerSudip Mukherjee
slic_link_event_handler() issues command READ_LINK_STATUS to be executed asynchronously, which is followed by UP configuration write command. But it can fail while setting up the command and in that case the link will not be up. Lets check the status and return it. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31staging: slicoss: Add blank line after variable declarations.Ciprian Manea
This patch fixes the checkpatch.pl warning: WARNING: Missing a blank line after declarations + unsigned long flags; + pshmem = (struct slic_shmem *)(unsigned long) Signed-off-by: Ciprian Manea <ciprian.manea.cm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18staging: slicoss: remove unused macroHari Prasath Gujulan Elango
This patch removes a couple of ununsed MACRO's in this header file Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: slicoss: restore IRQs correctly after slic_cmdq_reset()Dan Carpenter
We can't save two different values in "flags" so it means that IRQs are not enabled properly at the end of this function. This isn't a problem in the current code because it's always called with IRQs disabled so we don't want to enable them at the end. This bug is old but it's thanks to David Matlack's recent cleanups that Smatch can detect it. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-13staging: slicoss: fix occasionally writing out only half of a dma addressDavid Matlack
curaddrupper caches the last written upper 32-bits of a dma address (the device has one register for the upper 32-bits of all dma address registers). The problem is, not every dma address write checks and sets curaddrupper. This causes the driver to occasionally not write the upper 32-bits of a dma address to the device when it really should. I've seen this manifest particularly when the driver is trying to read config data from the device (RCONFIG) in order to checksum the device's eeprom. Since the device writes its config data to the wrong DMA address the driver reads 0 as the eeprom size and the eeprom checksum fails. This patch fixes the issue by removing curaddrupper and always writing the upper 32-bits of dma addresses. Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-13staging: slicoss: remove slic_spinlock wrapperDavid Matlack
As per TODO. This commit introduces no functional changes. Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26Staging: slicoss: Remove redundant and disabled code blockNiranjan Dighe
Removing code guarded by undefined macro SLIC_TRACE_DUMP_ENABLED Signed-off-by: Niranjan Dighe <niranjan.dighe@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06Staging: slicoss: clean dev_err loggingHaneen Mohammed
This patch removes __func__ from dev_err. dev_err includes information about: (devcice, driver, specific instance of device, etc) in the log printout. This was done using Coccinelle, with the following semantic patch: @a@ expression E, R; expression msg; @@ dev_err(E, msg, __func__, R); @script:python b@ e << a.msg; y; @@ if(e.find("%s: ") == True): m = e.replace("%s: ", "", 1); coccinelle.y = m; elif(e.find("%s ") == True): m = e.replace("%s ", "", 1); coccinelle.y = m; elif(e.find("%s:") == True): m = e.replace("%s:", "", 1); coccinelle.y = m; else: m = e.replace("%s", "",1); coccinelle.y = m; @c@ expression a.E, a.msg, a.R; identifier b.y; @@ - dev_err(E, msg, __func__, R); + dev_err(E, y, R); Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: slicoss: remove extra parentheses around left bit shift operationsAya Mahfouz
Removes extra parentheses around bitwise left shift operations. The case handled is when resultant value is assigned to a variable. The issue was detected and resolved using the following coccinelle script: @@ expression e, e1; constant c; @@ e = -(e1 +e1 << -c); +c; @@ identifier i; constant c; type t; expression e; @@ t i = -(e +e << -c); +c; @@ expression e, e1; identifier f; constant c; @@ e1 = f(..., -(e +e << -c) +c ,...); Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: slicoss: remove extra parentheses around right bit shift operationsAya Mahfouz
Removes extra parentheses around bitwise right shift operations. The cases handled here are when resultant values are assigned to variables. The issue was detected and resolved using the following coccinelle script: @@ expression e, e1; constant c; @@ e = -(e1 +e1 >> -c); +c; @@ identifier i; constant c; type t; expression e; @@ t i = -(e +e >> -c); +c; @@ expression e, e1; identifier f; constant c; @@ e1 = f(..., -(e +e >> -c) +c ,...); Some coding style issues were handled manually to avoid checkpatch warnings and errors. Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: Remove <linux/moduleparam.h> header.Navya Sri Nizamkari
This patch drops #include <linux/moduleparam.h> in all the staging driver files that also include #include <linux/module.h> as module.h includes moduleparam.h already. The following semantic patch is used to make these changes: @ includesmodule @ @@ @ depends on includesmodule @ @@ - #include <linux/moduleparam.h> Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: slicoss: Join split string.Ksenija Stanojevic
This patch fixes warning issue by checkpatch.pl by joining the split string. And also creates new warning that line exceeds 80 characters. In this case this is more beneficial because of possibility to grep the string. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staging: slicloss: replace init_timer by setup_timerAya Mahfouz
This patch replaces init_timer and the 2 step initialization of function and data by setup_timer to make the code more concise. The issue was discovered using the following coccinelle script: @@ expression ds, e1, e2; @@ -init_timer (&ds); +setup_timer (&ds, e1, e2); ... ( -ds.function = e1; ... -ds.data = e2; | -ds.data = e2; ... -ds.function = e1; ) Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-03Staging: slicoss: Fix long line issues in slicoss.cSean Cleator
A patch to the slicoss.c file to fix some of the long line issues found by the checkpath.pl tool Signed-off-by: Sean Cleator <seancleator@hotmail.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>