aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-06-06staging/rts5208: Fix read overflow in memcpyDaniel Micay1-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>
2017-06-06staging: rt5208: Fix a sleep-in-atomic bug in xd_copy_pageJia-Ju Bai1-1/+1
The driver may sleep under a spin lock, and the function call path is: rtsx_exclusive_enter_ss (acquire the lock by spin_lock) rtsx_enter_ss rtsx_power_off_card xd_cleanup_work xd_delay_write xd_finish_write xd_copy_page wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in xd_copy_page. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03rts5208: Fix a sleep-in-atomic bug in rtsx_exclusive_enter_ssJia-Ju Bai1-1/+1
The driver may sleep under a spin lock, and the function call path is: rtsx_exclusive_enter_ss (acquire the lock by spin_lock) rtsx_enter_ss rtsx_power_off_card sd_cleanup_work sd_stop_seq_mode sd_switch_clock sd_ddr_tuning sd_ddr_pre_tuning_tx sd_change_phase wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in sd_change_phase. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03rts5208: Fix a sleep-in-atomic bug in sd_power_off_card3v3Jia-Ju Bai1-1/+1
The driver may sleep under a spin lock, and the function call path is: rtsx_exclusive_enter_ss (acquire the lock by spin_lock) rtsx_enter_ss rtsx_power_off_card sd_power_off_card3v3 wait_timeout schedule_timeout --> may sleep To fix it, "wait_timeout" is replaced with mdelay in sd_power_off_card3v3. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: rts5208: ms.c fixed checkpatch warning - using __func__ instead of hardcoded nameAndrea della Porta1-1/+1
staging: rts5208: ms.c Fixed checkpatch warning: WARNING: Prefer using "%s", __func__ to embedded function names #2597: FILE: rts5208/ms.c:2597: + dev_dbg(rtsx_dev(chip), "ms_build_l2p_tbl: %d\n", seg_no); Signed-off-by: Andrea della Porta <sfaragnaus@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23staging: rts5208: Replace a bit shift by a use of BIT.Arushi Singhal1-2/+2
This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09staging: rts5208: Remove unnecessary cast on void pointersimran singhal1-2/+1
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03staging: rts5208: remove unncessary result set and check, just return SUCCESSColin Ian King1-4/+2
Minor clean up, there is no need to assign result to zero, then check if it is less than zero. Just return SUCCESS. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-03staging: rts5208: remove redundant retval status checkColin Ian King1-6/+0
The retval status checks in the proceeding do loop return out of function ms_read_attritbute_info if there is an error condition, thus we never reach the end of the loop with retval failed status. Therefore, the retval status check at end of the do loop is redundant and can be removed. Detected with CoverityScan, CID#143000 ("Logically dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-16drivers: staging: rts5208: fix endianness handlingOmri Arad1-2/+2
'cb' and 'sgb' were assigned __le values but were not marked as such, this fixes the following sparse warnings: drivers/staging/rts5208/rtsx_transport.c:220:34: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:220:34: expected unsigned int [unsigned] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:220:34: got restricted __le32 [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:319:44: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:319:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:319:44: got restricted __le64 [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:319:44: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:319:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:319:44: got restricted __le64 [usertype] <noident> Signed-off-by: Omri Arad <omriarad3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25staging: rts5208: rtsx.c: Fix invalid use of sizeof in rtsx_probe()Wei Yongjun1-1/+1
sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Fixes: 2eb9d8cbb3c3 ("staging: rts5208: rtsx.c: Alloc sizeof struct") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: Alignment fixWayne Porter1-3/+4
Line goes too long when aligned with parenthesis, so moved to a new line Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx_chip.c: Long linesWayne Porter1-7/+10
Fix lines that go over 80 characters to stop warnings from checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtxs_chip.h: Long linesWayne Porter1-6/+10
Move comments above long definitions so they don't go over 80 characters Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx_scsi.h: Long linesWayne Porter1-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>
2016-10-16staging: rts5208: CamelCase fixWayne Porter1-2/+2
Change label to not use camel case per checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: ms.c: Braces fixWayne Porter1-2/+2
Add braces to all arms of if statement Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: ms.c: Multiple assignmentsWayne Porter1-1/+2
Fix check found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: ms.c: Long LinesWayne Porter1-31/+63
Fix long lines detected by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: ms.c: Parenthesis alignmentWayne Porter1-138/+150
Fix checkpatch messages: Alignment should match open parenthesis Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: ms.h: Parenthesis alignmentWayne Porter1-2/+2
Fix alignment to match open parenthesis Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: Alloc sizeof structWayne Porter1-1/+1
Satisfy checkpatch message: Prefer kzalloc(sizeof(*dev->chip)...) over kzalloc(sizeof(struct rtsx_chip)...) Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: SpacingWayne Porter1-1/+0
Remove blank line after opening { Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: CamelCaseWayne Porter1-4/+4
Make camel case labels all lowercase Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: SpacingWayne Porter1-1/+4
Add spaces around operator for readability Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: Multiple assignmentsWayne Porter1-2/+4
Fix multiple assignments found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: AlignmentWayne Porter1-2/+2
Fix to match open parenthesis in order to satisfy checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: rtsx.c: Unnecessary parenthesesWayne Porter1-5/+5
Remove parentheses found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Comparison to NULLWayne Porter1-1/+1
Fix to resolve checkpatch message Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: SpacingWayne Porter1-1/+1
Adding space around operator for better readability and to stop checkpatch check messages Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Unnecessary parenthesesWayne Porter1-24/+24
Remove parentheses found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Parenthesis alignmentWayne Porter1-20/+22
Fix alignment to stop checkpath check messages Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Unecessary paranthesesWayne Porter1-1/+1
Remove parentheses to stop checkpatch check message Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Parenthesis alignmentWayne Porter1-7/+7
Matching open parenthesis Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Prefer using BIT macroWayne Porter1-15/+15
Replace all instances of (1 << x) with BIT(x) to satisfy checkpatch check messages Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Long lines fixesWayne Porter1-28/+57
Break up long lines in rtsx_chip.h Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Alignment fixesWayne Porter1-3/+3
Fix alignment issues that checkpatch found Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Add space around operatorWayne Porter1-1/+1
Spaces are preferred around operators for readability Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Add braces to if()Wayne Porter1-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>
2016-10-16staging: rts5208: Remove multiple assignmentWayne Porter1-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>
2016-10-16staging: rts5208: CamelCase fixesWayne Porter1-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>
2016-10-16staging: rts5208: Remove parenthesesWayne Porter1-23/+23
Unnecessary parentheses found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Alignment fixesWayne Porter1-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>
2016-10-16staging: rts5208: Fix typo in function nameWayne Porter1-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>
2016-10-16staging: rts5208: Alignment fixWayne Porter1-2/+2
Fix issue found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Unnecessary parentheses cleanupWayne Porter1-2/+2
Remove parentheses found by checkpatch Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: Alignment fixesWayne Porter1-13/+17
Cleaning up checkpatch issues Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: sd.c: Spacing cleanupWayne Porter1-4/+3
Add/remove spaces to make things more readable Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: sd.c: Fix logical continuationsWayne Porter1-15/+15
Checkpatch detected && at the beginning of new lines Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: rts5208: sd.c: CamelCase fixesWayne Porter1-84/+84
Convert camel case lables to all lowercase Signed-off-by: Wayne Porter <wporter82@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>