From: Jonathan Cameron <jic23@cam.ac.uk>
To: Joe Perches <joe@perches.com>
Cc: Greg KH <gregkh@suse.de>, anish <anish198519851985@gmail.com>,
devel@driverdev.osuosl.org, arnd@arndb.de,
lucas.demarchi@profusion.mobi, linux-kernel@vger.kernel.org,
manuel.stahl@iis.fraunhofer.de
Subject: Re: [PATCH 1/2] staging: iio replaced kmalloc with local variables.
Date: Tue, 07 Jun 2011 10:35:52 +0100 [thread overview]
Message-ID: <4DEDF0F8.7030601@cam.ac.uk> (raw)
In-Reply-To: <1307398257.4994.30.camel@Joe-Laptop>
On 06/06/11 23:10, Joe Perches wrote:
> On Mon, 2011-06-06 at 14:55 -0700, Greg KH wrote:
>> On Tue, Jun 07, 2011 at 12:37:37AM +0530, anish wrote:
>>> From: anish kumar <anish198519851985@gmail.com>
>>> Replace kmalloc with local variables as it was un-necessary and
>>> also removed the redudant code after this change.
>> SPI data, like USB data, has to come from kmalloced data, not from the
>> stack, or bad things can, and will, happen.
>
> Perhaps just add a comment like:
>
> + u8 *tx = kmalloc(2, GFP_KERNEL); /* can't be on stack */
>
> It might be better to do a single kmalloc(4)
> than 2 separate kmalloc(2)'s.
Actually, this little corner of the driver is the only place it isn't
using the buffers allocated with the chip state. After I send our
latest clean up series in these are all explicitly marked
____cacheline_aligned anyway which should make it clear something
a little unusual is going on.
I'll clean up this function and credit it to Anish (if Anish doesn't
mind of course!)
Jonathan
prev parent reply other threads:[~2011-06-07 9:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-06 19:07 [PATCH 1/2] staging: iio replaced kmalloc with local variables anish
2011-06-06 19:13 ` Geert Uytterhoeven
2011-06-06 19:49 ` Dan Carpenter
2011-06-06 19:20 ` Peter Hüwe
2011-06-06 21:55 ` Greg KH
2011-06-06 22:10 ` Joe Perches
2011-06-06 22:21 ` Greg KH
2011-06-06 22:28 ` Joe Perches
2011-06-06 22:41 ` Greg KH
2011-06-06 22:49 ` Joe Perches
[not found] ` <BANLkTimZP1=tOdsn9eNiERr0Up0xHrr=3g@mail.gmail.com>
2011-06-07 9:43 ` Jonathan Cameron
2011-06-07 10:32 ` anish kumar
2011-06-07 11:23 ` Jonathan Cameron
2011-06-07 9:35 ` Jonathan Cameron [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=4DEDF0F8.7030601@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=anish198519851985@gmail.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=manuel.stahl@iis.fraunhofer.de \
/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