Re: [PATCH] deprecated function attribute

From: william stinson (wstinson@wanadoo.fr)
Date: Sat Dec 28 2002 - 18:32:48 EST


Hi Robert,

here's a patch to mark check_region "deprecated".

I have not done much testing with it yet (and maybe there is a more elegant implementation)

I do get nice warning messages for programs that still use check_region for example
        drivers/parport/parport_pc.c:2215: warning: `__check_region' is deprecated (declared at include/linux/ioport.h:111)

Best regards
William

--- linux-2.5.53/kernel/resource.c 2002-12-28 23:05:37.000000000 +0100
+++ linux-local/kernel/resource.c 2002-12-28 23:05:55.000000000 +0100
@@ -237,7 +237,7 @@
         return res;
 }
 
-int __check_region(struct resource *parent, unsigned long start, unsigned long n)
+int deprecated __check_region(struct resource *parent, unsigned long start, unsigned long n)
 {
         struct resource * res;
 
--- linux-2.5.53/include/linux/ioport.h 2002-12-28 23:02:52.000000000 +0100
+++ linux-local/include/linux/ioport.h 2002-12-28 23:14:46.000000000 +0100
@@ -8,6 +8,7 @@
 #ifndef _LINUX_IOPORT_H
 #define _LINUX_IOPORT_H
 
+#include <linux/compiler.h>
 /*
  * Resources are tree-like, allowing
  * nesting etc..
@@ -107,7 +108,7 @@
 #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
 #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
 
-extern int __check_region(struct resource *, unsigned long, unsigned long);
+extern int deprecated __check_region(struct resource *, unsigned long, unsigned long);
 extern void __release_region(struct resource *, unsigned long, unsigned long);
 
 #define get_ioport_list(buf) get_resource_list(&ioport_resource, buf, PAGE_SIZE)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Dec 31 2002 - 22:00:13 EST