]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.34/cifs-use-correct-format-characters.patch
Linux 4.19.34
[thirdparty/kernel/stable-queue.git] / releases / 4.19.34 / cifs-use-correct-format-characters.patch
CommitLineData
ba172962
SL
1From 94acb9c9d7b2773c49a7326f73b39b7c32bf193b Mon Sep 17 00:00:00 2001
2From: Louis Taylor <louis@kragniz.eu>
3Date: Wed, 27 Feb 2019 22:25:15 +0000
4Subject: cifs: use correct format characters
5
6[ Upstream commit 259594bea574e515a148171b5cd84ce5cbdc028a ]
7
8When compiling with -Wformat, clang emits the following warnings:
9
10fs/cifs/smb1ops.c:312:20: warning: format specifies type 'unsigned
11short' but the argument has type 'unsigned int' [-Wformat]
12 tgt_total_cnt, total_in_tgt);
13 ^~~~~~~~~~~~
14
15fs/cifs/cifs_dfs_ref.c:289:4: warning: format specifies type 'short'
16but the argument has type 'int' [-Wformat]
17 ref->flags, ref->server_type);
18 ^~~~~~~~~~
19
20fs/cifs/cifs_dfs_ref.c:289:16: warning: format specifies type 'short'
21but the argument has type 'int' [-Wformat]
22 ref->flags, ref->server_type);
23 ^~~~~~~~~~~~~~~~
24
25fs/cifs/cifs_dfs_ref.c:291:4: warning: format specifies type 'short'
26but the argument has type 'int' [-Wformat]
27 ref->ref_flag, ref->path_consumed);
28 ^~~~~~~~~~~~~
29
30fs/cifs/cifs_dfs_ref.c:291:19: warning: format specifies type 'short'
31but the argument has type 'int' [-Wformat]
32 ref->ref_flag, ref->path_consumed);
33 ^~~~~~~~~~~~~~~~~~
34The types of these arguments are unconditionally defined, so this patch
35updates the format character to the correct ones for ints and unsigned
36ints.
37
38Link: https://github.com/ClangBuiltLinux/linux/issues/378
39
40Signed-off-by: Louis Taylor <louis@kragniz.eu>
41Signed-off-by: Steve French <stfrench@microsoft.com>
42Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
43Signed-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
49diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
50index 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
65diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
66index 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--
792.19.1
80