summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208/rtsx_scsi.c
Commit message (Collapse)AuthorAgeFilesLines
* staging/rts5208: fix incorrect shift to extract upper nybbleColin Ian King2017-08-201-1/+1
| | | | | | | | | | | | | The mask of sns_key_info1 suggests the upper nybble is being extracted however the following shift of 8 bits is too large and always results in 0. Fix this by shifting only by 4 bits to correctly get the upper nybble. Detected by CoverityScan, CID#142891 ("Operands don't affect result") Fixes: fa590c222fba ("staging: rts5208: add support for rts5208 and rts5288") Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rts5208: Fix read overflow in memcpyDaniel Micay2017-06-061-1/+1
| | | | | | | | | | | | Noticed by FORTIFY_SOURCE, this swaps memcpy() for strncpy() to zero-value fill the end of the buffer instead of over-reading a string from .rodata. Signed-off-by: Daniel Micay <danielmicay@gmail.com> [kees: wrote commit log] Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: rtsx_scsi.h: Long linesWayne Porter2016-10-161-4/+6
| | | | | | | | Aligning with parenthesis causes lines to go too long, so the parenthesis are on a new line Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Add braces to if()Wayne Porter2016-10-161-3/+4
| | | | | | | | Braces should be around every part of the if block and not just the else if Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove multiple assignmentWayne Porter2016-10-161-4/+7
| | | | | | | | Assign values to variables on their own lines instead of using multiple assignment Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: CamelCase fixesWayne Porter2016-10-161-21/+21
| | | | | | | Change camel case variables found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Remove parenthesesWayne Porter2016-10-161-23/+23
| | | | | | | Unnecessary parentheses found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Alignment fixesWayne Porter2016-10-161-100/+101
| | | | | | | Align to match open parenthesis, found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Fix typo in function nameWayne Porter2016-10-161-2/+2
| | | | | | | | Searched the entire kernel for any references to this function and it appears safe to fix the typo Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Replace explicit NULL comparisonNamrata A Shettar2016-10-021-1/+1
| | | | | | | Replace explicit NULL comparison to resolve checkpatch issues. Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Add space around binary operatorsNamrata A Shettar2016-10-021-10/+10
| | | | | | | Add space around binary operators to resolve checkpatch issue. Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Change data type to unsigned int.Louie Lu2016-08-211-1/+1
| | | | | | | | | This patch fixes a minor checkpatch warning: "WARNING: Prefer 'unsigned int' to bare use of 'unsigned'" Signed-off-by: Louie Lu <louie.lu@hopebaytech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: fix double blank line coding style issuesJonas Rickert2016-08-211-4/+0
| | | | | | | | This is a patch for double blank lines and a missing blank line reported by checkpatch.pl Signed-off-by: Jonas Rickert <jrickertkc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: simplify NULL testsEva Rachel Retuya2016-03-111-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: rts5208: Removed unnecessary return variableBhaktipriya Shridhar2016-03-111-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: rts5208: fix transfer length 0 for 6-byte r/w commandsAkinobu Mita2015-05-311-2/+6
| | | | | | | | | | | 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>
* staging: rts5208: Remove TRACE_RET and TRACE_GOTO macrosJoe Perches2015-03-261-183/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: rts5208: Convert variable from int to bool and propagate the change ↵Quentin Lambert2015-03-061-3/+4
| | | | | | | | | | | | | to function parameters This patch convert local variables declared as int into booleans. It also propagates the conversion when these variables were used as function parameters. Coccinelle was used to generate this patch. Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Convert non-returned local variable to boolean when relevantQuentin Lambert2015-03-061-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was produced using Coccinelle. A simplified version of the semantic patch is: @r exists@ identifier f; local idexpression u8 x; identifier xname; @@ f(...) { ...when any ( x@xname = 1; | x@xname = 0; ) ...when any } @bad exists@ identifier r.f; local idexpression u8 r.x expression e1 != {0, 1}, e2; @@ f(...) { ...when any ( x = e1; | x + e2 ) ...when any } @depends on !bad@ identifier r.f; local idexpression u8 r.x; identifier r.xname; @@ f(...) { ... ++ bool xname; - int xname; <... ( x = - 1 + true | x = - -1 + false ) ...> } Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Remove braces around single if-statementHaneen Mohammed2015-02-261-2/+0
| | | | | | | | This patch removes unneeded braces around a single if-statement. This problem was found using checkpatch.pl. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Delete braces are not necessaryMelike Yurtoglu2014-10-201-2/+1
| | | | | | | | Fix checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: remove unnecessary elseRoxana Blaj2014-10-021-3/+2
| | | | | | | | This fixes the checkpatch.pl warning: WARNING: else is not generally useful after a break or return Signed-off-by: Roxana Blaj <roxanagabriela10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: Fix missing blank line warning.Melike Yurtoglu2014-10-021-0/+3
| | | | | | | | Fixes "Missing a blank line after declarations" checkpatch.pl warning in rtsx_scsi.c Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Use dev_dbg and print_hex_dump_bytes to dump memoryFabio Falzoi2014-08-161-4/+3
| | | | | | | | Use dev_dbg with %*ph format specifier and print_hex_dump_bytes to dump memory instead of relying on custom macro. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Replace custom macro with dev_dbgFabio Falzoi2014-07-301-19/+21
| | | | | | | Use dev_dbg macro to control tracing verbosity through dynamic debug facility. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rts5208: Remove useless debug printsFabio Falzoi2014-07-301-4/+0
| | | | | | | Remove all debug printks used just to mark when we enter a function. Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rts5208/rtsx_scsi.c: Remove unnecessary parenthesesGeorgiana Rodica Chelu2014-03-071-4/+4
| | | | | | | | Remove unnecessary parentheses from staging/rts5208/rtsx_scsi.c Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rts5208: add support for rts5208 and rts5288Micky Ching2013-11-251-0/+3370
There are still many rts5208/5288 card readers being used, but no drivers are supported them in kernel now. This driver can make a great convenience for people who use them. Many other rts-series card reader are supported by mfd driver, but due to much difference with others, rts5208/5288 can not add into mfd driver pretty now, so we provide a separated driver here to support the device. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud