Skip to contentSkip to conversation

linux-next: net tree build warnings

PATCH Applied Stephen Rothwell 4 participants 10 messages Mar 26, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced these warnings:

net/bridge/netfilter/ebt_log.c: In function 'ebt_log_init':
net/bridge/netfilter/ebt_log.c:230: warning: passing argument 2 of 'nf_log_register' discards qualifiers from pointer target type net/bridge/netfilter/ebt_log.c: In function 'ebt_log_fini':
net/bridge/netfilter/ebt_log.c:236: warning: passing argument 1 of 'nf_log_unregister' discards qualifiers from pointer target type net/bridge/netfilter/ebt_ulog.c: In function 'ebt_ulog_init':
net/bridge/netfilter/ebt_ulog.c:317: warning: passing argument 2 of 'nf_log_register' discards qualifiers from pointer target type net/bridge/netfilter/ebt_ulog.c: In function 'ebt_ulog_fini':
net/bridge/netfilter/ebt_ulog.c:327: warning: passing argument 1 of 'nf_log_unregister' discards qualifiers from pointer target type

Caused by commit ca735b3aaa945626ba65a3e51145bfe4ecd9e222 ("netfilter:
use a linked list of loggers") which removed const from the "struct nf_logger *" arguments.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#1 lore raw

Hi Stephen,

Quoted 4 lines · Stephen Rothwell

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced these warnings:

Quoted 8 lines

net/bridge/netfilter/ebt_log.c: In function 'ebt_log_init':
net/bridge/netfilter/ebt_log.c:230: warning: passing argument 2 of 'nf_log_register' discards qualifiers from pointer target type net/bridge/netfilter/ebt_log.c: In function 'ebt_log_fini':
net/bridge/netfilter/ebt_log.c:236: warning: passing argument 1 of 'nf_log_unregister' discards qualifiers from pointer target type net/bridge/netfilter/ebt_ulog.c: In function 'ebt_ulog_init':
net/bridge/netfilter/ebt_ulog.c:317: warning: passing argument 2 of 'nf_log_register' discards qualifiers from pointer target type net/bridge/netfilter/ebt_ulog.c: In function 'ebt_ulog_fini':
net/bridge/netfilter/ebt_ulog.c:327: warning: passing argument 1 of 'nf_log_unregister' discards qualifiers from pointer target type

Thanks a lot for pointing this. I stupidely forgot to build this module during my testing.

I've made the necessary modifications and a patch fixing this will follow this mail.

Doing some testing of the ebt_ulog module, I've found some problems. One of them was the following messages:

sys_init_module: 'ebt_ulog'->init suspiciously returned 1, it should follow 0/-E convention
sys_init_module: loading module anyway...
Pid: 2334, comm: modprobe Not tainted 2.6.29-rc5edenwall0-00883-g199e57b #146

Call Trace:
 [<c0441b81>] ? printk+0xf/0x16
 [<c02311af>] sys_init_module+0x107/0x186
 [<c0202cfa>] syscall_call+0x7/0xb

A patch fixing this will also follow.

BR,

Signature · 3 lines
Eric Leblond <[email protected]>
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
#2 lore raw

PATCH 1/3 netfilter: fix warning about invalid const usage

This patch fixes the declaration of the logger structure in ebt_log and ebt_ulog: I forgot to remove the const option from their declaration in the commit ca735b3aaa945626ba65a3e51145bfe4ecd9e222 ("netfilter:
use a linked list of loggers").

---
 net/bridge/netfilter/ebt_log.c  |    2 +-
 net/bridge/netfilter/ebt_ulog.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/bridge/netfilter/ebt_log.c +1 -1
index d44cbf8..a94f3cc 100644
@@ -214,7 +214,7 @@ static struct xt_target ebt_log_tg_reg __read_mostly = {
 	.me		= THIS_MODULE,
 };
 
-static const struct nf_logger ebt_log_logger = {
+static struct nf_logger ebt_log_logger __read_mostly = {
 	.name 		= "ebt_log",
 	.logfn		= &ebt_log_packet,
 	.me		= THIS_MODULE,
net/bridge/netfilter/ebt_ulog.c +1 -1
index 2c6d682..80c78c5 100644
@@ -279,7 +279,7 @@ static struct xt_target ebt_ulog_tg_reg __read_mostly = {
 	.me		= THIS_MODULE,
 };
 
-static const struct nf_logger ebt_ulog_logger = {
+static struct nf_logger ebt_ulog_logger __read_mostly = {
 	.name		= "ulog",
 	.logfn		= &ebt_log_packet,
 	.me		= THIS_MODULE,
Signature · 1 line
1.5.6.3
maintainer Applied
#3 lore raw

Re: [PATCH 1/3] netfilter: fix warning about invalid const usage

From: Eric Leblond <[email protected]>
Date: Thu, 26 Mar 2009 08:59:54 +0100

Quoted 7 lines

This patch fixes the declaration of the logger structure in ebt_log and ebt_ulog: I forgot to remove the const option from their declaration in the commit ca735b3aaa945626ba65a3e51145bfe4ecd9e222 ("netfilter:
use a linked list of loggers").

Applied.

#4 lore raw

PATCH 2/3 netfilter: fix warning in ebt_ulog init function.

In reply to Eric Leblond

The ebt_ulog module does not follow the fixed convention about function return. Loading the module is triggering the following message:

sys_init_module: 'ebt_ulog'->init suspiciously returned 1, it should follow 0/-E convention
sys_init_module: loading module anyway...
Pid: 2334, comm: modprobe Not tainted 2.6.29-rc5edenwall0-00883-g199e57b #146

Call Trace:
 [<c0441b81>] ? printk+0xf/0x16
 [<c02311af>] sys_init_module+0x107/0x186
 [<c0202cfa>] syscall_call+0x7/0xb

The following patch fixes the return treatment in ebt_ulog_init() function.

---
 net/bridge/netfilter/ebt_ulog.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
net/bridge/netfilter/ebt_ulog.c +5 -5
index 80c78c5..ac6fa43 100644
@@ -287,13 +287,13 @@ static struct nf_logger ebt_ulog_logger __read_mostly = {
 
 static int __init ebt_ulog_init(void)
 {
-	bool ret = true;
+	int ret;
 	int i;
 
 	if (nlbufsiz >= 128*1024) {
 		printk(KERN_NOTICE "ebt_ulog: Netlink buffer has to be <= 128kB,"
 		       " please try a smaller nlbufsiz parameter.\n");
-		return false;
+		return -EINVAL;
 	}
 
 	/* initialize ulog_buffers */
@@ -308,12 +308,12 @@ static int __init ebt_ulog_init(void)
 	if (!ebtulognl) {
 		printk(KERN_WARNING KBUILD_MODNAME ": out of memory trying to "
 		       "call netlink_kernel_create\n");
-		ret = false;
-	} else if (xt_register_target(&ebt_ulog_tg_reg) != 0) {
+		ret = -ENOMEM;
+	} else if ((ret = xt_register_target(&ebt_ulog_tg_reg)) != 0) {
 		netlink_kernel_release(ebtulognl);
 	}
 
-	if (ret)
+	if (ret == 0)
 		nf_log_register(NFPROTO_BRIDGE, &ebt_ulog_logger);
 
 	return ret;
Signature · 1 line
1.5.6.3
maintainer Applied
#5 lore raw

Re: [PATCH 2/3] netfilter: fix warning in ebt_ulog init function.

From: Eric Leblond <[email protected]>
Date: Thu, 26 Mar 2009 08:59:55 +0100

Quoted 11 lines

The ebt_ulog module does not follow the fixed convention about function return. Loading the module is triggering the following message:

sys_init_module: 'ebt_ulog'->init suspiciously returned 1, it should follow 0/-E convention
sys_init_module: loading module anyway...
Pid: 2334, comm: modprobe Not tainted 2.6.29-rc5edenwall0-00883-g199e57b #146

Call Trace:
 [<c0441b81>] ? printk+0xf/0x16
 [<c02311af>] sys_init_module+0x107/0x186
 [<c0202cfa>] syscall_call+0x7/0xb
Quoted 4 lines

The following patch fixes the return treatment in ebt_ulog_init() function.

Applied.

#6 lore raw

PATCH 3/3 netfilter: fix nf_logger name in ebt_ulog.

In reply to Eric Leblond

This patch renames the ebt_ulog nf_logger from "ulog" to "ebt_ulog" to be in sync with other modules naming. As this name was currently only used for informational purpose, the renaming should be harmless.

---
 net/bridge/netfilter/ebt_ulog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bridge/netfilter/ebt_ulog.c +1 -1
index ac6fa43..133eeae 100644
@@ -280,7 +280,7 @@ static struct xt_target ebt_ulog_tg_reg __read_mostly = {
 };
 
 static struct nf_logger ebt_ulog_logger __read_mostly = {
-	.name		= "ulog",
+	.name		= "ebt_ulog",
 	.logfn		= &ebt_log_packet,
 	.me		= THIS_MODULE,
 };
Signature · 1 line
1.5.6.3
maintainer Applied
#7 lore raw

Re: [PATCH 3/3] netfilter: fix nf_logger name in ebt_ulog.

From: Eric Leblond <[email protected]>
Date: Thu, 26 Mar 2009 08:59:56 +0100

Quoted 5 lines

This patch renames the ebt_ulog nf_logger from "ulog" to "ebt_ulog" to be in sync with other modules naming. As this name was currently only used for informational purpose, the renaming should be harmless.

Applied.

#8 lore raw
In reply to Eric Leblond
Quoted 16 lines · Eric Leblond

Hi Stephen,

Quoted 4 lines · Stephen Rothwell

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced these warnings:

Quoted 8 lines

net/bridge/netfilter/ebt_log.c: In function 'ebt_log_init':
net/bridge/netfilter/ebt_log.c:230: warning: passing argument 2 of 'nf_log_register' discards qualifiers from pointer target type net/bridge/netfilter/ebt_log.c: In function 'ebt_log_fini':
net/bridge/netfilter/ebt_log.c:236: warning: passing argument 1 of 'nf_log_unregister' discards qualifiers from pointer target type net/bridge/netfilter/ebt_ulog.c: In function 'ebt_ulog_init':
net/bridge/netfilter/ebt_ulog.c:317: warning: passing argument 2 of 'nf_log_register' discards qualifiers from pointer target type net/bridge/netfilter/ebt_ulog.c: In function 'ebt_ulog_fini':
net/bridge/netfilter/ebt_ulog.c:327: warning: passing argument 1 of 'nf_log_unregister' discards qualifiers from pointer target type

Quoted 2 lines

Thanks a lot for pointing this. I stupidely forgot to build this module during my testing.

Same here, I seem to have accidentally disabled bridging in my test builds, sorry.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to Eric Leblond

Hi Eric,

Quoted 6 lines · On Thu, 26 Mar 2009 08:50:19 +0100 Eric Leblond <[email protected]> wrote:

Thanks a lot for pointing this. I stupidely forgot to build this module during my testing.

I've made the necessary modifications and a patch fixing this will follow this mail.

Thanks.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/