On 2024/8/27 11:33, Matthew Wilcox wrote:
On Tue, Aug 27, 2024 at 10:45:17AM +0800, Hongbo Li wrote:
The helper str_false_true is introduced to reback "false/true"
string literal. We can simplify this format by str_false_true.
This seems unnecessarily verbose & complex. How about:
dprintk("%s: link support=%s\n", __func__, strbool(*res != 0));
This just keeps consistency with other string literal helpers such as
"str_up_down", "str_yes_no" defined in include/linux/string_choices.h.
- dprintk("%s: link support=%s\n", __func__, *res == 0 ? "false" : "true");
+ dprintk("%s: link support=%s\n", __func__, str_false_true(*res == 0));
(do we have a convention for the antonym of kstrtoX?)
No, I haven't found this kind of convention helpers.
Thanks,
Hongbo