mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Li <yang.lee@linux.alibaba.com>
To: jlbec@evilplan.org
Cc: hch@lst.de, nathan@kernel.org, ndesaulniers@google.com,
	linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com,
	Yang Li <yang.lee@linux.alibaba.com>
Subject: [PATCH] configfs: Remove redundant initialization of 'len'
Date: Wed, 12 May 2021 17:17:59 +0800	[thread overview]
Message-ID: <1620811079-105280-1-git-send-email-yang.lee@linux.alibaba.com> (raw)

variable 'len' is being initialized however
this value is never read as 'len' is assigned a new
value in if statement. Remove the redundant assignment.
At the same time, adjust the declarations order of
variables to keep the "upside-down x-mas tree" look of them.

Cleans up clang warning:
fs/configfs/file.c:147:10: warning: Value stored to 'len' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 'commit fa60ce2cb450 ("treewide: remove editor modelines and cruft")'
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 fs/configfs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index e26060d..1551b3d 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -141,10 +141,10 @@ static int fill_read_buffer(struct file *file, struct configfs_buffer *buffer)
 configfs_read_bin_file(struct file *file, char __user *buf,
 		       size_t count, loff_t *ppos)
 {
-	struct configfs_fragment *frag = to_frag(file);
 	struct configfs_buffer *buffer = file->private_data;
+	struct configfs_fragment *frag = to_frag(file);
 	ssize_t retval = 0;
-	ssize_t len = min_t(size_t, count, PAGE_SIZE);
+	ssize_t len;
 
 	mutex_lock(&buffer->mutex);
 
-- 
1.8.3.1


             reply	other threads:[~2021-05-12  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12  9:17 Yang Li [this message]
2021-05-25  8:31 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1620811079-105280-1-git-send-email-yang.lee@linux.alibaba.com \
    --to=yang.lee@linux.alibaba.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=hch@lst.de \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®