public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Kepplinger <martink@posteo.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	lidza.louina@gmail.com, driverdev-devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: dgnc: fix compile warning frame size is larger than 1024 bytes
Date: Tue, 06 May 2014 15:40:08 +0200	[thread overview]
Message-ID: <5368E638.4070601@posteo.de> (raw)
In-Reply-To: <20140506133326.GU26890@mwanda>

Am 2014-05-06 15:33, schrieb Dan Carpenter:
> On Tue, May 06, 2014 at 02:41:37PM +0200, Martin Kepplinger wrote:
>> fix following warning by dynamically allocating memory:
>> dgnc_tty.c:583:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>>
>> Signed-off-by: Martin Kepplinger <martink@posteo.de>
>> ---
>> This is more of a question. Is this a desired solution to fixing such a
>> frame size warning?
> 
> This warning is because the kernel uses an 8k stack so you add up all
> the stack memory used by each function from the syscall to here.  If
> it adds up to more than 8k then it's a bug.  The 1k limit per function
> is just a hack to spot where people are maybe being reckless.

nice. thanks.

> 
> There are no kfree()s and this function is called with a spin_lock held
> so this patch introduces a couple bugs.

I know, it should have been just a question (probably to kernelnewbies'
list). Sorry for the noise.

> 
> There may be a better way to allocate this.  Like maybe at probe() and
> then use spinlocks to serialize access to the buffer.  But sometimes
> that's a very bad idea.
> 
> It's better if you know the driver a bit and can test things.
> 
> regards,
> dan carpenter
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


      reply	other threads:[~2014-05-06 13:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 12:41 [PATCH] staging: dgnc: fix compile warning frame size is larger than 1024 bytes Martin Kepplinger
2014-05-06 13:33 ` Dan Carpenter
2014-05-06 13:40   ` Martin Kepplinger [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=5368E638.4070601@posteo.de \
    --to=martink@posteo.de \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lidza.louina@gmail.com \
    --cc=linux-kernel@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