From: "John W. Linville" <linville@tuxdriver.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 15/25] drivers/net/wireless/ipw2x00: Use static const char arrays
Date: Tue, 14 Sep 2010 14:41:43 -0400 [thread overview]
Message-ID: <20100914184142.GE2484@tuxdriver.com> (raw)
In-Reply-To: <9c135a60c2ed3431ee59c8de0b39414f6c10299a.1284406638.git.joe@perches.com>
On Mon, Sep 13, 2010 at 12:47:53PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/wireless/ipw2x00/ipw2100.c | 2 +-
> drivers/net/wireless/ipw2x00/ipw2200.c | 2 +-
> drivers/net/wireless/ipw2x00/libipw_module.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index 61915f3..f64103c 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -4261,7 +4261,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
> {
> struct ipw2100_priv *priv = dev_get_drvdata(d);
> struct net_device *dev = priv->net_dev;
> - char buffer[] = "00000000";
> + char buffer[sizeof("00000000")];
> unsigned long len =
> (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1;
> unsigned long val;
Had to look twice, since you replaced an initialization with a
declaration. But in all these cases the initial value was already
being overwritten before use anyway.
Acked-by: John W. Linville <linville@tuxdriver.com>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index 0f25083..75e83c9 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -1486,7 +1486,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
> {
> struct ipw_priv *priv = dev_get_drvdata(d);
> struct net_device *dev = priv->net_dev;
> - char buffer[] = "00000000";
> + char buffer[sizeof("00000000")];
> unsigned long len =
> (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1;
> unsigned long val;
> diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
> index 32dee2c..d0c8a67 100644
> --- a/drivers/net/wireless/ipw2x00/libipw_module.c
> +++ b/drivers/net/wireless/ipw2x00/libipw_module.c
> @@ -261,7 +261,7 @@ static int debug_level_proc_open(struct inode *inode, struct file *file)
> static ssize_t debug_level_proc_write(struct file *file,
> const char __user *buffer, size_t count, loff_t *pos)
> {
> - char buf[] = "0x00000000\n";
> + char buf[sizeof("0x00000000\n")];
> size_t len = min(sizeof(buf) - 1, count);
> unsigned long val;
>
> --
> 1.7.3.rc1
>
>
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
next prev parent reply other threads:[~2010-09-14 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1284406638.git.joe@perches.com>
2010-09-13 19:47 ` [PATCH 15/25] drivers/net/wireless/ipw2x00: Use static const char arrays Joe Perches
2010-09-14 18:41 ` John W. Linville [this message]
2010-09-13 19:47 ` [PATCH 19/25] drivers/staging: " Joe Perches
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=20100914184142.GE2484@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 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).