All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] firmware: iSCSI: Remove unneeded #ifdef and associated dead code
@ 2015-04-12 12:19 Andreas Ruprecht
  2015-04-13  0:39 ` Zheng, Lv
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Ruprecht @ 2015-04-12 12:19 UTC (permalink / raw)
  To: Peter Jones
  Cc: Lv Zheng, Konrad Rzeszutek Wilk, linux-kernel, Andreas Ruprecht

In commit 9d24622ced32 ("ACPI / IBFT: Fix incorrect <acpi/acpi.h>
inclusion in iSCSI boot firmware module"), the dependencies for
CONFIG_ISCSI_IBFT_FIND were changed to also include CONFIG_ACPI.

Inside drivers/firmware/iscsi_ibft.c, there is an "#ifdef CONFIG_ACPI"
block, while the whole file is only compiled with CONFIG_ISCSI_IBFT
enabled. As CONFIG_ISCSI_IBFT depends on CONFIG_ISCSI_IBFT_FIND
(which in turn depends on CONFIG_ACPI), CONFIG_ACPI will always be
enabled when we compile the file, hence the #ifdef is unnecessary and
the (empty) function inside the #else block can never be compiled and
they can both be removed.

Signed-off-by: Andreas Ruprecht <andreas.ruprecht@fau.de>
---
 drivers/firmware/iscsi_ibft.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 071c2c9..60c937f 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -746,7 +746,6 @@ static void __exit ibft_exit(void)
 	ibft_cleanup();
 }
 
-#ifdef CONFIG_ACPI
 static const struct {
 	char *sign;
 } ibft_signs[] = {
@@ -772,11 +771,6 @@ static void __init acpi_find_ibft_region(void)
 		ibft_addr = (struct acpi_table_ibft *)table;
 	}
 }
-#else
-static void __init acpi_find_ibft_region(void)
-{
-}
-#endif
 
 /*
  * ibft_init() - creates sysfs tree entries for the iBFT data.
-- 
1.9.1


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

* RE: [PATCH RESEND] firmware: iSCSI: Remove unneeded #ifdef and associated dead code
  2015-04-12 12:19 [PATCH RESEND] firmware: iSCSI: Remove unneeded #ifdef and associated dead code Andreas Ruprecht
@ 2015-04-13  0:39 ` Zheng, Lv
  0 siblings, 0 replies; 2+ messages in thread
From: Zheng, Lv @ 2015-04-13  0:39 UTC (permalink / raw)
  To: Andreas Ruprecht, Peter Jones; +Cc: Konrad Rzeszutek Wilk, linux-kernel

Hi,

Thanks for noticing this.

> From: Andreas Ruprecht [mailto:andreas.ruprecht@fau.de]
> Sent: Sunday, April 12, 2015 8:19 PM
> 
> In commit 9d24622ced32 ("ACPI / IBFT: Fix incorrect <acpi/acpi.h>
> inclusion in iSCSI boot firmware module"), the dependencies for
> CONFIG_ISCSI_IBFT_FIND were changed to also include CONFIG_ACPI.
> 
> Inside drivers/firmware/iscsi_ibft.c, there is an "#ifdef CONFIG_ACPI"
> block, while the whole file is only compiled with CONFIG_ISCSI_IBFT
> enabled. As CONFIG_ISCSI_IBFT depends on CONFIG_ISCSI_IBFT_FIND
> (which in turn depends on CONFIG_ACPI), CONFIG_ACPI will always be
> enabled when we compile the file, hence the #ifdef is unnecessary and
> the (empty) function inside the #else block can never be compiled and
> they can both be removed.
> 
> Signed-off-by: Andreas Ruprecht <andreas.ruprecht@fau.de>

Acked-by: Lv Zheng <lv.zheng@intel.com>

Best regards
-Lv

> ---
>  drivers/firmware/iscsi_ibft.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
> index 071c2c9..60c937f 100644
> --- a/drivers/firmware/iscsi_ibft.c
> +++ b/drivers/firmware/iscsi_ibft.c
> @@ -746,7 +746,6 @@ static void __exit ibft_exit(void)
>  	ibft_cleanup();
>  }
> 
> -#ifdef CONFIG_ACPI
>  static const struct {
>  	char *sign;
>  } ibft_signs[] = {
> @@ -772,11 +771,6 @@ static void __init acpi_find_ibft_region(void)
>  		ibft_addr = (struct acpi_table_ibft *)table;
>  	}
>  }
> -#else
> -static void __init acpi_find_ibft_region(void)
> -{
> -}
> -#endif
> 
>  /*
>   * ibft_init() - creates sysfs tree entries for the iBFT data.
> --
> 1.9.1


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

end of thread, other threads:[~2015-04-13  0:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-12 12:19 [PATCH RESEND] firmware: iSCSI: Remove unneeded #ifdef and associated dead code Andreas Ruprecht
2015-04-13  0:39 ` Zheng, Lv

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.