]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/cifs-use-correct-format-characters.patch
ed403fa859756026a85548a2b1855fcee62d7ef9
[thirdparty/kernel/stable-queue.git] / queue-4.19 / cifs-use-correct-format-characters.patch
1 From 94acb9c9d7b2773c49a7326f73b39b7c32bf193b 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 6b61df117fd4..563e2f6268c3 100644
51 --- a/fs/cifs/cifs_dfs_ref.c
52 +++ b/fs/cifs/cifs_dfs_ref.c
53 @@ -271,9 +271,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 378151e09e91..47db8eb6cbcf 100644
67 --- a/fs/cifs/smb1ops.c
68 +++ b/fs/cifs/smb1ops.c
69 @@ -308,7 +308,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