Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1707642 > unrolled thread

[PATCH v2 4/4] ACPI-APEI-HEST: Reduce the scope for a variable in acpi_hest_init()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-08-09 20:10 +0200
Last post2017-08-09 20:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 4/4] ACPI-APEI-HEST: Reduce the scope for a variable in  acpi_hest_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 20:10 +0200

#1707642 — [PATCH v2 4/4] ACPI-APEI-HEST: Reduce the scope for a variable in acpi_hest_init()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-08-09 20:10 +0200
Subject[PATCH v2 4/4] ACPI-APEI-HEST: Reduce the scope for a variable in acpi_hest_init()
Message-ID<ucDAB-2mx-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 5 Sep 2016 21:50:34 +0200

Move the definition for the local variable "ghes_count" into an if branch
so that the corresponding setting will only be performed if GHES could be
enabled by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/acpi/apei/hest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index 94b9bd494c20..c0d81387ce18 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -225,7 +225,6 @@ void __init acpi_hest_init(void)
 {
 	acpi_status status;
 	int rc = -ENODEV;
-	unsigned int ghes_count = 0;
 
 	if (hest_disable) {
 		pr_info(HEST_PFX "Table parsing disabled.\n");
@@ -248,6 +247,8 @@ void __init acpi_hest_init(void)
 		goto err;
 
 	if (!ghes_disable) {
+		unsigned int ghes_count = 0;
+
 		rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
 		if (rc)
 			goto err;
-- 
2.13.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web