All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type
@ 2017-10-22  6:54 ` Dongjiu Geng
  0 siblings, 0 replies; 6+ messages in thread
From: Dongjiu Geng @ 2017-10-22  6:54 UTC (permalink / raw)
  To: rjw, bp, lenb, tbaicar, will.deacon, prarit, linux-acpi,
	linux-kernel, gengdongjiu

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>
Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
---
 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] 6+ messages in thread

* [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type
@ 2017-10-22  6:54 ` Dongjiu Geng
  0 siblings, 0 replies; 6+ messages in thread
From: Dongjiu Geng @ 2017-10-22  6:54 UTC (permalink / raw)
  To: rjw, bp, lenb, tbaicar, will.deacon, prarit, linux-acpi,
	linux-kernel, gengdongjiu

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>
Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
---
 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] 6+ messages in thread

* Re: [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type
  2017-10-22  6:54 ` Dongjiu Geng
  (?)
@ 2017-10-22  9:38 ` Rafael J. Wysocki
  2017-10-22 10:06   ` gengdongjiu
  2017-10-22 10:18   ` gengdongjiu
  -1 siblings, 2 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2017-10-22  9:38 UTC (permalink / raw)
  To: Dongjiu Geng
  Cc: Rafael J. Wysocki, Borislav Petkov, Len Brown, Tyler Baicar,
	Will Deacon, Prarit Bhargava, ACPI Devel Maling List,
	Linux Kernel Mailing List

On Sun, Oct 22, 2017 at 8:54 AM, Dongjiu Geng <gengdongjiu@huawei.com> wrote:
> 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>
> Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
> Reviewed-by: Borislav Petkov <bp@suse.de>

I applied one of the previous iterations.

Do I need to replace it with this version?

> ---
>  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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type
  2017-10-22  9:38 ` Rafael J. Wysocki
@ 2017-10-22 10:06   ` gengdongjiu
  2017-10-22 10:39     ` Borislav Petkov
  2017-10-22 10:18   ` gengdongjiu
  1 sibling, 1 reply; 6+ messages in thread
From: gengdongjiu @ 2017-10-22 10:06 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Borislav Petkov, Len Brown, Tyler Baicar,
	Will Deacon, Prarit Bhargava, ACPI Devel Maling List,
	Linux Kernel Mailing List

On 2017/10/22 17:38, Rafael J. Wysocki wrote:
>> Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
>> Reviewed-by: Borislav Petkov <bp@suse.de>
> I applied one of the previous iterations.
> 
> Do I need to replace it with this version?
> 
Thanks a lot Rafael's applying.
Both for me is OK.
If Borislav agreed, may be not.
I will pay attention to it next time.
Thanks again.


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

* Re: [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type
  2017-10-22  9:38 ` Rafael J. Wysocki
  2017-10-22 10:06   ` gengdongjiu
@ 2017-10-22 10:18   ` gengdongjiu
  1 sibling, 0 replies; 6+ messages in thread
From: gengdongjiu @ 2017-10-22 10:18 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Borislav Petkov, Len Brown, Tyler Baicar,
	Will Deacon, Prarit Bhargava, ACPI Devel Maling List,
	Linux Kernel Mailing List



On 2017/10/22 17:38, Rafael J. Wysocki wrote:
> On Sun, Oct 22, 2017 at 8:54 AM, Dongjiu Geng <gengdongjiu@huawei.com> wrote:
>> 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>
>> Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
>> Reviewed-by: Borislav Petkov <bp@suse.de>
> I applied one of the previous iterations.
> 
> Do I need to replace it with this version?

Rafael, I checked your applying, your applying is right. so no need to replace.
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=3275fe60d1138e0cb57be9a3f46306b4d031c643
which is already "Reviewed-by: Borislav Petkov <bp@suse.de>"
Thanks

> 


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

* Re: [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type
  2017-10-22 10:06   ` gengdongjiu
@ 2017-10-22 10:39     ` Borislav Petkov
  0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2017-10-22 10:39 UTC (permalink / raw)
  To: gengdongjiu
  Cc: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown, Tyler Baicar,
	Will Deacon, Prarit Bhargava, ACPI Devel Maling List,
	Linux Kernel Mailing List

On Sun, Oct 22, 2017 at 06:06:10PM +0800, gengdongjiu wrote:
> Thanks a lot Rafael's applying.
> Both for me is OK.

You should never agree if a patch has the SOB chain wrong. It might
sound trivial and not important for your current purposes but proving
the origin of a patch and how it found its way upstream can be critical
sometimes, in legal context.

So please pay more attention to the SOB chain in the future and don't
slap/change tags. They're not there for fun.

Thx.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

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

end of thread, other threads:[~2017-10-22 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-22  6:54 [RESEND PATCH v7] acpi: apei: remove the unused dead-code for SEA/NMI notification type Dongjiu Geng
2017-10-22  6:54 ` Dongjiu Geng
2017-10-22  9:38 ` Rafael J. Wysocki
2017-10-22 10:06   ` gengdongjiu
2017-10-22 10:39     ` Borislav Petkov
2017-10-22 10:18   ` gengdongjiu

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.