Message ID | 20240823062046.3323694-1-lihongbo22@huawei.com (mailing list archive) |
---|---|
Headers | show |
Series | Add str_true_false()/str_false_true() helper | expand |
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.
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. thanks, greg k-h
On Fri, Aug 23, 2024 at 09:38:39PM +0800, 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. Exactly, thanks, Greg!
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