diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2017-06-06 08:24:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-09 05:42:40 -0400 |
commit | 16a1258af5d8e1bd58e20fc70069f9dd91cc5b34 (patch) | |
tree | f14c370f46f6dd7c2f6a42b2f85382162df0e8de /drivers/thunderbolt | |
parent | 73726380a26fa1ed490f30fccee10ed9da28dc0c (diff) |
thunderbolt: Use const buffer pointer in write operations
These functions should not (and do not) modify the argument in any way
so make it const.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r-- | drivers/thunderbolt/ctl.c | 8 | ||||
-rw-r--r-- | drivers/thunderbolt/ctl.h | 4 | ||||
-rw-r--r-- | drivers/thunderbolt/tb.h | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 1146ff4210a9..1031d97407a8 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c | |||
@@ -273,7 +273,7 @@ static void tb_cfg_print_error(struct tb_ctl *ctl, | |||
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | static void cpu_to_be32_array(__be32 *dst, u32 *src, size_t len) | 276 | static void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len) |
277 | { | 277 | { |
278 | int i; | 278 | int i; |
279 | for (i = 0; i < len; i++) | 279 | for (i = 0; i < len; i++) |
@@ -333,7 +333,7 @@ static void tb_ctl_tx_callback(struct tb_ring *ring, struct ring_frame *frame, | |||
333 | * | 333 | * |
334 | * Return: Returns 0 on success or an error code on failure. | 334 | * Return: Returns 0 on success or an error code on failure. |
335 | */ | 335 | */ |
336 | static int tb_ctl_tx(struct tb_ctl *ctl, void *data, size_t len, | 336 | static int tb_ctl_tx(struct tb_ctl *ctl, const void *data, size_t len, |
337 | enum tb_cfg_pkg_type type) | 337 | enum tb_cfg_pkg_type type) |
338 | { | 338 | { |
339 | int res; | 339 | int res; |
@@ -650,7 +650,7 @@ struct tb_cfg_result tb_cfg_read_raw(struct tb_ctl *ctl, void *buffer, | |||
650 | * | 650 | * |
651 | * Offset and length are in dwords. | 651 | * Offset and length are in dwords. |
652 | */ | 652 | */ |
653 | struct tb_cfg_result tb_cfg_write_raw(struct tb_ctl *ctl, void *buffer, | 653 | struct tb_cfg_result tb_cfg_write_raw(struct tb_ctl *ctl, const void *buffer, |
654 | u64 route, u32 port, enum tb_cfg_space space, | 654 | u64 route, u32 port, enum tb_cfg_space space, |
655 | u32 offset, u32 length, int timeout_msec) | 655 | u32 offset, u32 length, int timeout_msec) |
656 | { | 656 | { |
@@ -695,7 +695,7 @@ int tb_cfg_read(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, | |||
695 | return res.err; | 695 | return res.err; |
696 | } | 696 | } |
697 | 697 | ||
698 | int tb_cfg_write(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, | 698 | int tb_cfg_write(struct tb_ctl *ctl, const void *buffer, u64 route, u32 port, |
699 | enum tb_cfg_space space, u32 offset, u32 length) | 699 | enum tb_cfg_space space, u32 offset, u32 length) |
700 | { | 700 | { |
701 | struct tb_cfg_result res = tb_cfg_write_raw(ctl, buffer, route, port, | 701 | struct tb_cfg_result res = tb_cfg_write_raw(ctl, buffer, route, port, |
diff --git a/drivers/thunderbolt/ctl.h b/drivers/thunderbolt/ctl.h index ba87d6e731dd..83ae54947082 100644 --- a/drivers/thunderbolt/ctl.h +++ b/drivers/thunderbolt/ctl.h | |||
@@ -61,13 +61,13 @@ struct tb_cfg_result tb_cfg_read_raw(struct tb_ctl *ctl, void *buffer, | |||
61 | u64 route, u32 port, | 61 | u64 route, u32 port, |
62 | enum tb_cfg_space space, u32 offset, | 62 | enum tb_cfg_space space, u32 offset, |
63 | u32 length, int timeout_msec); | 63 | u32 length, int timeout_msec); |
64 | struct tb_cfg_result tb_cfg_write_raw(struct tb_ctl *ctl, void *buffer, | 64 | struct tb_cfg_result tb_cfg_write_raw(struct tb_ctl *ctl, const void *buffer, |
65 | u64 route, u32 port, | 65 | u64 route, u32 port, |
66 | enum tb_cfg_space space, u32 offset, | 66 | enum tb_cfg_space space, u32 offset, |
67 | u32 length, int timeout_msec); | 67 | u32 length, int timeout_msec); |
68 | int tb_cfg_read(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, | 68 | int tb_cfg_read(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, |
69 | enum tb_cfg_space space, u32 offset, u32 length); | 69 | enum tb_cfg_space space, u32 offset, u32 length); |
70 | int tb_cfg_write(struct tb_ctl *ctl, void *buffer, u64 route, u32 port, | 70 | int tb_cfg_write(struct tb_ctl *ctl, const void *buffer, u64 route, u32 port, |
71 | enum tb_cfg_space space, u32 offset, u32 length); | 71 | enum tb_cfg_space space, u32 offset, u32 length); |
72 | int tb_cfg_get_upstream_port(struct tb_ctl *ctl, u64 route); | 72 | int tb_cfg_get_upstream_port(struct tb_ctl *ctl, u64 route); |
73 | 73 | ||
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index 61d57ba64035..ba2b85750335 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h | |||
@@ -173,7 +173,7 @@ static inline int tb_port_read(struct tb_port *port, void *buffer, | |||
173 | length); | 173 | length); |
174 | } | 174 | } |
175 | 175 | ||
176 | static inline int tb_port_write(struct tb_port *port, void *buffer, | 176 | static inline int tb_port_write(struct tb_port *port, const void *buffer, |
177 | enum tb_cfg_space space, u32 offset, u32 length) | 177 | enum tb_cfg_space space, u32 offset, u32 length) |
178 | { | 178 | { |
179 | return tb_cfg_write(port->sw->tb->ctl, | 179 | return tb_cfg_write(port->sw->tb->ctl, |