Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2292412img; Wed, 27 Feb 2019 14:01:22 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibko1sNFGTnKlUg/bnyyKRhBZmKVC4hJlUfds8bueqaAjItrGvFkH36yhPxN2j1gRrdW9Z7 X-Received: by 2002:a17:902:b087:: with SMTP id p7mr4447778plr.56.1551304882514; Wed, 27 Feb 2019 14:01:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551304882; cv=none; d=google.com; s=arc-20160816; b=pJf61LxYs8yoAM+ieJ2nrl6R1bfeknvMLqUavrXN7NRzAVRbnhkFcbAjF94ywCiUr2 rG3wIQxNaPxl/NPZNLJr4lN3pysqCqINTeabsTxL4B3bg8bkttEgp0c+gpg782WKlgTx pA/lLRNERDy7qYsvJUmPVB8DWt2FVxFXB46sUyQzR++fjNIATEOavnpi8PIaDQvOjnTQ 0Kh3ShgFn+Ih17heTbo68fLjYeeDoVxONqsal/tZI1fsZbDEXsc20CysvUWfEQhAy40O 2sLxVA6nwBNicS0knHGmF3g0ajmv5jVC0wV3ETX5DmcKeOk7iOyS7fLFlI8VFqovnefc HGKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4U+eutgYcfnQ4sasqs16BIHjgIczLfK4EI7YAHB+5wM=; b=lw2lctDDY0XOVJb8StDbENZix8PZ+5P8xX5dUcOMdR/rOAujjQ3Gfi6QKYHfgVWV3h 5zhhDt2Ad2ru6swS1PIeBvNTg+tPCFHxqlJQ41AGYzsLU3o/C/XcSpNfw4E42DHm/aDD tlZEm+KZI2C45klMHSgfqkOcM6xP/rLGxRAl08XVQ9lFKRIvE3d8Sx6cw614aV3hUz9g 9zX+65bAb4dVaD3T9mPsm++xpoZGr+SRu1a5VhEaTHpgS0agf76Hx7a7mU1UI5sl4tcP axkfHrysCN/Uf+a+8d5Jpa67b++YQcZloIvplo53v0AtXRSpxrrzpRvZDGZfEqX8VNsB BjlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qhr3x8mW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s184si10883776pgs.279.2019.02.27.14.01.06; Wed, 27 Feb 2019 14:01:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qhr3x8mW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730139AbfB0WAi (ORCPT + 99 others); Wed, 27 Feb 2019 17:00:38 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:32805 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbfB0WAi (ORCPT ); Wed, 27 Feb 2019 17:00:38 -0500 Received: by mail-pg1-f195.google.com with SMTP id h11so8628691pgl.0 for ; Wed, 27 Feb 2019 14:00:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4U+eutgYcfnQ4sasqs16BIHjgIczLfK4EI7YAHB+5wM=; b=Qhr3x8mW0tBub8O8iY+qOOD7fZsAm2y4APcxWHZIGVlWRnQJ/5OnVrq9u1cjgpcCGf wURI4J5SAunoPvVDHEAvll2eDaLhHIlJg1wSiQzFxfyFcHXreHOWWQ405at1TCpst1bz fhzP3Zlm+h4WpLobRUvj98q0fOz2DqD2k6OwesOD3pSE7TEjNUYZAatU/YMFvH3IJ3ix olPJ9btgrDCTq2/JceaVgJGaOpq1r1VT5o0eMgXcv3B9N0q2SVTMWDVkYW0U1MiuMQbJ guZQ+Djtyif2nCxaygm8pFyNYUTvxBVlv/PDSsyBegcNMLC3mTBdfsvAEL3kPz5BaUTz Ul/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4U+eutgYcfnQ4sasqs16BIHjgIczLfK4EI7YAHB+5wM=; b=g8WW7QhYf710Fe61LpSU0UUx8DT4doPUvH3RvNeyn/bHG5FnRESUvQiEEtHDe0RQgn /hKZeF/PppAiCLU5aN4oOVLWx+oX+9UvlH7G7k+EWOdBeStWYsVE0CkGlkwlQka8mc09 dfaGQTSu8dqS/LRcd995j2aKjB2WNusVHs1I+1kE/y7pNc6Cd5PqrIKEBFoWojaQrNvN NsR5K75gI2CLxgL8aYx2AU5ji0cbSmSOCKTu3SoAsBpixK93SVCwbNC8btNlYATpCjUF DbZBhLJnhyCjiN6edJIMrbGkP1T/QvmaoD7SPfyufSxOHSShoSFqrU/TMB+5ao2D7k4R vCBw== X-Gm-Message-State: AHQUAub3a6j9XtvdhjWK2rOFaNldX+MzNp80Q00Gc0Um52h1rtP+cIgD VBhzWIMHrtVmXoFs7wfWbKW0N5PidKlZHaXDAKglXg== X-Received: by 2002:a62:a113:: with SMTP id b19mr3877764pff.227.1551304836926; Wed, 27 Feb 2019 14:00:36 -0800 (PST) MIME-Version: 1.0 References: <20190227202202.21817-1-louis@kragniz.eu> In-Reply-To: <20190227202202.21817-1-louis@kragniz.eu> From: Nick Desaulniers Date: Wed, 27 Feb 2019 14:00:25 -0800 Message-ID: Subject: Re: [PATCH] cifs: use correct format characters To: Louis Taylor Cc: sfrench@samba.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, LKML , clang-built-linux@googlegroups.com, Jon Flatley , =?UTF-8?Q?Matthias_M=C3=A4nnich?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 27, 2019 at 12:23 PM Louis Taylor wrote: > > When compiling with -Wformat, clang emits the following warnings: > > fs/cifs/smb1ops.c:312:20: warning: format specifies type 'unsigned > short' but the argument has type 'unsigned int' [-Wformat] > tgt_total_cnt, total_in_tgt); > ^~~~~~~~~~~~ Thanks for the patch! This one fails a small sanity check and needs a revision: So 1 warning in fs/cifs/smb1ops.c, but 2 fixes? > > fs/cifs/cifs_dfs_ref.c:289:4: warning: format specifies type 'short' > but the argument has type 'int' [-Wformat] > ref->flags, ref->server_type); > ^~~~~~~~~~ > > fs/cifs/cifs_dfs_ref.c:289:16: warning: format specifies type 'short' > but the argument has type 'int' [-Wformat] > ref->flags, ref->server_type); > ^~~~~~~~~~~~~~~~ > > fs/cifs/cifs_dfs_ref.c:291:4: warning: format specifies type 'short' > but the argument has type 'int' [-Wformat] > ref->ref_flag, ref->path_consumed); > ^~~~~~~~~~~~~ > > fs/cifs/cifs_dfs_ref.c:291:19: warning: format specifies type 'short' > but the argument has type 'int' [-Wformat] > ref->ref_flag, ref->path_consumed); > ^~~~~~~~~~~~~~~~~~ > The types of these arguments are unconditionally defined, so this patch > updates the format character to the correct ones for ints and unsigned > ints. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Signed-off-by: Louis Taylor > --- > fs/cifs/cifs_dfs_ref.c | 4 ++-- > fs/cifs/smb1ops.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c > index d9b99abe1243..5d83c924cc47 100644 > --- a/fs/cifs/cifs_dfs_ref.c > +++ b/fs/cifs/cifs_dfs_ref.c > @@ -285,9 +285,9 @@ static void dump_referral(const struct dfs_info3_param *ref) > { > cifs_dbg(FYI, "DFS: ref path: %s\n", ref->path_name); > cifs_dbg(FYI, "DFS: node path: %s\n", ref->node_name); > - cifs_dbg(FYI, "DFS: fl: %hd, srv_type: %hd\n", > + cifs_dbg(FYI, "DFS: fl: %d, srv_type: %d\n", > ref->flags, ref->server_type); > - cifs_dbg(FYI, "DFS: ref_flags: %hd, path_consumed: %hd\n", > + cifs_dbg(FYI, "DFS: ref_flags: %d, path_consumed: %d\n", > ref->ref_flag, ref->path_consumed); > } > > diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c > index 32a6c020478f..52e1ae6744de 100644 > --- a/fs/cifs/smb1ops.c > +++ b/fs/cifs/smb1ops.c > @@ -300,7 +300,7 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr) > tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount); > > if (tgt_total_cnt != src_total_cnt) > - cifs_dbg(FYI, "total data count of primary and secondary t2 differ source=%hu target=%hu\n", > + cifs_dbg(FYI, "total data count of primary and secondary t2 differ source=%hu target=%u\n", > src_total_cnt, tgt_total_cnt); This one is not correct; while you'd be forgiven for confusing the case here `tgt_total_cnt` with `total_in_tgt` below, the above hunk is not correct. `tgt_total_cnt` is an instance of a `__u16`. Please resend with this hunk dropped. The other hunks look correct. > > total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount); > @@ -308,7 +308,7 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr) > remaining = tgt_total_cnt - total_in_tgt; > > if (remaining < 0) { > - cifs_dbg(FYI, "Server sent too much data. tgt_total_cnt=%hu total_in_tgt=%hu\n", > + cifs_dbg(FYI, "Server sent too much data. tgt_total_cnt=%hu total_in_tgt=%u\n", > tgt_total_cnt, total_in_tgt); > return -EPROTO; > } > -- > 2.20.1 > -- Thanks, ~Nick Desaulniers