diff options
author | Shaun Ruffell <sruffell@digium.com> | 2012-03-16 17:08:04 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2012-03-16 17:08:04 +0000 |
commit | a6164757b2a998e7515b1df7bb477ffbc712190f (patch) | |
tree | c8fdfec169ed100996e9ce84e8c6a9cf90a85c49 | |
parent | 3b0776bc889dff3994b0500ceabd3256f6b8e846 (diff) |
xpp: '%d' -> '%lu' when displaying module_refcount on kernel versions >= 3.3svn_2.4
Upstream commit bd77c047 "module: struct module_ref should contains long
fields" changed the return of module_refcount from int to unsigned long. This
change eliminates a warning from the string format specifier.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10485
Conflicts:
drivers/dahdi/xpp/xproto.c
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@10533 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/xpp/xproto.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/dahdi/xpp/xproto.c b/drivers/dahdi/xpp/xproto.c index 4ae64f9..d5c954b 100644 --- a/drivers/dahdi/xpp/xproto.c +++ b/drivers/dahdi/xpp/xproto.c @@ -75,6 +75,12 @@ static const xproto_table_t *xproto_table(xpd_type_t cardtype) return xprotocol_tables[cardtype]; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) +#define MODULE_REFCOUNT_FORMAT "%s refcount was %d\n" +#else +#define MODULE_REFCOUNT_FORMAT "%s refcount was %lu\n" +#endif + const xproto_table_t *xproto_get(xpd_type_t cardtype) { const xproto_table_t *xtable; @@ -94,7 +100,8 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype) if(xtable) { BUG_ON(!xtable->owner); #ifdef CONFIG_MODULE_UNLOAD - DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner)); + DBG(GENERAL, MODULE_REFCOUNT_FORMAT, xtable->name, + module_refcount(xtable->owner)); #endif if(!try_module_get(xtable->owner)) { ERR("%s: try_module_get for %s failed.\n", __FUNCTION__, xtable->name); @@ -108,7 +115,8 @@ void xproto_put(const xproto_table_t *xtable) { BUG_ON(!xtable); #ifdef CONFIG_MODULE_UNLOAD - DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner)); + DBG(GENERAL, MODULE_REFCOUNT_FORMAT, xtable->name, + module_refcount(xtable->owner)); BUG_ON(module_refcount(xtable->owner) <= 0); #endif module_put(xtable->owner); |