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

From: Simon Horman
Date: Thu Jun 29 2023 - 15:25:46 EST


On Thu, Jun 29, 2023 at 09:55:50PM +0300, Andy Shevchenko wrote:
> 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.

Yes, sure. That is true.

> > 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
>
>
>