History log of /linux-master/drivers/staging/rts5208/rtsx_transport.c
Revision Date Author Comments
# 18ce31aa 30-Mar-2022 Fabio M. De Francesco <fmdefrancesco@gmail.com>

staging: rts5208: Convert kmap() to kmap_local_page()

The use of kmap() is being deprecated in favor of kmap_local_page()
where it is feasible.

With kmap_local_page(), the mapping is per thread, CPU local and not
globally visible. Therefore rtsx_stor_access_xfer_buf() is a function
where the use of kmap_local_page() in place of kmap() is correctly
suited.

Convert to kmap_local_page() but, instead of open coding it, use the
helpers memcpy_to_page() and memcpy_from_page().

Make a minor change to a comment related to scatter-gather.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220330143331.8306-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8e9521f1 21-Sep-2021 Benjamin Philip <benjamin.philip495@gmail.com>

staging: rts5208: remove unnecessary parentheses in rtsx_transport.c

This commit removes unnecessary parentheses, that have been flagged
by checkpatch.pl in rtsx_transport.c.

Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
Link: https://lore.kernel.org/r/2fdcc64fbfa85482917d229163e4eb6c4094b789.1632209460.git.benjamin.philip495@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# efd5a332 12-Sep-2020 Sebastian Fuentes <sefu1789@gmail.com>

staging: rts5208: rtsx_transport.c: Fix lines ending with parentheses

Addresses checkpatch.pl check "Lines should not end with '('"

Signed-off-by: Sebastian Fuentes <sefu1789@gmail.com>
Link: https://lore.kernel.org/r/20200912060741.GA6274@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 54c4f6f8 01-Aug-2020 Tomer Samara <tomersamara98@gmail.com>

staging: rts5208: clear alignment style issues

Clear checkpatch alignment style issues in rtsx_transport.c.
CHECK: Alignment should match open parenthesis

Signed-off-by: Tomer Samara <tomersamara98@gmail.com>
Link: https://lore.kernel.org/r/20200801210056.GA305272@tsnow
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4f83b7dd 28-Oct-2019 Frank A. Cancio Bello <frank@generalsoftwareinc.com>

staging: rts5208: Fix alignment and a line ending with a '('

checkpatch messaages:
CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
Link: https://lore.kernel.org/r/20191028161401.sjhp6qivm6huxpxm@linux-kernel-dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 20738057 30-Aug-2019 P SAI PRASANTH <saip2823@gmail.com>

staging: rts5208: Fix checkpath warning

This patch fixes the following checkpath warning
in the file drivers/staging/rts5208/rtsx_transport.c:546

WARNING: line over 80 characters
+ option = RTSX_SG_VALID | RTSX_SG_END |
RTSX_SG_TRANS_DATA;

Signed-off-by: P SAI PRASANTH <saip2823@gmail.com>
Link: https://lore.kernel.org/r/20190831034926.GA17810@dell-inspiron
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 21d48f69 30-Aug-2019 Prakhar Sinha <prakharsinha2808@gmail.com>

staging: rts5208: Fixed checkpath warning.

This patch solves the following checkpatch.pl's message in drivers/staging/rts5208/rtsx_transport.c:397.

WARNING: line over 80 characters
+ option = RTSX_SG_VALID | RTSX_SG_END | RTSX_SG_TRANS_DATA;

Signed-off-by: Prakhar Sinha <prakharsinha2808@gmail.com>
Link: https://lore.kernel.org/r/20190830121656.GA2740@MeraComputer
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bb1e6779 22-Oct-2018 Kim Bradley <kim.jamie.bradley@gmail.com>

Staging: rts5208: Add SPDX license tags

Add SPDX license tags to remove checkpatch SPDX warnings.

Signed-off-by: Kim Bradley <kim.jamie.bradley@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c238d7b1 18-Jun-2018 Arnd Bergmann <arnd@arndb.de>

staging: rtsx: remove rtsx_trace() and related code

The driver has rather excessive amount of tracing code, which would be
better done using ftrace. This is obviously not a main feature of the
driver, and it should work just as well without it.

Removing it saves over 1300 lines of code and likely makes the driver
a bit faster by avoiding lots of calls into the timekeeping code.

