]>
Commit | Line | Data |
---|---|---|
9a904337 SL |
1 | From bef812c8083e5c7932a1d8ac031bac437341105e Mon Sep 17 00:00:00 2001 |
2 | From: Louis Taylor <louis@kragniz.eu> | |
3 | Date: Wed, 27 Feb 2019 22:25:15 +0000 | |
4 | Subject: cifs: use correct format characters | |
5 | ||
6 | [ Upstream commit 259594bea574e515a148171b5cd84ce5cbdc028a ] | |
7 | ||
8 | When compiling with -Wformat, clang emits the following warnings: | |
9 | ||
10 | fs/cifs/smb1ops.c:312:20: warning: format specifies type 'unsigned | |
11 | short' but the argument has type 'unsigned int' [-Wformat] | |
12 | tgt_total_cnt, total_in_tgt); | |
13 | ^~~~~~~~~~~~ | |
14 | ||
15 | fs/cifs/cifs_dfs_ref.c:289:4: warning: format specifies type 'short' | |
16 | but the argument has type 'int' [-Wformat] | |
17 | ref->flags, ref->server_type); | |
18 | ^~~~~~~~~~ | |
19 | ||
20 | fs/cifs/cifs_dfs_ref.c:289:16: warning: format specifies type 'short' | |
21 | but the argument has type 'int' [-Wformat] | |
22 | ref->flags, ref->server_type); | |
23 | ^~~~~~~~~~~~~~~~ | |
24 | ||
25 | fs/cifs/cifs_dfs_ref.c:291:4: warning: format specifies type 'short' | |
26 | but the argument has type 'int' [-Wformat] | |
27 | ref->ref_flag, ref->path_consumed); | |
28 | ^~~~~~~~~~~~~ | |
29 | ||
30 | fs/cifs/cifs_dfs_ref.c:291:19: warning: format specifies type 'short' | |
31 | but the argument has type 'int' [-Wformat] | |
32 | ref->ref_flag, ref->path_consumed); | |
33 | ^~~~~~~~~~~~~~~~~~ | |
34 | The types of these arguments are unconditionally defined, so this patch | |
35 | updates the format character to the correct ones for ints and unsigned | |
36 | ints. | |
37 | ||
38 | Link: https://github.com/ClangBuiltLinux/linux/issues/378 | |
39 | ||
40 | Signed-off-by: Louis Taylor <louis@kragniz.eu> | |
41 | Signed-off-by: Steve French <stfrench@microsoft.com> | |
42 | Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> | |
43 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
44 | --- | |
45 | fs/cifs/cifs_dfs_ref.c | 4 ++-- | |
46 | fs/cifs/smb1ops.c | 2 +- | |
47 | 2 files changed, 3 insertions(+), 3 deletions(-) | |
48 | ||
49 | diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c | |
50 | index b8602f199815..71263ea90810 100644 | |
51 | --- a/fs/cifs/cifs_dfs_ref.c | |
52 | +++ b/fs/cifs/cifs_dfs_ref.c | |
53 | @@ -265,9 +265,9 @@ static void dump_referral(const struct dfs_info3_param *ref) | |
54 | { | |
55 | cifs_dbg(FYI, "DFS: ref path: %s\n", ref->path_name); | |
56 | cifs_dbg(FYI, "DFS: node path: %s\n", ref->node_name); | |
57 | - cifs_dbg(FYI, "DFS: fl: %hd, srv_type: %hd\n", | |
58 | + cifs_dbg(FYI, "DFS: fl: %d, srv_type: %d\n", | |
59 | ref->flags, ref->server_type); | |
60 | - cifs_dbg(FYI, "DFS: ref_flags: %hd, path_consumed: %hd\n", | |
61 | + cifs_dbg(FYI, "DFS: ref_flags: %d, path_consumed: %d\n", | |
62 | ref->ref_flag, ref->path_consumed); | |
63 | } | |
64 | ||
65 | diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c | |
66 | index b0f973b2b189..2a43aa6d8e87 100644 | |
67 | --- a/fs/cifs/smb1ops.c | |
68 | +++ b/fs/cifs/smb1ops.c | |
69 | @@ -305,7 +305,7 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr) | |
70 | remaining = tgt_total_cnt - total_in_tgt; | |
71 | ||
72 | if (remaining < 0) { | |
73 | - cifs_dbg(FYI, "Server sent too much data. tgt_total_cnt=%hu total_in_tgt=%hu\n", | |
74 | + cifs_dbg(FYI, "Server sent too much data. tgt_total_cnt=%hu total_in_tgt=%u\n", | |
75 | tgt_total_cnt, total_in_tgt); | |
76 | return -EPROTO; | |
77 | } | |
78 | -- | |
79 | 2.19.1 | |
80 |