* [PATCH] check_signature depends on CONFIG_CHECK_SIGNATURE
@ 2011-05-20 14:14 Jean Delvare
2011-05-20 22:11 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2011-05-20 14:14 UTC (permalink / raw)
To: LKML; +Cc: Andrew Morton
check_signature() is only available if CONFIG_CHECK_SIGNATURE has been
selected. Don't declare the function if it won't be available at link
time. That way, any failure to select CONFIG_CHECK_SIGNATURE as needed
will show up immediately at build time.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
include/linux/io.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- linux-2.6.40-rc0.orig/include/linux/io.h 2011-05-20 10:41:02.000000000 +0200
+++ linux-2.6.40-rc0/include/linux/io.h 2011-05-20 16:00:31.000000000 +0200
@@ -63,8 +63,11 @@ void __iomem *devm_ioremap(struct device
void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
unsigned long size);
void devm_iounmap(struct device *dev, void __iomem *addr);
+void devm_ioremap_release(struct device *dev, void *res);
+
+#ifdef CONFIG_CHECK_SIGNATURE
int check_signature(const volatile void __iomem *io_addr,
const unsigned char *signature, int length);
-void devm_ioremap_release(struct device *dev, void *res);
+#endif
#endif /* _LINUX_IO_H */
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] check_signature depends on CONFIG_CHECK_SIGNATURE
2011-05-20 14:14 [PATCH] check_signature depends on CONFIG_CHECK_SIGNATURE Jean Delvare
@ 2011-05-20 22:11 ` Andrew Morton
2011-05-21 6:48 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2011-05-20 22:11 UTC (permalink / raw)
To: Jean Delvare; +Cc: LKML
On Fri, 20 May 2011 16:14:48 +0200
Jean Delvare <khali@linux-fr.org> wrote:
> check_signature() is only available if CONFIG_CHECK_SIGNATURE has been
> selected. Don't declare the function if it won't be available at link
> time. That way, any failure to select CONFIG_CHECK_SIGNATURE as needed
> will show up immediately at build time.
>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> ---
> include/linux/io.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> --- linux-2.6.40-rc0.orig/include/linux/io.h 2011-05-20 10:41:02.000000000 +0200
> +++ linux-2.6.40-rc0/include/linux/io.h 2011-05-20 16:00:31.000000000 +0200
> @@ -63,8 +63,11 @@ void __iomem *devm_ioremap(struct device
> void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
> unsigned long size);
> void devm_iounmap(struct device *dev, void __iomem *addr);
> +void devm_ioremap_release(struct device *dev, void *res);
> +
> +#ifdef CONFIG_CHECK_SIGNATURE
> int check_signature(const volatile void __iomem *io_addr,
> const unsigned char *signature, int length);
> -void devm_ioremap_release(struct device *dev, void *res);
> +#endif
We usually avoid doing this. Detecting the error at link time is
sufficient.
Yes, that will very occasionally cost a small number of people a little
additional time. But we must balance that against permanently messing
up the header files.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] check_signature depends on CONFIG_CHECK_SIGNATURE
2011-05-20 22:11 ` Andrew Morton
@ 2011-05-21 6:48 ` Jean Delvare
0 siblings, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2011-05-21 6:48 UTC (permalink / raw)
To: Andrew Morton; +Cc: LKML
Hi Andrew,
On Fri, 20 May 2011 15:11:13 -0700, Andrew Morton wrote:
> On Fri, 20 May 2011 16:14:48 +0200
> Jean Delvare <khali@linux-fr.org> wrote:
>
> > check_signature() is only available if CONFIG_CHECK_SIGNATURE has been
> > selected. Don't declare the function if it won't be available at link
> > time. That way, any failure to select CONFIG_CHECK_SIGNATURE as needed
> > will show up immediately at build time.
> >
> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > ---
> > include/linux/io.h | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > --- linux-2.6.40-rc0.orig/include/linux/io.h 2011-05-20 10:41:02.000000000 +0200
> > +++ linux-2.6.40-rc0/include/linux/io.h 2011-05-20 16:00:31.000000000 +0200
> > @@ -63,8 +63,11 @@ void __iomem *devm_ioremap(struct device
> > void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
> > unsigned long size);
> > void devm_iounmap(struct device *dev, void __iomem *addr);
> > +void devm_ioremap_release(struct device *dev, void *res);
> > +
> > +#ifdef CONFIG_CHECK_SIGNATURE
> > int check_signature(const volatile void __iomem *io_addr,
> > const unsigned char *signature, int length);
> > -void devm_ioremap_release(struct device *dev, void *res);
> > +#endif
>
> We usually avoid doing this. Detecting the error at link time is
> sufficient.
>
> Yes, that will very occasionally cost a small number of people a little
> additional time. But we must balance that against permanently messing
> up the header files.
OK, fair enough. Patch deleted.
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-21 6:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 14:14 [PATCH] check_signature depends on CONFIG_CHECK_SIGNATURE Jean Delvare
2011-05-20 22:11 ` Andrew Morton
2011-05-21 6:48 ` Jean Delvare
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 NNTP newsgroup(s).