Re: [PATCH v1 1/1] netlink: Don't use int as bool in netlink_update_socket_mc()

From: Andy Shevchenko
Date: Thu Jun 29 2023 - 14:56:03 EST


On Thu, Jun 29, 2023 at 05:11:23PM +0200, Simon Horman wrote:
> On Thu, Jun 29, 2023 at 04:31:31PM +0300, Andy Shevchenko wrote:

> > - int old, new = !!is_new, subscriptions;
> > + int subscriptions;
> > + bool old;
> >
> > old = test_bit(group - 1, nlk->groups);
> > subscriptions = nlk->subscriptions - old + new;
>
> Hi Andy,
>
> Doing arithmetic with boolean values doesn't seem right to me.

In any case it does not change the status quo, the same still applies to
the existing code (that's implied in the commit message). And obfuscating
it for the sake of purity seems wrong to me. Hence this patch.

> In any case, net-next is closed.
> Please consider reposting once it re-opens, after 10th July.

Sure.

Thank you for the review!

--
With Best Regards,
Andy Shevchenko