Re: [PATCH v1 14/14] extcon: Use positive conditional in ternary operator

From: Chanwoo Choi
Date: Mon Apr 03 2023 - 10:38:51 EST


On 23. 3. 22. 23:40, Andy Shevchenko wrote:
> It's easier to parse by a human being the positive conditional.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> drivers/extcon/extcon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index edfa0450e605..3e8522d522b4 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -1466,7 +1466,7 @@ EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle);
> */
> const char *extcon_get_edev_name(struct extcon_dev *edev)
> {
> - return !edev ? NULL : edev->name;
> + return edev ? edev->name : NULL;
> }
> EXPORT_SYMBOL_GPL(extcon_get_edev_name);
>

It is not fix-up patch and I'm not sure that it is beneficial patch.
I will not apply it.

--
Best Regards,
Samsung Electronics
Chanwoo Choi