Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4209098ybf; Tue, 3 Mar 2020 22:54:57 -0800 (PST) X-Google-Smtp-Source: ADFU+vuYdLeU2CmjgIEavvGfltl4T2Fo13Bq7KqktDATGPxsi+M8sd5kBd+RZ+H83r25VkUUsKDx X-Received: by 2002:aca:ac86:: with SMTP id v128mr791984oie.178.1583304897375; Tue, 03 Mar 2020 22:54:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583304897; cv=none; d=google.com; s=arc-20160816; b=t7WRREF4szBQJQGqpGsGWTrl4RC4FtJP+sAQgkSCa9GlFAJ63Z4UwONlEYPqEMQ/YI zkMZ/FVAI7+qa6vYhcTrwa7Wo7NN9WLppRVamYYhGkDwc+Vb+S6/QTDI0AB3bmJ2BWJj m9oXf3ikZ/Fv/sgpLAcQxB+B2bT5lCqlAKP0ByhSs8Vx7oBFtbCQ6kzo3D4+KHjo8xpy 98Y910QisWI9jq9QLJmwLROxwAqoHHT225VdJfs7F4lQA4C5qEjlAhw4+gaeC/Fj5vEM Z8tX5zwQwG4ShkfRbAcaa0oaUlz4ydgriCN6zJOV5YHts2Pj1RIjWY2P8luJ2zhMFhoH w6ng== 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=pL5/NIk1WWlkMiptdFdVT6f4DEpBMO2Ea9hV7O9FFZ8=; b=dXoBTdmsQIZeubFRirg+0keo6qhpcPU4AUaTDoUZvPVHahtRc2uh3EcdIukBpmLonH Cp0uAkh79L3xxdVYp77GJ6KTRWapqvYYUttQgpKhqRqn/wB0BYDc4V3dJ04j1t40AnG2 BdWavAtxqnFXDKnMt1LwU0dSEV9e065o6lVYQSXwJpoKQ/9DEU3lwKtH+WOYSPQIqAU9 5WILvq8KvfCp5fIUgr2JG9zW9JoFPhmu1SSQgnfNesY/xo9QrY/cLIzvukxR1FEmN2ds bh+U+1mb7l4jrpMUXxvTZVKZ+2+PQV/xJmkCYMdMU4+uGGasDjPQSyRiLT+y3i8Nc7zQ v+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M4hSOtOD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si551018otl.83.2020.03.03.22.54.45; Tue, 03 Mar 2020 22:54:57 -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=@gmail.com header.s=20161025 header.b=M4hSOtOD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728475AbgCDGx2 (ORCPT + 99 others); Wed, 4 Mar 2020 01:53:28 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:41906 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726957AbgCDGx2 (ORCPT ); Wed, 4 Mar 2020 01:53:28 -0500 Received: by mail-il1-f194.google.com with SMTP id q13so897612ile.8; Tue, 03 Mar 2020 22:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pL5/NIk1WWlkMiptdFdVT6f4DEpBMO2Ea9hV7O9FFZ8=; b=M4hSOtODII7mizcjKB/B4luuRboPGxO2AiYJ6R/Am+xbZ6Bo5nSNCut2W43ABHcYOG KUgpPAmS+/TKUY3WHauUqWVJaTz+tZthcFwEjv1+WOPKtJh5nmp2lwxbqav1grzN4q5J YqEKcYNBJy4HMWKVWv3s6x8ISVYBB8LYURCscgUGkqDdLFpDi+xXgGtUYFziA4Vc2NGr R01Ir2imRORlTcAC2VMDEuXGEd6P8UPT30xYvLCjgdZd2W3ONH2aG2DdFAmHYdcBZyay yPcFhQDFcPLKoY3/cWpdhUUXmgyaB8pU0MGI/2s7NUPDsS5lO3FuB8BUA4sMBx3nlrby 8t5g== 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=pL5/NIk1WWlkMiptdFdVT6f4DEpBMO2Ea9hV7O9FFZ8=; b=TUBqRwD/b2D2HtBUvhcfFuiwZd/wtypmvJUljGmmF4DP4o4AiXHl8BhaC8KcN11/1E b9Ccznn6/2DJhE/ImsGFDaQXRfRmT0AVL7Tyn470KE+lVZhme4zFHX+h1u42t1CwQEf+ ub0x1/GRQSHZ3DYOHFa6ZT5bFjaVtA1s9KNU8xyvuo2j4JEDKDRM7KExz1uxpcfZL/qy 2UdMcY0AAUMJABfkE8zBhcJ1c8S+aoSVSPzGFH5oi/AOfzYxGLPkDeTjMPX2tPvc4B95 mklF7YGaUzI/o8a5zhCr3CHpyNyWJehwqxiVpXKysuLHil+ZFGZWhTLPBXUVQXCqhXzt DPtQ== X-Gm-Message-State: ANhLgQ3Jc1kSN3dCqp5M85Q2iE1qgiTWSnEfGItXAAM2Z8fZrVPzK/R9 gV+xdShmN7QVHxQedQtgcGzMEUMN00HMUX5my3WmsDIr X-Received: by 2002:a05:6e02:ea8:: with SMTP id u8mr903581ilj.0.1583304807491; Tue, 03 Mar 2020 22:53:27 -0800 (PST) MIME-Version: 1.0 References: <1583278783-11584-1-git-send-email-hqjagain@gmail.com> In-Reply-To: From: Qiujun Huang Date: Wed, 4 Mar 2020 14:53:16 +0800 Message-ID: Subject: Re: [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc' To: Steve French Cc: Steve French , CIFS , samba-technical , LKML 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, Mar 4, 2020 at 2:23 PM Steve French wrote: > > Isn't it not used because of a potential bug - missing returning an > error in two cases. I get it, thanks. > > If we leave the two lines you removed in - and set rc=0 in its > declaration (and return rc at the end as you originally had suggested) > - doesn't that solve the problem? A minor modification to your first > proposed patch? ok, I'll send v2. > > On Tue, Mar 3, 2020 at 5:39 PM Qiujun Huang wrote: > > > > It is set but not used, So can be removed. > > > > Signed-off-by: Qiujun Huang > > --- > > fs/cifs/cifsacl.c | 3 --- > > 1 file changed, 3 deletions(-) > > > > diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c > > index 716574a..1cf3916 100644 > > --- a/fs/cifs/cifsacl.c > > +++ b/fs/cifs/cifsacl.c > > @@ -342,7 +342,6 @@ > > sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid, > > struct cifs_fattr *fattr, uint sidtype) > > { > > - int rc; > > struct key *sidkey; > > char *sidstr; > > const struct cred *saved_cred; > > @@ -403,7 +402,6 @@ > > saved_cred = override_creds(root_cred); > > sidkey = request_key(&cifs_idmap_key_type, sidstr, ""); > > if (IS_ERR(sidkey)) { > > - rc = -EINVAL; > > cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n", > > __func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g'); > > goto out_revert_creds; > > @@ -416,7 +414,6 @@ > > */ > > BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t)); > > if (sidkey->datalen != sizeof(uid_t)) { > > - rc = -EIO; > > cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n", > > __func__, sidkey->datalen); > > key_invalidate(sidkey); > > -- > > 1.8.3.1 > > > > > -- > Thanks, > > Steve