linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 1/2] acpi: apei: remove the unused dead-code for SEA/NMI notification type
@ 2017-10-17  8:02 Dongjiu Geng
  2017-10-17  8:02 ` [PATCH v5 2/2] acpi: apei: Add SEI notification type support for ARMv8 Dongjiu Geng
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Dongjiu Geng @ 2017-10-17  8:02 UTC (permalink / raw)
  To: bp, tbaicar, james.morse, will.deacon, rjw, lenb, robert.moore,
	lv.zheng, mark.rutland, kristina.martsenko, mingo, punit.agrawal,
	stephen.boyd, kamensky, prarit, shiju.jose, linux-arm-kernel,
	linux-kernel, linux-acpi, devel

For the SEA notification, the two functions ghes_sea_add() and
ghes_sea_remove() are only called when CONFIG_ACPI_APEI_SEA
is defined. If not, it will return errors in the ghes_probe()
and not continue. If the probe is failed, the ghes_sea_remove()
also has no chance to be called. Hence, remove the unnecessary
handling when CONFIG_ACPI_APEI_SEA is not defined.

For the NMI notification, it has the same issue as SEA notification,
so also remove the unused dead-code for it.

Cc: Tyler Baicar <tbaicar@codeaurora.org>
Cc: James Morse <james.morse@arm.com>
Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
---
 drivers/acpi/apei/ghes.c | 33 +++++----------------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index d661d45..3eee30a 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -849,17 +849,8 @@ static void ghes_sea_remove(struct ghes *ghes)
 	synchronize_rcu();
 }
 #else /* CONFIG_ACPI_APEI_SEA */
-static inline void ghes_sea_add(struct ghes *ghes)
-{
-	pr_err(GHES_PFX "ID: %d, trying to add SEA notification which is not supported\n",
-	       ghes->generic->header.source_id);
-}
-
-static inline void ghes_sea_remove(struct ghes *ghes)
-{
-	pr_err(GHES_PFX "ID: %d, trying to remove SEA notification which is not supported\n",
-	       ghes->generic->header.source_id);
-}
+static inline void ghes_sea_add(struct ghes *ghes) { }
+static inline void ghes_sea_remove(struct ghes *ghes) { }
 #endif /* CONFIG_ACPI_APEI_SEA */
 
 #ifdef CONFIG_HAVE_ACPI_APEI_NMI
@@ -1061,23 +1052,9 @@ static void ghes_nmi_init_cxt(void)
 	init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
 }
 #else /* CONFIG_HAVE_ACPI_APEI_NMI */
-static inline void ghes_nmi_add(struct ghes *ghes)
-{
-	pr_err(GHES_PFX "ID: %d, trying to add NMI notification which is not supported!\n",
-	       ghes->generic->header.source_id);
-	BUG();
-}
-
-static inline void ghes_nmi_remove(struct ghes *ghes)
-{
-	pr_err(GHES_PFX "ID: %d, trying to remove NMI notification which is not supported!\n",
-	       ghes->generic->header.source_id);
-	BUG();
-}
-
-static inline void ghes_nmi_init_cxt(void)
-{
-}
+static inline void ghes_nmi_add(struct ghes *ghes) { }
+static inline void ghes_nmi_remove(struct ghes *ghes) { }
+static inline void ghes_nmi_init_cxt(void) { }
 #endif /* CONFIG_HAVE_ACPI_APEI_NMI */
 
 static int ghes_probe(struct platform_device *ghes_dev)
-- 
2.10.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* Re: [PATCH v5 1/2] acpi: apei: remove the unused dead-code for SEA/NMI notification type
@ 2017-10-18 15:14 gengdongjiu
  0 siblings, 0 replies; 20+ messages in thread
From: gengdongjiu @ 2017-10-18 15:14 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: tbaicar@codeaurora.org, james.morse@arm.com, will.deacon@arm.com,
	rjw@rjwysocki.net, lenb@kernel.org, robert.moore@intel.com,
	lv.zheng@intel.com, mark.rutland@arm.com,
	kristina.martsenko@arm.com, mingo@kernel.org,
	punit.agrawal@arm.com, stephen.boyd@linaro.org,
	kamensky@cisco.com, prarit@redhat.com, Shiju Jose,
	linux-arm-kernel@lists.infradead.org

> 
> On Wed, Oct 18, 2017 at 08:27:00PM +0800, gengdongjiu wrote:
> >   For this patch(the first one), whether it can be firstly applied?
> 
> Sure:
> 
> Reviewed-by: Borislav Petkov <bp@suse.de>

Thanks Boris.

Hi Rafael,
   If you think this patch is no problem, you can firstly apply this one. Boris have reviewed it. The first one is not related with the second. For the second one, I may need discuss more with James. Thanks so much.


> 
> --
> Regards/Gruss,
>     Boris.
> 
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
> --

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-10-18 15:14 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17  8:02 [PATCH v5 1/2] acpi: apei: remove the unused dead-code for SEA/NMI notification type Dongjiu Geng
2017-10-17  8:02 ` [PATCH v5 2/2] acpi: apei: Add SEI notification type support for ARMv8 Dongjiu Geng
2017-10-17 17:06   ` Borislav Petkov
2017-10-18  5:00     ` gengdongjiu
2017-10-18  9:06       ` Borislav Petkov
2017-10-18  9:17         ` gengdongjiu
2017-10-18  9:25           ` Borislav Petkov
2017-10-18  9:44             ` James Morse
2017-10-18 10:04               ` Borislav Petkov
2017-10-18 10:25                 ` gengdongjiu
2017-10-18 10:21               ` gengdongjiu
2017-10-18 10:26   ` James Morse
2017-10-18 11:39     ` gengdongjiu
2017-10-17 14:06 ` [PATCH v5 1/2] acpi: apei: remove the unused dead-code for SEA/NMI notification type Tyler Baicar
2017-10-17 16:43 ` Borislav Petkov
2017-10-18  3:04   ` gengdongjiu
2017-10-18 10:17     ` Borislav Petkov
2017-10-18 12:27       ` gengdongjiu
2017-10-18 13:14         ` Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2017-10-18 15:14 gengdongjiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).