Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2763343pxy; Sun, 25 Apr 2021 03:25:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzljJrt17QX3M2RUw85+fteC/p7254W6+O9mR0YwR3fHv0UtTIrXczahOkpOpGokCFhJK8A X-Received: by 2002:a63:4652:: with SMTP id v18mr12130465pgk.386.1619346354011; Sun, 25 Apr 2021 03:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619346354; cv=none; d=google.com; s=arc-20160816; b=Kq7Eo9QREFjTuktVkB3CrMRwkfnPVLkXGShDfGGQ7P98ILpC8J3UQQML7y+Mgtnkxg Pt3QEQw4foVT2B+hGQQKfh855L58AZ3C/HIZ8pEJ7GUOqGJOf4CqclX72fKJwcb51O87 fjdARbJQLLh8jZhbQxVsdmvIa8U8Naj/UIdxCv5+zHd31qyiJKKD3mBnPO+Juw42fX93 5sA6uPTWf3WwLHYC/StcTEGFJ3b0FwVF2ZlXyw7o/SUVWDjpIlxMGSSaaQynAi9aM23i 2/F2S0ZPxSoOx3fN5//r/K2CcLfveGOO5+qGmayDeso4cvVpWZjwXhUzLfiS90FFYfGZ oipQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=wnVYWKmXs7rxS6Yza3+TgTjcJsmccv4MoiP9mcP4AYo=; b=hZnfU/hyFqoWU7oAWhrC98FdnPnr8vHQOp+kBP280ocpJ0wdrgNSHejc+SFqxy7lOf 59Z6BC3cGC9cu/qb2hyUjfF17R6sMcyQchU4Rtl2WuT4jUd9s/wdTdBmo8yzAkWsxA0J QuJ9yuAj1Hv/1l9nNWOj7HfIIVgvASUx6GD9Btb4Pmxwjfb0Z8nLZuKmm+nlrnnB3V73 HJI2dtFLDqtu2cVHgoGTDt0FSmYSUeWx2m2iQ2GX9Sr8/Im1KDMQhk5K1Vwbdl7IC/Ee KmSUUKwzRo3IkDaKgMGE4gGX1MnfUbdtWmNnwUNuKgjw12fLfFjp8Hk8QaZZUi5JfnLk WWFA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me5si16576499pjb.80.2021.04.25.03.25.41; Sun, 25 Apr 2021 03:25:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbhDYKQl (ORCPT + 99 others); Sun, 25 Apr 2021 06:16:41 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:50146 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229466AbhDYKQj (ORCPT ); Sun, 25 Apr 2021 06:16:39 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R501e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UWgfJID_1619345757; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UWgfJID_1619345757) by smtp.aliyun-inc.com(127.0.0.1); Sun, 25 Apr 2021 18:15:58 +0800 From: Yang Li To: anton@tuxera.com Cc: nathan@kernel.org, ndesaulniers@google.com, linux-ntfs-dev@lists.sourceforge.net, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Yang Li Subject: [PATCH] fs/ntfs: drop unneeded assignment in ntfs_perform_write() Date: Sun, 25 Apr 2021 18:15:54 +0800 Message-Id: <1619345754-32875-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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