Commit 2cdea215 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] more deprectation bits

Rename the deprecated attribute to __deprecated to make it obvious
this is something special and to avoid namespace clashes.

Mark old module interfaces deprecated.
parent 81a2f2db
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
* and then gcc will emit a warning for each usage of the function. * and then gcc will emit a warning for each usage of the function.
*/ */
#if __GNUC__ >= 3 #if __GNUC__ >= 3
#define deprecated __attribute__((deprecated)) #define __deprecated __attribute__((deprecated))
#else #else
#define deprecated #define __deprecated
#endif #endif
/* This macro obfuscates arithmetic on a variable address so that gcc /* This macro obfuscates arithmetic on a variable address so that gcc
......
...@@ -108,7 +108,7 @@ extern struct resource * __request_region(struct resource *, unsigned long start ...@@ -108,7 +108,7 @@ extern struct resource * __request_region(struct resource *, unsigned long start
#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) #define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
extern int deprecated __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); extern void __release_region(struct resource *, unsigned long, unsigned long);
#define get_ioport_list(buf) get_resource_list(&ioport_resource, buf, PAGE_SIZE) #define get_ioport_list(buf) get_resource_list(&ioport_resource, buf, PAGE_SIZE)
......
...@@ -296,9 +296,20 @@ extern spinlock_t modlist_lock; ...@@ -296,9 +296,20 @@ extern spinlock_t modlist_lock;
#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
/* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
#define __MOD_INC_USE_COUNT(mod) \ static inline void __deprecated __MOD_INC_USE_COUNT(struct module *module)
do { __unsafe(mod); (void)try_module_get(mod); } while(0) {
#define __MOD_DEC_USE_COUNT(mod) module_put(mod) __unsafe(module);
/*
* Yes, we ignore the retval here, that's why it's deprecated.
*/
try_module_get(module);
}
static inline void __deprecated __MOD_DEC_USE_COUNT(struct module *module)
{
module_put(module);
}
#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE) #define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE)
struct obsolete_modparm { struct obsolete_modparm {
...@@ -319,14 +330,21 @@ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \ ...@@ -319,14 +330,21 @@ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
/* People do this inside their init routines, when the module isn't /* People do this inside their init routines, when the module isn't
"live" yet. They should no longer be doing that, but "live" yet. They should no longer be doing that, but
meanwhile... */ meanwhile... */
static inline void __deprecated _MOD_INC_USE_COUNT(struct module *module)
{
__unsafe(module);
#if defined(CONFIG_MODULE_UNLOAD) && defined(MODULE) #if defined(CONFIG_MODULE_UNLOAD) && defined(MODULE)
#define MOD_INC_USE_COUNT \ local_inc(&module->ref[get_cpu()].count);
do { __unsafe(THIS_MODULE); local_inc(&THIS_MODULE->ref[get_cpu()].count); put_cpu(); } while (0) put_cpu();
#else #else
#define MOD_INC_USE_COUNT \ try_module_get(module);
do { __unsafe(THIS_MODULE); (void)try_module_get(THIS_MODULE); } while (0)
#endif #endif
#define MOD_DEC_USE_COUNT module_put(THIS_MODULE) }
#define MOD_INC_USE_COUNT \
_MOD_INC_USE_COUNT(THIS_MODULE)
#define MOD_DEC_USE_COUNT \
__MOD_DEC_USE_COUNT(THIS_MODULE)
#define try_inc_mod_count(mod) try_module_get(mod) #define try_inc_mod_count(mod) try_module_get(mod)
#define EXPORT_NO_SYMBOLS #define EXPORT_NO_SYMBOLS
extern int module_dummy_usage; extern int module_dummy_usage;
......
...@@ -237,7 +237,7 @@ struct resource * __request_region(struct resource *parent, unsigned long start, ...@@ -237,7 +237,7 @@ struct resource * __request_region(struct resource *parent, unsigned long start,
return res; return res;
} }
int deprecated __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; struct resource * res;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment