Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thunderbolt: Make __TB_[SW|PORT]_PRINT take const parameters

The printing macros do not modify the passed object so make them
const. While there make tb_route() to take const parameter as well.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

+3 -3
+3 -3
drivers/thunderbolt/tb.h
··· 320 320 return port == upstream_port || port->dual_link_port == upstream_port; 321 321 } 322 322 323 - static inline u64 tb_route(struct tb_switch *sw) 323 + static inline u64 tb_route(const struct tb_switch *sw) 324 324 { 325 325 return ((u64) sw->config.route_hi) << 32 | sw->config.route_lo; 326 326 } ··· 442 442 443 443 #define __TB_SW_PRINT(level, sw, fmt, arg...) \ 444 444 do { \ 445 - struct tb_switch *__sw = (sw); \ 445 + const struct tb_switch *__sw = (sw); \ 446 446 level(__sw->tb, "%llx: " fmt, \ 447 447 tb_route(__sw), ## arg); \ 448 448 } while (0) ··· 453 453 454 454 #define __TB_PORT_PRINT(level, _port, fmt, arg...) \ 455 455 do { \ 456 - struct tb_port *__port = (_port); \ 456 + const struct tb_port *__port = (_port); \ 457 457 level(__port->sw->tb, "%llx:%x: " fmt, \ 458 458 tb_route(__port->sw), __port->port, ## arg); \ 459 459 } while (0)