Re: [PATCH] net: mvpp2: Fix error checking

From: Andrew Lunn
Date: Wed May 17 2023 - 17:06:22 EST


On Wed, May 17, 2023 at 09:11:10PM +0100, Russell King (Oracle) wrote:
> On Thu, May 18, 2023 at 03:08:11AM +0800, Yeqi Fu wrote:
> > The function debugfs_create_dir returns ERR_PTR if an error occurs,
> > and the appropriate way to verify for errors is to use the inline
> > function IS_ERR. The patch will substitute the null-comparison with
> > IS_ERR.
>
> Exactly as I said to a very similar patch received a few days ago
> from SikkiLadho:
>
> "The modern wisdom for debugfs is not to check for any errors, so if
> we're going to touch this, that's the route that any patch should be
> taking.
>
> Thanks."
>
> Your patch seems to have the same Suggested-by: which suggests to me
> that you probably know SikkiLadho and are working together with the
> person who suggested the change, so it would be good that when a
> patch from one of you is commented upon, those comments are taken
> into account rather than someone else sending an identical patch to
> the first.

Hi Yeqi

Even better would be you write a patch for the bot you are using to
find these issues and teach it that nothing is actually wrong here, or
suggest to remove all checks.

Andrew