From: Thorsten Blum <thorsten.blum@linux.dev>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Gou Hao <gouhao@uniontech.com>,
Mina Almasry <almasrymina@google.com>,
Abhishek Chauhan <quic_abchauha@quicinc.com>,
Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next] net: Use str_yes_no() and str_no_yes() helper functions
Date: Sat, 26 Oct 2024 13:29:44 +0200 [thread overview]
Message-ID: <20241026112946.129310-2-thorsten.blum@linux.dev> (raw)
Remove hard-coded strings by using the str_yes_no() and str_no_yes()
helper functions.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
net/core/sock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index 039be95c40cf..132c8d2cda26 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -4140,7 +4140,7 @@ static long sock_prot_memory_allocated(struct proto *proto)
static const char *sock_prot_memory_pressure(struct proto *proto)
{
return proto->memory_pressure != NULL ?
- proto_memory_pressure(proto) ? "yes" : "no" : "NI";
+ str_yes_no(proto_memory_pressure(proto)) : "NI";
}
static void proto_seq_printf(struct seq_file *seq, struct proto *proto)
@@ -4154,7 +4154,7 @@ static void proto_seq_printf(struct seq_file *seq, struct proto *proto)
sock_prot_memory_allocated(proto),
sock_prot_memory_pressure(proto),
proto->max_header,
- proto->slab == NULL ? "no" : "yes",
+ str_no_yes(proto->slab == NULL),
module_name(proto->owner),
proto_method_implemented(proto->close),
proto_method_implemented(proto->connect),
--
2.47.0
next reply other threads:[~2024-10-26 11:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-26 11:29 Thorsten Blum [this message]
2024-10-26 14:54 ` [PATCH net-next] net: Use str_yes_no() and str_no_yes() helper functions Willem de Bruijn
2024-10-26 15:14 ` Thorsten Blum
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=20241026112946.129310-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=almasrymina@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gouhao@uniontech.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.com \
--cc=willemb@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