All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: <kees@kernel.org>, <andy@kernel.org>, <linux-hardening@vger.kernel.org>
Subject: Re: [PATCH -next 0/2] Add str_true_false()/str_false_true() helper
Date: Sat, 24 Aug 2024 10:07:32 +0800	[thread overview]
Message-ID: <1deb2bc4-0cd1-41a0-9434-65c02eef77ed@huawei.com> (raw)
In-Reply-To: <2024082311-unaltered-grumbly-5c94@gregkh>



On 2024/8/23 21:38, Greg KH wrote:
> On Fri, Aug 23, 2024 at 04:22:32PM +0300, Andy Shevchenko wrote:
>> On Fri, Aug 23, 2024 at 9:13 AM Hongbo Li <lihongbo22@huawei.com> wrote:
>>>
>>> Add str_true_false()/str_false_true() helper to "true" or "false"
>>> string literal. And we found more than 10 cases currently exist
>>> in the tree. So these helpers can be used for these cases.
>>
>> Squash them into a single patch. There is no need to split these.
> 
> And let's see some patches that change existing code to use them, we
> can't add new functions that are never used in the tree.
> 

After this helper being added, I will add the coccinelle rules and do 
some replacements on the existing code to use them. Now there are many 
existing codes have use like this way (just use grep -rn "\"true\" : 
\"false\"" . to lookup):

fs/ceph/debugfs.c:360  seq_printf(s, "blocklisted: %s\n", 
fsc->blocklisted ? "true" : "false");

./net/sunrpc/backchannel_rqst.c:233 list_empty(&xprt->bc_pa_list) ? 
"true" : "false");

./crypto/drbg.c:1415  drbg->pr ? "true" : "false"

./sound/soc/intel/skylake/skl-debug.c:133 mconfig->pipe->passthru ? 
"true" : "false");

./mm/memory-tiers.c:925 numa_demotion_enabled ? "true" : "false");

etc.


> thanks,
> 
> greg k-h

      parent reply	other threads:[~2024-08-24  2:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23  6:20 [PATCH -next 0/2] Add str_true_false()/str_false_true() helper Hongbo Li
2024-08-23  6:20 ` [PATCH -next 1/2] lib/string_choices: Add str_true_false() helper Hongbo Li
2024-08-23  6:20 ` [PATCH -next 2/2] lib/string_choices: Add wrapper for str_false_true() Hongbo Li
2024-08-23 13:22 ` [PATCH -next 0/2] Add str_true_false()/str_false_true() helper Andy Shevchenko
2024-08-23 13:38   ` Greg KH
2024-08-23 14:25     ` Andy Shevchenko
2024-08-24  2:07     ` Hongbo Li [this message]

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=1deb2bc4-0cd1-41a0-9434-65c02eef77ed@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.