[PATCH net] net: ti: icssg-prueth: Remove duplicate cleanup calls in emac_ndo_stop()

Diogo Ivo diogo.ivo at siemens.com
Thu Feb 8 06:11:07 PST 2024


On 2/8/24 13:33, Dan Carpenter wrote:
> On Thu, Feb 08, 2024 at 10:47:00AM +0000, Simon Horman wrote:
>> On Tue, Feb 06, 2024 at 03:20:51PM +0000, Diogo Ivo wrote:
>>> Remove the duplicate calls to prueth_emac_stop() and
>>> prueth_cleanup_tx_chns() in emac_ndo_stop().
>>>
>>> Fixes: 128d5874c082 ("net: ti: icssg-prueth: Add ICSSG ethernet driver")
>>> Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support")
>>> Signed-off-by: Diogo Ivo <diogo.ivo at siemens.com>
>> Hi Doigo,
>>
>> I see that there are indeed duplicate calls,
>> but I do wonder if this is a cleanup rather than a bug:
>> is there a user-visible problem that this addresses?
>>
>> If so, I think it would be good to spell this out in the commit message.
>>
>> ...
> So far as I can see from reviewing the code there is no user visible
> effect.
>
> rproc_shutdown() calls rproc_stop() which sets "rproc->state = RPROC_OFFLINE;"
> so the second call will return be a no-op and return -EINVAL.  But the
> return value is not checked so no problem.
>
> prueth_cleanup_tx_chns() uses memset to zero out the emac->tx_chns[] so
> the second call will be a no-op.
>
> regards,
> dan carpenter

Yes, it is just a code cleanup. Is the commit message fine as it is?


Best regards,

Diogo




More information about the linux-arm-kernel mailing list