Re: [PATCH] netdevsim: remove redundant branch
From: Petr Machata
Date: Thu Jul 17 2025 - 09:29:57 EST
Simon Horman <horms@xxxxxxxxxx> writes:
> On Wed, Jul 16, 2025 at 12:57:50PM -0400, Dennis Chen wrote:
>> bool notify is referenced nowhere else in the function except to check
>> whether or not to call rtnl_offload_xstats_notify(). Remove it and move
>> the call to the previous branch.
>>
>> Signed-off-by: Dennis Chen <dechen@xxxxxxxxxx>
>> ---
>> drivers/net/netdevsim/hwstats.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> Thanks Dennis,
>
> This looks like a nice clean-up to me.
>
> I guess this is an artefact of the development of this code as this pattern
> has been present since the code was added by Petr Machata (CCed) in
> commit 1a6d7ae7d63c ("netdevsim: Introduce support for L3 offload xstats").
>
> Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
Thanks for the CC!
There was some locking / cleanup business originally that necessitated
the variable. That went away during internal review, but this was left
behind. I agree it can be cleaned up.
Reviewed-by: Petr Machata <petrm@xxxxxxxxxx>