From: Li zeming <zeming@nfschina.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Li zeming <zeming@nfschina.com>
Subject: [PATCH] net/socket: Remove unnecessary ‘0’ values from used
Date: Sun, 3 Sep 2023 02:22:28 +0800 [thread overview]
Message-ID: <20230902182228.3124-1-zeming@nfschina.com> (raw)
used is assigned first, so it does not need to initialize the
assignment.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
net/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 2b0e54b2405c..743e54eba06f 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -569,12 +569,12 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,
size_t size)
{
ssize_t len;
- ssize_t used = 0;
+ ssize_t used;
len = security_inode_listsecurity(d_inode(dentry), buffer, size);
if (len < 0)
return len;
- used += len;
+ used = len;
if (buffer) {
if (size < used)
return -ERANGE;
--
2.18.2
next reply other threads:[~2023-09-01 1:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-02 18:22 Li zeming [this message]
2023-09-01 11:07 ` Denis Kirjanov
2023-09-02 0:57 ` Jakub Kicinski
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=20230902182228.3124-1-zeming@nfschina.com \
--to=zeming@nfschina.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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®