netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: module_param: make bool parameters really bool (net & drivers/net)
@ 2012-03-22 18:26 Dan Carpenter
  2012-03-22 18:30 ` Dan Carpenter
  2012-03-22 22:07 ` Rusty Russell
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2012-03-22 18:26 UTC (permalink / raw)
  To: rusty; +Cc: netdev

Hi Rusty,

The patch eb93992207da: "module_param: make bool parameters really
bool (net & drivers/net)" from Dec 19, 2011, leads to the following
warning:
net/ipv4/netfilter/iptable_filter.c:90 iptable_filter_init()
	warn: 5 is more than 1 (max 'forward' can be) so this is
	always the same.

It's declared like this:

    54  /* Default to forward because I got too much mail already. */
    55  static bool forward = NF_ACCEPT;
    56  module_param(forward, bool, 0000);


It's used like this:
    66          ((struct ipt_standard *)repl->entries)[1].target.verdict = -forward - 1;

Smatch complains when check that it's larger than 5.

    90          if (forward < 0 || forward > NF_MAX_VERDICT) {
    91                  pr_err("iptables forward must be 0 or 1\n");
    92                  return -EINVAL;
    93          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-23  2:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22 18:26 module_param: make bool parameters really bool (net & drivers/net) Dan Carpenter
2012-03-22 18:30 ` Dan Carpenter
2012-03-22 22:07 ` Rusty Russell
2012-03-22 22:27   ` [PATCH] netfilter: remove forward module param confusion Rusty Russell
2012-03-23  2:36     ` David Miller

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).