spi: altera: remove unnecessary #ifdef CONFIG_OF
Subsystems (4)
PATCH 1/4 spi: altera: remove unnecessary #ifdef CONFIG_OF
Remove unnecessary #ifdef CONFIG_OF, because this is already handled by the of_match_ptr macro.
--- drivers/spi/spi-altera.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/spi-altera.c +0 -2
@@ -268,14 +268,12 @@ static int altera_spi_remove(struct platform_device *dev)return 0 ; } -#ifdef CONFIG_OF static const struct of_device_id altera_spi_match[] = { { .compatible ="ALTR,spi-1.0" , }, { .compatible ="altr,spi-1.0" , }, {}, };MODULE_DEVICE_TABLE (of, altera_spi_match); -#endif /* CONFIG_OF */ static struct platform_driver altera_spi_driver = { .probe = altera_spi_probe,
Signature · 7 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/4 spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveRemove unnecessary #if defined(CONFIG_OF), because this is already handled by the of_match_ptr macro.
--- drivers/spi/spi-atmel.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/spi-atmel.c +0 -2
@@ -1481,14 +1481,12 @@ static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume);#define ATMEL_SPI_PM_OPS NULL#endif -#if defined(CONFIG_OF )static const struct of_device_id atmel_spi_dt_ids[] = { { .compatible ="atmel,at91rm9200-spi" }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, atmel_spi_dt_ids); -#endif static struct platform_driver atmel_spi_driver = { .driver = {
Signature · 7 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/4 spi: oc-tiny: remove unnecessary #ifdef CONFIG_OF
In reply to a message not in the archiveRemove unnecessary #ifdef CONFIG_OF, because this is already handled by the of_match_ptr macro.
--- drivers/spi/spi-oc-tiny.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/spi-oc-tiny.c +0 -2
@@ -338,13 +338,11 @@ static int tiny_spi_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_OF static const struct of_device_id tiny_spi_match[] = { { .compatible ="opencores,tiny-spi-rtlsvn2" , }, {}, };MODULE_DEVICE_TABLE (of, tiny_spi_match); -#endif /* CONFIG_OF */ static struct platform_driver tiny_spi_driver = { .probe = tiny_spi_probe,
Signature · 7 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 spi: xtensa-xtfpga: remove unnecessary #ifdef CONFIG_OF
In reply to a message not in the archiveRemove unnecessary #ifdef CONFIG_OF, because this is already handled by the of_match_ptr macro.
--- drivers/spi/spi-xtensa-xtfpga.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/spi-xtensa-xtfpga.c +0 -2
@@ -146,13 +146,11 @@ static int xtfpga_spi_remove(struct platform_device *pdev)MODULE_ALIAS ("platform:" XTFPGA_SPI_NAME ); -#ifdef CONFIG_OF static const struct of_device_id xtfpga_spi_of_match[] = { { .compatible ="cdns,xtfpga-spi" , }, {} };MODULE_DEVICE_TABLE (of, xtfpga_spi_of_match); -#endif static struct platform_driver xtfpga_spi_driver = { .probe = xtfpga_spi_probe,
Signature · 7 lines
2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
2014-09-02 11:22 GMT+08:00 Jingoo Han <[email protected]>:
Quoted 14 lines
Remove unnecessary #ifdef
CONFIG_OF, because this is already handled by theof_match_ptrmacro.Signed-off-by Jingoo Han <[email protected]>--- drivers/spi/spi-altera.c | 2 -- 1 file changed, 2 deletions(-)drivers/spi/spi-altera.c +0
-0@@ -268,14 +268,12 @@ static int altera_spi_remove(struct platform_device *dev)return 0 ;
drivers/spi/spi-altera.c static int altera_spi_remove(struct platform_device *dev) · line 278
Quoted 10 lines
drivers/spi/spi-altera.c +0
-2} -#ifdef CONFIG_OF static const struct of_device_id altera_spi_match[] = { { .compatible ="ALTR,spi-1.0" , }, { .compatible ="altr,spi-1.0" , }, {}, };MODULE_DEVICE_TABLE (of, altera_spi_match); -#endif /* CONFIG_OF */
For !CONFIG_OF case:
#define of_match_ptr(_ptr) NULL
Can you explain how of_match_ptr() handle this?
Thanks,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Nicolas Ferre
Acked-byRe: [PATCH 2/4] spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveOn 02/09/2014 05:24, Jingoo Han :
Quoted 4 lines
Remove unnecessary #if
defined(CONFIG_OF), because this is already handled by theof_match_ptrmacro.Signed-off-by Jingoo Han <[email protected]>
Ok:
Quoted 24 lines
--- drivers/spi/spi-atmel.c | 2 -- 1 file changed, 2 deletions(-)drivers/spi/spi-atmel.c +0
-2@@ -1481,14 +1481,12 @@ static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume);#define ATMEL_SPI_PM_OPS NULL#endif -#if defined(CONFIG_OF )static const struct of_device_id atmel_spi_dt_ids[] = { { .compatible ="atmel,at91rm9200-spi" }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, atmel_spi_dt_ids); -#endif static struct platform_driver atmel_spi_driver = { .driver = {
Signature · 5 lines
Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Max Filippov
Acked-byRe: [PATCH 4/4] spi: xtensa-xtfpga: remove unnecessary #ifdef CONFIG_OF
In reply to a message not in the archiveQuoted 7 lines · Jingoo Han
Remove unnecessary #ifdef
CONFIG_OF, because this is already handled by theof_match_ptrmacro.Signed-off-by Jingoo Han <[email protected]>--- drivers/spi/spi-xtensa-xtfpga.c | 2 -- 1 file changed, 2 deletions(-)
Signature · 6 lines
Thanks. -- Max -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Mark Brown
AppliedRe: [PATCH 2/4] spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveQuoted 2 lines · Jingoo Han
Remove unnecessary #if
defined(CONFIG_OF), because this is already handled by theof_match_ptrmacro.
Applied, thanks.
Mark Brown
AppliedRe: [PATCH 4/4] spi: xtensa-xtfpga: remove unnecessary #ifdef CONFIG_OF
In reply to a message not in the archiveQuoted 2 lines · Jingoo Han
Remove unnecessary #ifdef
CONFIG_OF, because this is already handled by theof_match_ptrmacro.
Applied, thanks.
Quoted 10 lines · Axel Lin
drivers/spi/spi-altera.c static int altera_spi_remove(struct platform_device *dev) · line 278
Quoted 8 lines
drivers/spi/spi-altera.c +0
-2-#ifdef CONFIG_OF static const struct of_device_id altera_spi_match[] = { { .compatible ="ALTR,spi-1.0" , }, { .compatible ="altr,spi-1.0" , }, {}, };MODULE_DEVICE_TABLE (of, altera_spi_match); -#endif /* CONFIG_OF */ For !CONFIG_OF case:
Quoted 2 lines
#define of_match_ptr(_ptr) NULLCan you explain how
of_match_ptr()handle this?
Unless MODULE_DEVICE_TABLE knows about OF that's not going to trigger the dead code elimination.
Re: [PATCH 2/4] spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveQuoted 5 lines · Mark Brown
Quoted 2 lines · Jingoo Han
Remove unnecessary #if
defined(CONFIG_OF), because this is already handled by theof_match_ptrmacro.Applied, thanks.
If CONFIG_OF is not set, binary size is increased, as the OF match table is still emitted, while it's no longer in use:
m68k allmodconfig:
text data bss dec hex filename
7318 373 0 7691 1e0b drivers/spi/spi-atmel.o.old 7710 373 0 8083 1f93 drivers/spi/spi-atmel.o.new 10037 781 0 10818 2a42 drivers/spi/spi-atmel.ko.old 10465 781 0 11246 2bee drivers/spi/spi-atmel.ko.new
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/4] spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveQuoted 9 lines · Geert Uytterhoeven
Quoted 5 lines · Mark Brown
Quoted 2 lines · Jingoo Han
Remove unnecessary #if
defined(CONFIG_OF), because this is already handled by theof_match_ptrmacro.Applied, thanks.
If
CONFIG_OFis not set, binary size is increased, as the OF match table is still emitted, while it's no longer in use:
OK, I've discarded the series.
Re: [PATCH 2/4] spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveQuoted 6 lines · Mark Brown
Quoted 4 lines · Geert Uytterhoeven
Quoted 3 lines · Mark Brown
Quoted 2 lines · Jingoo Han
Remove unnecessary #if
defined(CONFIG_OF), because this is already handled by theof_match_ptrmacro.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Applied, thanks.
If
CONFIG_OFis not set, binary size is increased, as the OF match table is still emitted, while it's no longer in use:OK, I've discarded the series.
(+cc Axel Lin, Max Filippov)
OK, I see. I appreciate Geert's feedback. :-)
However, personally I don't like #ifdef guards. I think that #ifdef guards can be removed for the same binary, regardless of kernel config options.
In this case, the binary size is more important than #ifdef guards, right?
Best regards,
Jingoo Han
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/4] spi: atmel: remove unnecessary #if defined(CONFIG_OF)
In reply to a message not in the archiveQuoted 6 lines · Jingoo Han
However, personally I don't like #ifdef guards. I think that #ifdef guards can be removed for the same binary, regardless of kernel config options.
In this case, the binary size is more important than #ifdef guards, right?
Right. The ideal thing would be to teach the module table stuff to disable itself when the relevant support isn't in the kernel but that's probably going to be hard to do in a tasteful fashion; perhaps wrappers (OF_MODULE_TABLE) might be OK.