Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4759333pxy; Tue, 27 Apr 2021 11:56:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7WJSLXEsiO3GerAYRd6DsLuKqJiBMeXv0vSlZJ4VpKfzDX26tJMdjsVjMjg6ksUhIi4PW X-Received: by 2002:aa7:c1c9:: with SMTP id d9mr6155866edp.155.1619549765584; Tue, 27 Apr 2021 11:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619549765; cv=none; d=google.com; s=arc-20160816; b=K10Qo4TqPFGcvxMdNWAw1Q8SRyTf+cTvzXTF3qxFUSQNJY+Dm5ty3REvaoK8O+m31b Cbr4Z33jzls0i1cu8iq0p6RAB2pk8rUCjBLMzeVkcfhg3bVjXcwHzoJGBd7XRo3QLmEK kujP0GCpKqXz78rMmnbTeZFB047EEZzfIBh2TC/0ZSuquJB1+YQHCtrBYjDksOP5lkkh F1P9fiGfTKyGgxJdws3UlXW6zyYe4iOp39x0qoCEy6IZF60K7aBl437rPPQNqrY9nVKp eOoZPn7ntOZznrKYW9/jxYkPkwWgHQ+2A3PnHz20aFq/PjYrz6IxyNiPJgYxF87IrLMm aUpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yPFimr3gWw7Jb8pUUshKa57KI8HC4i9N5TDaJMgan8c=; b=EOrGYgbiC/B09f64FLRik7Jjr2FkSaiFkRDfKq2HTiick1zjypzXbVCwFB4DfPqWKF 888J7i7kjMnTVuHfzp36J+NFVDhNcCvAajQrw1ypR0adKusDV4GTR3tX6IAj0NTULXUH fQVypa4McM5g3u8z5j4JqDbwBNxaGmeIMV4evoo6PLOFGm66qeWxJw2esENlZO0Pg0xO 8YbeifM3hesxG80Cr1JsK+eauR3AmeeFrzHvll4Vn7aVoSRnoSCoh5QpuiAQ0oaA/Etw +q3QoIbwqUXMurc6o09E3BYYiBb0/5iCa4yU7FStfLnDyzOpzo5PQDw02u0rFpoImAvy fNOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vxhki8lg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d4si3009167edy.533.2021.04.27.11.55.42; Tue, 27 Apr 2021 11:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Vxhki8lg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236962AbhD0SzT (ORCPT + 99 others); Tue, 27 Apr 2021 14:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236889AbhD0SzQ (ORCPT ); Tue, 27 Apr 2021 14:55:16 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C2FCC061574 for ; Tue, 27 Apr 2021 11:54:30 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id d15so18143140ljo.12 for ; Tue, 27 Apr 2021 11:54:30 -0700 (PDT) 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=yPFimr3gWw7Jb8pUUshKa57KI8HC4i9N5TDaJMgan8c=; b=Vxhki8lggKUqdFDQ6eIME/t1w216q7NYR8YXdlh83bNCmievHFJ2KZzm1xLcUbOzvX e5EFqL3S3XC/ku0z5FV7YGwMQe+gmv6mXWY6NK9A8SLs4L3CgMn7lanF369p5IvX/wP+ cVELa+9rHfODxiUiv6vwOq3AFIDnelHyK+zAKiyhNh1rEhcd0XRiEBV6uCg3CfRgnwrT IGzwKlMhSvON8Fls70IESsAel3rAffgnqhwEiBaYZarsi2ZqqdjojMD1pvwTBCQleLJM WjnaDedTcdOnnTZV4Gq9PdWwWsu8dhGu/FCHve5kn8fKUnCkjTvzcamU7L50DG/cI9Rl uYRA== 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=yPFimr3gWw7Jb8pUUshKa57KI8HC4i9N5TDaJMgan8c=; b=WUYeMKDOBTKY5KYgqXOSVvXwWipzGimwBHnzO4cyaXmVMwiXsPpW4PW9jlhCZVvEVH pescflY/FLCNbczBDvwSc4Nr2uBbvPk8jroi9Kjmk77+D/RU/Xm/B3aL27hy3nXfiQLr a/oaftcBynA3BF7+j7T6Y8RXCMciEi1f31ROOPekS/3UpV/vedSOagp+Ak+ZXdVxbvmo a88alXx6VqWvWlaxLVtqdgYWiFoBN4LsUI9GU/3DuZDuKo3j3pB0F7ASBVGIPVyS3XMe xnFJhi0o/taKt4cF/8mZ3l2XRSGA5k37KUfw85owWI9lNiS+KpE4zrAYfbQxwEPEAtYV Z/mQ== X-Gm-Message-State: AOAM5301nEpB01M6S2zmBd4HGCZ502II2cokGSXlnjJ3imEZEFVPtEpS hrP3aBF81QWSWMURMwjN8uTiptUFXMQQubTvvfzlrw== X-Received: by 2002:a2e:9015:: with SMTP id h21mr17225853ljg.233.1619549668748; Tue, 27 Apr 2021 11:54:28 -0700 (PDT) MIME-Version: 1.0 References: <1619345754-32875-1-git-send-email-yang.lee@linux.alibaba.com> In-Reply-To: <1619345754-32875-1-git-send-email-yang.lee@linux.alibaba.com> From: Nick Desaulniers Date: Tue, 27 Apr 2021 11:54:17 -0700 Message-ID: Subject: Re: [PATCH] fs/ntfs: drop unneeded assignment in ntfs_perform_write() To: Yang Li Cc: Anton Altaparmakov , Nathan Chancellor , linux-ntfs-dev@lists.sourceforge.net, LKML , clang-built-linux , Nathan Huckleberry Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 25, 2021 at 3:16 AM Yang Li wrote: > > It is not required to initialize the local variable idx in > ntfs_perform_write(), the value is never actually read from > it. > > make clang-analyzer on x86_64 allyesconfig reports: > > fs/ntfs/file.c:1781:15: warning: Although the value stored to 'idx' is > used in the enclosing expression, the value is never actually read from > 'idx' > > Simplify the code and remove unneeded assignment to make clang-analyzer > happy. Thank you for the patch. Reviewed-by: Nick Desaulniers Is there someplace where I can learn more about "Abaci Robot?" I'm happy to see it running clang-analyzer. :) > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > fs/ntfs/file.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c > index e5aab26..e39a26f 100644 > --- a/fs/ntfs/file.c > +++ b/fs/ntfs/file.c > @@ -1774,11 +1774,11 @@ static ssize_t ntfs_perform_write(struct file *file, struct iov_iter *i, > last_vcn = -1; > do { > VCN vcn; > - pgoff_t idx, start_idx; > + pgoff_t start_idx; > unsigned ofs, do_pages, u; > size_t copied; > > - start_idx = idx = pos >> PAGE_SHIFT; > + start_idx = pos >> PAGE_SHIFT; > ofs = pos & ~PAGE_MASK; > bytes = PAGE_SIZE - ofs; > do_pages = 1; > -- > 1.8.3.1 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/1619345754-32875-1-git-send-email-yang.lee%40linux.alibaba.com. -- Thanks, ~Nick Desaulniers