All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ron Mercer <ron.mercer@qlogic.com>
To: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Milton Miller <miltonm@bga.com>,
	Linux Driver <Linux-Driver@qlogic.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
Date: Thu, 18 Nov 2010 09:22:24 -0800	[thread overview]
Message-ID: <20101118172224.GA14333@linux-ox1b.qlogic.org> (raw)
In-Reply-To: <1290075903-3038-1-git-send-email-sonnyrao@linux.vnet.ibm.com>

On Thu, Nov 18, 2010 at 02:25:03AM -0800, Sonny Rao wrote:
> Driver appears to be mistaking the permission field with default value
> in the case of debug and qlge_irq_type.
> 
> Driver is also passing debug as a bitmask into netif_msg_init()
> which really wants a number of bits, so fix that.
> 
> Signed-off-by: Milton Miller <miltonm@bga.com>
> Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
> ---
>  drivers/net/qlge/qlge_main.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
> index d9a7626..66878bb 100644
> --- a/drivers/net/qlge/qlge_main.c
> +++ b/drivers/net/qlge/qlge_main.c
> @@ -62,15 +62,15 @@ static const u32 default_msg =
>  /* NETIF_MSG_PKTDATA | */
>      NETIF_MSG_HW | NETIF_MSG_WOL | 0;
>  
> -static int debug = 0x00007fff;	/* defaults above */
> -module_param(debug, int, 0);
> +static int debug = 15;	/* defaults above */


I think what we want here is:

> +static int debug = -1;	/* defaults above */

This will correct it and maintain the current behavior.
By passing in the 0x00007ffff we were getting the passed in default
paramter from the 2nd compare in the first if statement below. If we set
debug to 15 then it looks like we would turn on all bits rather than
qlge default.

static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
{
        /* use default */
        if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
                return default_msg_enable_bits;
        if (debug_value == 0)   /* no output */
                return 0;
        /* set low N bits */
        return (1 << debug_value) - 1;
}


  reply	other threads:[~2010-11-18 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 10:25 [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level Sonny Rao
2010-11-18 17:22 ` Ron Mercer [this message]
2010-11-18 19:30 ` David Miller
2010-11-22 16:29 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2010-11-18 21:50 Sonny Rao
2010-11-18 22:17 ` Ron Mercer
2010-11-18 23:12   ` Sonny Rao
2010-11-18 23:12     ` Sonny Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101118172224.GA14333@linux-ox1b.qlogic.org \
    --to=ron.mercer@qlogic.com \
    --cc=Linux-Driver@qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miltonm@bga.com \
    --cc=netdev@vger.kernel.org \
    --cc=sonnyrao@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.