diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-04-24 14:34:13 -0400 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2019-04-25 05:18:27 -0400 |
commit | 37209783c73a47692dbf1e6b2dba0d07f6ce24b3 (patch) | |
tree | e51643416b7bfbb94380d1d53eed798507efa7bd | |
parent | c4630d6ae6e33b76fedde5c15bdfc7fa579eac32 (diff) |
thunderbolt: Make priority unsigned in struct tb_path
Clang warns:
drivers/thunderbolt/tunnel.c:504:17: warning: implicit truncation from
'int' to bit-field changes value from 5 to -3
[-Wbitfield-constant-conversion]
path->priority = 5;
^ ~
1 warning generated.
The priority member in struct tb_path is only ever assigned a positive
number:
$ rg -n priority drivers/thunderbolt/path.c
drivers/thunderbolt/tunnel.c:99: path->priority = 3;
drivers/thunderbolt/tunnel.c:308: path->priority = 2;
drivers/thunderbolt/tunnel.c:323: path->priority = 1;
drivers/thunderbolt/tunnel.c:504: path->priority = 5;
Furthermore, that value is only assigned to an unsigned integer in
tb_path_activate (the priority member in struct tb_regs_hop).
Fixes: 44242d6c9703 ("thunderbolt: Add support for DMA tunnels")
Link: https://github.com/ClangBuiltLinux/linux/issues/454
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
-rw-r--r-- | drivers/thunderbolt/tb.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index 15d225dcb403..b12c8f33d89c 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h | |||
@@ -225,7 +225,7 @@ struct tb_path { | |||
225 | enum tb_path_port ingress_fc_enable; | 225 | enum tb_path_port ingress_fc_enable; |
226 | enum tb_path_port egress_fc_enable; | 226 | enum tb_path_port egress_fc_enable; |
227 | 227 | ||
228 | int priority:3; | 228 | unsigned int priority:3; |
229 | int weight:4; | 229 | int weight:4; |
230 | bool drop_packages; | 230 | bool drop_packages; |
231 | bool activated; | 231 | bool activated; |