summaryrefslogtreecommitdiff
path: root/drivers/staging/rts5208
AgeCommit message (Collapse)Author
2016-04-30staging: rts5208: alignment to match open paranthesisManav Batra
Fixes CHECK: Alignment should match open parenthesis Signed-off-by: Manav Batra <batmanav10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30staging: rts5208: ensure braces on all arms of if stmtNicholas Sim
Added braces on if arm of if statement where else arm already needs braces as suggested for clarity in Documentation/CodingStyle (several) Signed-off-by: Nicholas Sim <nicholassimws@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29Staging: rts5208: rtsx_card.c: Remove unused functionBhumika Goyal
The functions double_depth, check_card_fail, check_card_ejected are not used anywhere in the kernel. So, remove their prototype and definition. Grepped to find occurences. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29Staging: rts5208: Remove unused functionsBhumika Goyal
The functions rtsx_disable_card_int, rtsx_undo_delink, rtsx_check_link_ready are not used anywhere in the kernel. So,remove their definition and prototype. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28Staging: rts5208: Add space around '+'Dilek Uzulmez
Add space around operator '+'. Problem found using checkpatch.pl CHECK: spaces preferred around that '+' (ctx:VxV) Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: Replace pci_enable_device with pcim_enable_deviceAmitoj Kaur Chawla
Devm_ functions allocate memory that is automatically freed when a driver detaches. Replace pci_enable_device with pcim_enable_device. Remove unnecessary pci_disable_device and pci_release_regions from probe and remove functions in rts5208 driver since pcim_enable_device contains a call to pcim_release which contains calls to both pci_disable_device and pci_release_regions. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: Change form of NULL comparisonsBhaktipriya Shridhar
Change null comparisons of the form x == NULL to !x. This was done using Coccinelle. @@ expression e; @@ - e == NULL + !e Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: Remove NULL test before vfreeBhaktipriya Shridhar
vfree frees the virtually continuous memory area starting at addr. If addr is NULL, no operation is performed. So NULL test is not needed before vfree. This was done using Coccinelle: @@ expression x; @@ -if (x != NULL) vfree(x); @@ expression x; @@ -if (x != NULL) { vfree(x); x = NULL; -} Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: simplify NULL testsEva Rachel Retuya
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for consistency. Coccinelle semantic patch used: @@ identifier func; expression x; statement Z; @@ x = func(...); if ( ( + ! x - == NULL | + ! - NULL == x ) ) Z Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: rts5208: Use min instead of ternary operatorBhumika Goyal
This patch replaces ternary operator with macro min as it shorter and thus increases code readability. Macro min returns the minimum of the two compared values. Made a semantic patch for changes: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: rtsx_transport.c: Drop void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void *e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: rtsx.c: Drop unneeded void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void *e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: Remove unnecessary pci_set_drvdata()Amitoj Kaur Chawla
Unnecessary pci_set_drvdata() has been removed since the driver core clears the driver data to NULL after device release or on probe failure. There is no need to manually clear the device driver data to NULL. The Coccinelle semantic patch used to make this change is as follows: //<smpl> @@ struct pci_dev *pci; @@ - pci_set_drvdata(pci, NULL); //</smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12Staging: rts5208: Remove unnecessary parenthesesDilek Uzulmez
Problem found using checkpatch.pl CHECK: Unnecessary parentheses around chip->ms_card Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: Prefer using BIT macroBhaktipriya Shridhar
Replace all instances of bit shifting on 1 with the BIT(x) macro. This was done using Coccinelle. @@ int c; @@ - (1 << c) + BIT(c) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-12staging: rts5208: Removed unnecessary return variableBhaktipriya Shridhar
This patch removes unnecessary return variables in switch statements. This was done with Coccinelle: @@ local idexpression ret; expression e1,e2; identifier label; @@ switch ( ... ) { case label : ... - ret = e1; - break; + return e1; ... default: ... - ret = e2; + return e2; ... } ... when != ret - return ret; @@ type T; identifier x; @@ - T x; ... when != x Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Fix comparisons to NULLShaun Ren
This patch changes all comparsions to NULL with !..., as reported by checkpatch.pl. Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Remove unnecessary parenthesesShaun Ren
This patch removes all unnecessary parentheses found by checkpatch.pl. Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Fix label naming conventionShaun Ren
This patch fixes the following naming convention issue in rtsx_transport.c, as reported by checkpatch.pl: CHECK: Avoid CamelCase: <Handle_Errors> Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Remove extra newlinesShaun Ren
This patch fixes the following issues in rtsx_transport.c as reported by checkpatch.pl: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Please don't use multiple blank lines Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Add spaces around -Shaun Ren
This patch fixes the following styling issue in rtsx_transport.c as reported by checkpatch.pl: CHECK: spaces preferred around that '-' (ctx:VxV) Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Remove spaces after castsShaun Ren
This patch removes all spaces after casts in rtsx_transport.c, as reported by checkpatch.pl: CHECK: No space is necessary after a cast Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Align to open parenthesisShaun Ren
This patch fixes the alignment issue reported by checkpatch.pl: CHECK: Alignment should match open parenthesis Add a unsigned char *sgbuffer in rtsx_stor_access_xfer_buffer to make the following memcpy logic easier to read. Add a struct scatterlist *sg in the use_sg branch of rtsx_transfer_data_partial to make the parameters of the rtsx_transfer_sglist_adma_partial call fit in 80 character lines after aligning them to the open parenthesis. Refactor memcpy logic in rtsx_stor_access_xfer_buf to make it more legible. Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: rts5208: rtsx_transport.c: Cleanup commentsShaun Ren
This patch fixes all multiline comments to conform to the coding style, which states that multiline comments should start with "/*" and end with "*/" on a separate line. Also cleans up some comments to make them more clear and/or reflect what the code is doing. Signed-off-by: Shaun Ren <shaun.ren@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15staging: rts5208: Place constants on the right side of comparisonsJanani Ravichandran
Constants should be placed on the right hand side of comparisons. This issue was identified by checkpatch. Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-10Staging: rts5208: remove unnecessary paranthesesHaneen Mohammed
This patch removes unnecessary parantheses around rtsx->pci->dev. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-10Staging: rts5208: fix check for dma mapping errorHaneen Mohammed
use dma_mapping_error() instead of comparing the returned address with zero after dma_map_single(). Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rts5208: Removed blank linesAnjali Menon
Removed multiple blank lines to avoid the check detected by checkpatch.pl. CHECK: Please don't use multiple blank lines Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: rts5208: Remove unnecessary synchronize_irq() before free_irq()Lars-Peter Clausen
Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Patch was generated using the following semantic patch: // <smpl> @@ expression irq; @@ -synchronize_irq(irq); free_irq(irq, ...); // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17Staging: rts5208: use dmam_alloc_coherentRonit Halder
This patch replaces dma_alloc_coherent with the corresponding managed interface. Signed-off-by: Ronit Halder <ronit.crj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-21Staging: rts5208: Coding style warnings fix for block commentsPunit Vara
This is patch to rtsx_chip.c that fixes up following warning reported by checkpatch.pl : -Block comments use * on subsequent lines Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04Staging: rts5208: Fix code indentation warning as detected by checkpatch.plYash Shah
Fixed code indentation warning as detected by checkpatch.pl. Signed-off-by: Yash Shah <yshah1@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-15Staging: rts5208: Fix checkpatch warning: else is not generally usefulLeung Timothy Chi King
The following checkpatch warning was fixed: WARNING: else is not generally useful after a break or return Signed-off-by: Leung Timothy Chi King <contact@timothyleung.co> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-26Merge tag 'staging-4.2-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here's the big, really big, staging tree patches for 4.2-rc1. Loads of stuff in here, almost all just coding style fixes / churn, and a few new drivers as well, one of which I just disabled from the build a few minutes ago due to way too many build warnings. Other than the one "disable this driver" patch, all of these have been in linux-next for quite a while with no reported issues" * tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1163 commits) staging: wilc1000: disable driver due to build warnings Staging: rts5208: fix CHANGE_LINK_STATE value Staging: sm750fb: ddk750_swi2c.c: Insert spaces before parenthesis Staging: sm750fb: ddk750_swi2c.c: Place braces on correct lines Staging: sm750fb: ddk750_swi2c.c: Insert spaces around operators Staging: sm750fb: ddk750_swi2c.c: Replace spaces with tabs Staging: sm750fb: ddk750_swi2c.h: Shorten lines to under 80 characters Staging: sm750fb: ddk750_swi2c.h: Replace spaces with tabs Staging: sm750fb: modedb.h: Shorten lines to under 80 characters Staging: sm750fb: modedb.h: Replace spaces with tabs staging: comedi: addi_apci_3120: rename 'this_board' variables staging: comedi: addi_apci_1516: rename 'this_board' variables staging: comedi: ni_atmio: cleanup ni_getboardtype() staging: comedi: vmk80xx: sanity check context used to get the boardinfo staging: comedi: vmk80xx: rename 'boardinfo' variables staging: comedi: dt3000: rename 'this_board' variables staging: comedi: adv_pci_dio: rename 'this_board' variables staging: comedi: cb_pcidas64: rename 'thisboard' variables staging: comedi: cb_pcidas: rename 'thisboard' variables staging: comedi: me4000: rename 'thisboard' variables ...
2015-06-19Staging: rts5208: fix CHANGE_LINK_STATE valueFabio Falzoi
Fix CHANGE_LINK_STATE value when card_exist is true. Fixes: a9b693cd77d7 ("Staging: rts5208: helper function to manage delink states") Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage delink statesFabio Falzoi
Use a helper function to manage delink states Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage 1lun and 2lun modesFabio Falzoi
Use a helper function to manage lun modes when SUPPORT_OCP is defined Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage idleFabio Falzoi
Use a helper function to manage idle state Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage aspmFabio Falzoi
Use a helper function to manage aspm mode Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage ssFabio Falzoi
Use a helper function to manage ss_counter Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage power offFabio Falzoi
Use a helper function to check if power off is needed. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18Staging: rts5208: helper function to manage sd erase statusFabio Falzoi
Use a helper function to manage SD erase status when SUPPORT_SD_LOCK is defined Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13Staging: rts5208: xd: Fixed checkpatch warningNizam Haider
Fixed a warning, else is not generally useful after a break or return. Signed-off-by: Nizam Haider <nizamhaider786@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: rts5208: Use common pci_get_bus_and_slot() instead of private oneYijing Wang
We already have a inline pci_get_bus_and_slot() in include/linux/pci.h, Use it instead of local one. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01scsi: Do not set cmd_per_lun to 1 in the host templateHannes Reinecke
'0' is now used as the default cmd_per_lun value, so there's no need to explicitly set it to '1' in the host template. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-05-31staging: rts5208: pass timeout as HZ independent valueNicholas Mc Guire
schedule_timeout takes a timeout in jiffies but the code currently is passing in a constant POLLING_INTERVAL which makes this timeout HZ dependent, so pass it through msecs_to_jiffies() to fix this up. patch was compile tested for x86_64_defconfig + CONFIG_STAGING=y, CONFIG_RTS5208=m Patch is against 4.0-rc5 (localversion-next is -next-20150527) Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: rts5208: fix transfer length 0 for 6-byte r/w commandsAkinobu Mita
For 6-byte r/w commands, transfer length 0 means 256 blocks of data, not 0 block. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Micky Ching <micky_ching@realsil.com.cn> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-scsi@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08Staging: rts5208: Replace timeval with timespec64Ksenija Stanojevic
struct timeval tv is used to get current time. 32-bit systems using 'struct timeval' will break in the year 2038, so we have to replace that code with more appropriate types. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macrosJoe Perches
Macros with hidden flow control are bad form as the code path taken can be unexpected for the reader. Expand these in-place and remove the macros. Done with coccinelle script: @@ expression chip; expression arg1; expression arg2; expression arg3; @@ - RTSX_WRITE_REG(chip, arg1, arg2, arg3); + retval = rtsx_write_register(chip, arg1, arg2, arg3); + if (retval) { + rtsx_trace(chip); + return retval; + } @@ expression chip; expression arg1; expression arg2; @@ - RTSX_READ_REG(chip, arg1, arg2); + retval = rtsx_read_register(chip, arg1, arg2); + if (retval) { + rtsx_trace(chip); + return retval; + } Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26staging: rts5208: Remove TRACE_RET and TRACE_GOTO macrosJoe Perches
Remove these flow hiding macros. Miscellanea: o Add a macro and function to replace a large inline o Simplify #includes o Add trace.c and update Makefile o Remove static inline filename function and use kbasename instead This reduces object size quite a lot: ~350KB (x86-64 allyesconfig) $ size drivers/staging/rts5208/built-in.o* text data bss dec hex filename 248385 36728 77888 363001 589f9 drivers/staging/rts5208/built-in.o.new 506691 83352 115896 705939 ac593 drivers/staging/rts5208/built-in.o.old Done via coccinelle script and some typing. @@ expression chip; expression ret; @@ - TRACE_RET(chip, ret); + rtsx_trace(chip); + return ret; @@ expression chip; identifier label; @@ - TRACE_GOTO(chip, label); + rtsx_trace(chip); + goto label; Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>