* [PATCH] RAS/AMD/FMPM: Remove some dead code
@ 2024-10-25 7:08 Dan Carpenter
2024-10-25 13:56 ` Yazen Ghannam
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2024-10-25 7:08 UTC (permalink / raw)
To: Yazen Ghannam
Cc: Tony Luck, Borislav Petkov, linux-edac, linux-kernel, kernel-janitors
Debugfs functions don't return NULL, they return error pointers. Debugfs
functions are slightly unusual because they're not supposed to be checked
for errors in the normal case. Delete these checks.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/ras/amd/fmpm.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
index 90de737fbc90..3cde1fe17a7a 100644
--- a/drivers/ras/amd/fmpm.c
+++ b/drivers/ras/amd/fmpm.c
@@ -956,12 +956,7 @@ static void setup_debugfs(void)
return;
fmpm_dfs_dir = debugfs_create_dir("fmpm", dfs);
- if (!fmpm_dfs_dir)
- return;
-
fmpm_dfs_entries = debugfs_create_file("entries", 0400, fmpm_dfs_dir, NULL, &fmpm_fops);
- if (!fmpm_dfs_entries)
- debugfs_remove(fmpm_dfs_dir);
}
static const struct x86_cpu_id fmpm_cpuids[] = {
--
2.45.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RAS/AMD/FMPM: Remove some dead code
2024-10-25 7:08 [PATCH] RAS/AMD/FMPM: Remove some dead code Dan Carpenter
@ 2024-10-25 13:56 ` Yazen Ghannam
2024-10-25 14:06 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Yazen Ghannam @ 2024-10-25 13:56 UTC (permalink / raw)
To: Dan Carpenter
Cc: Tony Luck, Borislav Petkov, linux-edac, linux-kernel, kernel-janitors
On Fri, Oct 25, 2024 at 10:08:34AM +0300, Dan Carpenter wrote:
> Debugfs functions don't return NULL, they return error pointers. Debugfs
> functions are slightly unusual because they're not supposed to be checked
> for errors in the normal case. Delete these checks.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/ras/amd/fmpm.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
> index 90de737fbc90..3cde1fe17a7a 100644
> --- a/drivers/ras/amd/fmpm.c
> +++ b/drivers/ras/amd/fmpm.c
> @@ -956,12 +956,7 @@ static void setup_debugfs(void)
> return;
>
> fmpm_dfs_dir = debugfs_create_dir("fmpm", dfs);
> - if (!fmpm_dfs_dir)
> - return;
> -
> fmpm_dfs_entries = debugfs_create_file("entries", 0400, fmpm_dfs_dir, NULL, &fmpm_fops);
> - if (!fmpm_dfs_entries)
> - debugfs_remove(fmpm_dfs_dir);
> }
>
> static const struct x86_cpu_id fmpm_cpuids[] = {
> --
Seems like we had the same idea. :)
https://lore.kernel.org/r/20241024155503.GA965@yaz-khff2.amd.com
Thanks,
Yazen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RAS/AMD/FMPM: Remove some dead code
2024-10-25 13:56 ` Yazen Ghannam
@ 2024-10-25 14:06 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-10-25 14:06 UTC (permalink / raw)
To: Yazen Ghannam
Cc: Tony Luck, Borislav Petkov, linux-edac, linux-kernel, kernel-janitors
On Fri, Oct 25, 2024 at 09:56:16AM -0400, Yazen Ghannam wrote:
> On Fri, Oct 25, 2024 at 10:08:34AM +0300, Dan Carpenter wrote:
> > Debugfs functions don't return NULL, they return error pointers. Debugfs
> > functions are slightly unusual because they're not supposed to be checked
> > for errors in the normal case. Delete these checks.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > drivers/ras/amd/fmpm.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
> > index 90de737fbc90..3cde1fe17a7a 100644
> > --- a/drivers/ras/amd/fmpm.c
> > +++ b/drivers/ras/amd/fmpm.c
> > @@ -956,12 +956,7 @@ static void setup_debugfs(void)
> > return;
> >
> > fmpm_dfs_dir = debugfs_create_dir("fmpm", dfs);
> > - if (!fmpm_dfs_dir)
> > - return;
> > -
> > fmpm_dfs_entries = debugfs_create_file("entries", 0400, fmpm_dfs_dir, NULL, &fmpm_fops);
> > - if (!fmpm_dfs_entries)
> > - debugfs_remove(fmpm_dfs_dir);
> > }
> >
> > static const struct x86_cpu_id fmpm_cpuids[] = {
> > --
>
> Seems like we had the same idea. :)
>
> https://lore.kernel.org/r/20241024155503.GA965@yaz-khff2.amd.com
>
Ah. Good. To me it's always encouraging when people end up writing basically
the exact same patch.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-25 14:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-25 7:08 [PATCH] RAS/AMD/FMPM: Remove some dead code Dan Carpenter
2024-10-25 13:56 ` Yazen Ghannam
2024-10-25 14:06 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®