Re: [PATCH -next v3 3/3] nfs make use of str_false_true helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux