All of lore.kernel.org
 help / color / mirror / Atom feed
From: Djalal Harouni <tixxdz@opendz.org>
To: "Berg, Johannes" <johannes.berg@intel.com>
Cc: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>,
	Intel Linux Wireless <ilw@linux.intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] iwlwifi: mvm: make debugfs write() operations write up to count bytes
Date: Mon, 12 Aug 2013 13:33:09 +0100	[thread overview]
Message-ID: <20130812123309.GA2911@dztty> (raw)
In-Reply-To: <1DC40B07CD6EC041A66726C271A73AE61AA5E38C@IRSMSX102.ger.corp.intel.com>

On Mon, Aug 12, 2013 at 08:19:12AM +0000, Berg, Johannes wrote:
> > Some debugfs write() operations of the MVM Firmware will ignore the count
> > argument, and will copy more bytes than what was specified.
> > Fix this by getting the right count of bytes.
> > 
> > This will also honor restrictions put on the number of bytes to write.
> 
> That makes some sense.
And avoid strncmp() on garbage data.

> > To be consitant this patch also switches the initializer from 'char buf[x] = {}' to
> > the explicit memset() as it is done in other places of the same file.
> 
> I'd rather this (a) be done in a separate patch, and (b) the other way around, switch everything to C99.
Ok

> > Cc: stable@vger.kernel.org
> 
> That doesn't really make sense for the debugfs interface.
Ok

> > +	memset(buf, 0, sizeof(buf));
> > +	if (count > sizeof(buf) - 1)
> > +		count = sizeof(buf) - 1;
> 
> Why -1? And why not use min()/min_t()?
Yes -1 to be sure that the processed string is null terminated

Ok will use min_t 


Will send a second version, Thanks!

> johannes
> -- 
> 
> Intel GmbH
> Dornacher Strasse 1
> 85622 Feldkirchen/Muenchen, Deutschland
> Sitz der Gesellschaft: Feldkirchen bei Muenchen
> Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
> Registergericht: Muenchen HRB 47456
> Ust.-IdNr./VAT Registration No.: DE129385895
> Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
> 

-- 
Djalal Harouni
http://opendz.org

      reply	other threads:[~2013-08-12 12:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12  0:39 [PATCH] iwlwifi: mvm: make debugfs write() operations write up to count bytes Djalal Harouni
2013-08-12  8:19 ` Berg, Johannes
2013-08-12 12:33   ` Djalal Harouni [this message]

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=20130812123309.GA2911@dztty \
    --to=tixxdz@opendz.org \
    --cc=emmanuel.grumbach@intel.com \
    --cc=ilw@linux.intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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.