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 <[email protected]> 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