I came across this while cleaning up the last users of the deprecated
getnstimeofday64() function, of which there is one in the now-removed
get_current_time() function of the rtsx driver that was only used for
tracing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b5d013bc 01-Mar-2018 Arnd Bergmann <arnd@arndb.de>

staging: rts5208: rename SG_END macro

A change to the generic scatterlist code caused a conflict with
the rtsx card reader driver:

In file included from drivers/staging/rts5208/rtsx.h:180,
from drivers/staging/rts5208/rtsx.c:28:
drivers/staging/rts5208/rtsx_chip.h:343: error: "SG_END" redefined [-Werror]

This changes one instance of the driver to prefix SG_END and
related constants.

Fixes: 723fbf563a6a ("lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB encodings")
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>


# e5619b13 04-Mar-2017 simran singhal <singhalsimran0@gmail.com>

staging: rts5208: Remove unnecessary cast on void pointer

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>


# 3331f9cb 14-Jan-2017 Omri Arad <omriarad3@gmail.com>

drivers: staging: rts5208: fix endianness handling

'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>


# 51a47311 25-Feb-2016 Janani Ravichandran <janani.rvchndrn@gmail.com>

staging: rts5208: rtsx_transport.c: Drop void pointer cast

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>


# 040fa221 21-Feb-2016 Bhaktipriya Shridhar <bhaktipriya96@gmail.com>

staging: rts5208: Prefer using BIT macro

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>


# 50dcad2a 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Fix comparisons to NULL

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>


# 69e3bc54 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Remove unnecessary parentheses

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>


# c1a018ee 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Fix label naming convention

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>


# 4961c44e 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Remove extra newlines

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>


# 010c7d2f 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Add spaces around -

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>


# 53374ad2 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Remove spaces after casts

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>


# d1303c1a 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Align to open parenthesis

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>


# 64cfe606 15-Feb-2016 Shaun Ren <shaun.ren@linux.com>

Staging: rts5208: rtsx_transport.c: Cleanup comments

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>


# b3232842 09-Feb-2016 Haneen Mohammed <hamohammed.sa@gmail.com>

Staging: rts5208: remove unnecessary parantheses

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>


# 9a66d05d 09-Feb-2016 Haneen Mohammed <hamohammed.sa@gmail.com>

Staging: rts5208: fix check for dma mapping error

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>


# 031366ea 25-Mar-2015 Joe Perches <joe@perches.com>

staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros

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>


# 5a80ee6f 03-Mar-2015 Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>

staging: rts5208: remove extra parentheses around left bit shift operation

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>


# 9df56d9b 23-Jan-2015 Nicholas Mc Guire <der.herr@hofr.at>

staging: rts5208: use msecs_to_jiffies for timeouts

This is only an API consolidation and should make things more readable

Converting milliseconds to jiffies by val * HZ / 1000 is technically
not wrong but msecs_to_jiffies(val) is the cleaner solution and handles
corner cases correctly.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 87a97931 27-Oct-2014 Surya Seetharaman <surya.seetharaman9@gmail.com>

Staging: rts5028: rtsx_transport.c: fixed a brace coding style issue.

Removed unwanted braces using checkpatch.pl tool.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9fd4af8a 25-Oct-2014 Tina Johnson <tinajohnson.1234@gmail.com>

Staging: rts5208: Removed unnecessary parentheses

Unnecessary parentheses around the right hand side of an assignment
is removed using the following semantic patch:

@@
identifier x,f;
constant C;
@@
(
-x = (f / C );
+x = f / C ;
|
-x = (f % C );
+x = f % C ;
)

Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bf6c0d11 29-Jul-2014 Fabio Falzoi <fabio.falzoi84@gmail.com>

Staging: rts5208: Replace custom macro with dev_dbg

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>


# 1b670705 08-Mar-2014 Keerthimai Janarthanan <keerthimaipb@gmail.com>

staging: rts5208: Fixed line over 80 characters.

Fixes the following checkpatch warning:
WARNING: line over 80 characters.

Signed-off-by: Keerthimai Janarthanan <keerthimaipb@gmail.com>
Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fa590c22 12-Nov-2013 Micky Ching <micky_ching@realsil.com.cn>

staging: rts5208: add support for rts5208 and rts5288

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>