* [PATCH] mtd: rawnand: ingenic: fix empty stub helper definitions
@ 2023-05-16 20:21 Arnd Bergmann
2023-05-16 21:09 ` Paul Cercueil
2023-05-22 15:58 ` Miquel Raynal
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-05-16 20:21 UTC (permalink / raw
To: Paul Cercueil, Harvey Hunt, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Arnd Bergmann, linux-mips, linux-mtd, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mtd/nand/raw/ingenic/ingenic_ecc.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
index 2cda439b5e11..017868f59f22 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
@@ -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);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: rawnand: ingenic: fix empty stub helper definitions
2023-05-16 20:21 [PATCH] mtd: rawnand: ingenic: fix empty stub helper definitions Arnd Bergmann
@ 2023-05-16 21:09 ` Paul Cercueil
2023-05-22 15:58 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Paul Cercueil @ 2023-05-16 21:09 UTC (permalink / raw
To: Arnd Bergmann, Harvey Hunt, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Arnd Bergmann, linux-mips, linux-mtd, linux-kernel
Hi,
Le mardi 16 mai 2023 à 22:21 +0200, Arnd Bergmann a écrit :
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Good catch.
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Cheers,
-Paul
> ---
> drivers/mtd/nand/raw/ingenic/ingenic_ecc.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> index 2cda439b5e11..017868f59f22 100644
> --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
> @@ -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);
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: rawnand: ingenic: fix empty stub helper definitions
2023-05-16 20:21 [PATCH] mtd: rawnand: ingenic: fix empty stub helper definitions Arnd Bergmann
2023-05-16 21:09 ` Paul Cercueil
@ 2023-05-22 15:58 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2023-05-22 15:58 UTC (permalink / raw
To: Arnd Bergmann, Paul Cercueil, Harvey Hunt, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Arnd Bergmann, linux-mips, linux-mtd, linux-kernel
On Tue, 2023-05-16 at 20:21:24 UTC, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.
Miquel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-22 15:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 20:21 [PATCH] mtd: rawnand: ingenic: fix empty stub helper definitions Arnd Bergmann
2023-05-16 21:09 ` Paul Cercueil
2023-05-22 15:58 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).