From: Greg KH <gregkh@linuxfoundation.org>
To: Atul Kumar Pant <atulpant.linux@gmail.com>
Cc: shubhrajyoti.datta@amd.com, sai.krishna.potthuri@amd.com,
james.morse@arm.com, mchehab@kernel.org, rric@kernel.org,
bp@alien8.de, tony.luck@intel.com, michal.simek@amd.com,
shuah@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org,
linux-edac@vger.kernel.org
Subject: Re: [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check
Date: Mon, 7 Aug 2023 08:01:56 +0200 [thread overview]
Message-ID: <2023080727-wildly-veal-c0fd@gregkh> (raw)
In-Reply-To: <20230807023104.GA4030@atom0118>
On Mon, Aug 07, 2023 at 08:01:04AM +0530, Atul Kumar Pant wrote:
> On Sun, Aug 06, 2023 at 03:37:01PM +0200, Greg KH wrote:
> > On Sun, Aug 06, 2023 at 06:35:14PM +0530, Atul Kumar Pant wrote:
> > > Updating the check of return value from edac_debugfs_create_dir
> > > to use IS_ERR.
> > >
> > > Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> > > ---
> > > drivers/edac/zynqmp_edac.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
> > > index ac7d1e0b324c..cefbbafb945e 100644
> > > --- a/drivers/edac/zynqmp_edac.c
> > > +++ b/drivers/edac/zynqmp_edac.c
> > > @@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
> > > struct edac_priv *priv = edac_dev->pvt_info;
> > >
> > > priv->debugfs_dir = edac_debugfs_create_dir("ocm");
> > > - if (!priv->debugfs_dir)
> > > + if (IS_ERR(priv->debugfs_dir))
> > > return;
> >
> > Again, not correct, sorry. Please do not make these types of changes.
> >
> > Why do you feel this is needed at all?
> >
> edac_debugfs_create_dir uses debugfs_create_dir that return ERR_PTR.
> Hence to check the return value by this function I changed null
> comparison with IS_ERR.
But that's not needed at all, right?
As this check has not ever really worked, why check it at all?
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Atul Kumar Pant <atulpant.linux@gmail.com>
Cc: tony.luck@intel.com, rric@kernel.org, linux-edac@vger.kernel.org,
shuah@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org,
shubhrajyoti.datta@amd.com, bp@alien8.de, james.morse@arm.com,
mchehab@kernel.org, michal.simek@amd.com,
sai.krishna.potthuri@amd.com
Subject: Re: [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check
Date: Mon, 7 Aug 2023 08:01:56 +0200 [thread overview]
Message-ID: <2023080727-wildly-veal-c0fd@gregkh> (raw)
In-Reply-To: <20230807023104.GA4030@atom0118>
On Mon, Aug 07, 2023 at 08:01:04AM +0530, Atul Kumar Pant wrote:
> On Sun, Aug 06, 2023 at 03:37:01PM +0200, Greg KH wrote:
> > On Sun, Aug 06, 2023 at 06:35:14PM +0530, Atul Kumar Pant wrote:
> > > Updating the check of return value from edac_debugfs_create_dir
> > > to use IS_ERR.
> > >
> > > Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
> > > ---
> > > drivers/edac/zynqmp_edac.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c
> > > index ac7d1e0b324c..cefbbafb945e 100644
> > > --- a/drivers/edac/zynqmp_edac.c
> > > +++ b/drivers/edac/zynqmp_edac.c
> > > @@ -351,7 +351,7 @@ static void setup_debugfs(struct edac_device_ctl_info *edac_dev)
> > > struct edac_priv *priv = edac_dev->pvt_info;
> > >
> > > priv->debugfs_dir = edac_debugfs_create_dir("ocm");
> > > - if (!priv->debugfs_dir)
> > > + if (IS_ERR(priv->debugfs_dir))
> > > return;
> >
> > Again, not correct, sorry. Please do not make these types of changes.
> >
> > Why do you feel this is needed at all?
> >
> edac_debugfs_create_dir uses debugfs_create_dir that return ERR_PTR.
> Hence to check the return value by this function I changed null
> comparison with IS_ERR.
But that's not needed at all, right?
As this check has not ever really worked, why check it at all?
greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2023-08-07 6:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-06 13:05 [PATCH v1] drivers: edac: zynqmp_edac: Updates return value check Atul Kumar Pant
2023-08-06 13:05 ` Atul Kumar Pant
2023-08-06 13:37 ` Greg KH
2023-08-06 13:37 ` Greg KH
2023-08-07 2:31 ` Atul Kumar Pant
2023-08-07 2:31 ` Atul Kumar Pant
2023-08-07 6:01 ` Greg KH [this message]
2023-08-07 6:01 ` Greg KH
2023-08-15 20:35 ` Atul Kumar Pant
2023-08-15 20:35 ` Atul Kumar Pant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023080727-wildly-veal-c0fd@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=atulpant.linux@gmail.com \
--cc=bp@alien8.de \
--cc=james.morse@arm.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=mchehab@kernel.org \
--cc=michal.simek@amd.com \
--cc=rric@kernel.org \
--cc=sai.krishna.potthuri@amd.com \
--cc=shuah@kernel.org \
--cc=shubhrajyoti.datta@amd.com \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.