Skip to contentSkip to conversation

mtd: rawnand: ingenic: fix empty stub helper definitions

PATCH Applied Arnd Bergmann 3 participants 3 messages May 16, 2023 – May 22, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: rawnand: ingenic: fix empty stub helper definitions

From: Arnd Bergmann <[email protected]>

A few functions provide an empty interface definition when CONFIG_MTD_NAND_INGENIC_ECC is disabled, but they are accidentally defined as global functions in the header:

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:39:5: error: no previous prototype for 'ingenic_ecc_calculate' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:46:5: error: no previous prototype for 'ingenic_ecc_correct' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:53:6: error: no previous prototype for 'ingenic_ecc_release' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:57:21: error: no previous prototype for 'of_ingenic_ecc_get'

Turn them into 'static inline' definitions instead.

Fixes 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
---
 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/nand/raw/ingenic/ingenic_ecc.h +4 -4
index 2cda439b5e11..017868f59f22 100644
@@ -36,25 +36,25 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
 void ingenic_ecc_release(struct ingenic_ecc *ecc);
 struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np);
 #else /* CONFIG_MTD_NAND_INGENIC_ECC */
-int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
+static inline int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
 			  struct ingenic_ecc_params *params,
 			  const u8 *buf, u8 *ecc_code)
 {
 	return -ENODEV;
 }
 
-int ingenic_ecc_correct(struct ingenic_ecc *ecc,
+static inline int ingenic_ecc_correct(struct ingenic_ecc *ecc,
 			struct ingenic_ecc_params *params, u8 *buf,
 			u8 *ecc_code)
 {
 	return -ENODEV;
 }
 
-void ingenic_ecc_release(struct ingenic_ecc *ecc)
+static inline void ingenic_ecc_release(struct ingenic_ecc *ecc)
 {
 }
 
-struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
+static inline struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
 {
 	return ERR_PTR(-ENODEV);
 }
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi,

Le mardi 16 mai 2023 à 22:21 +0200, Arnd Bergmann a écrit :

Quoted 15 lines

From: Arnd Bergmann <[email protected]>

A few functions provide an empty interface definition when CONFIG_MTD_NAND_INGENIC_ECC is disabled, but they are accidentally defined as global functions in the header:

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:39:5: error: no previous prototype for 'ingenic_ecc_calculate' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:46:5: error: no previous prototype for 'ingenic_ecc_correct' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:53:6: error: no previous prototype for 'ingenic_ecc_release' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:57:21: error: no previous prototype for 'of_ingenic_ecc_get'

Quoted 5 lines

Turn them into 'static inline' definitions instead.

Fixes 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and

SoC specific code")

Good catch.

Cheers,
-Paul

Quoted 40 lines

---
 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h | 8 ++++----

 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/nand/raw/ingenic/ingenic_ecc.h +1 -1
index 2cda439b5e11..017868f59f22 100644
@@ -36,25 +36,25 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
  void ingenic_ecc_release(struct ingenic_ecc *ecc);
  struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np);
  #else /* CONFIG_MTD_NAND_INGENIC_ECC */
-int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
+static inline int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
                           struct ingenic_ecc_params *params,
                           const u8 *buf, u8 *ecc_code)
  {
         return -ENODEV;
  }

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h +1 -1
-int ingenic_ecc_correct(struct ingenic_ecc *ecc,
+static inline int ingenic_ecc_correct(struct ingenic_ecc *ecc,

                        struct ingenic_ecc_params *params, u8 *buf, u8 *ecc_code)
 {
        return -ENODEV;
 }

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h +1 -1
-void ingenic_ecc_release(struct ingenic_ecc *ecc)
+static inline void ingenic_ecc_release(struct ingenic_ecc *ecc)

 {
 }

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h +1 -1
-struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
+static inline struct ingenic_ecc *of_ingenic_ecc_get(struct

device_node *np)
 {
        return ERR_PTR(-ENODEV);
 }

maintainer Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

A few functions provide an empty interface definition when CONFIG_MTD_NAND_INGENIC_ECC is disabled, but they are accidentally defined as global functions in the header:

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:39:5: error: no previous prototype for 'ingenic_ecc_calculate' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:46:5: error: no previous prototype for 'ingenic_ecc_correct' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:53:6: error: no previous prototype for 'ingenic_ecc_release' drivers/mtd/nand/raw/ingenic/ingenic_ecc.h:57:21: error: no previous prototype for 'of_ingenic_ecc_get'

Quoted 5 lines

Turn them into 'static inline' definitions instead.

Fixes 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.

Miquel