All of lore.kernel.org
 help / color / mirror / Atom feed
From: jay.aurabind@gmail.com (Jay Aurabind)
To: kernelnewbies@lists.kernelnewbies.org
Subject: large frame size warning when compiling
Date: Thu, 08 May 2014 09:24:38 +0530	[thread overview]
Message-ID: <536AFFFE.1090100@gmail.com> (raw)
In-Reply-To: <13485.1399481471@turing-police.cc.vt.edu>


> 
> Allocating 1K on the stack is indeed evil.

Why would you say evil ? I didnt quite get why you meant by that. Is it
at some extremes ? 1K is from the default ubuntu 14.04 config.
> 
>> abx500-core.c had an object of struct device being allocated on stack. So
>> dynamically allocating it makes the warning go away. Are there any
>> implications on using dynamic allocation on this particular code?
> 
> He probably didn't realize or didn't know better.
> 
> Having said that:
> 
>> +	dummy_child = kzalloc(sizeof(struct device),GFP_KERNEL);
> 
> There's no kfree() for this. So you introduced a memory leak.

My bad! "I successfully operated the patient, but forgot the scissors
inside", :D Thanks for pointing out! :)
> 
>>  	list_for_each_entry(dev_entry, &abx500_list, list) {
>> -		dummy_child.parent = dev_entry->dev;
>> +		dummy_child->parent = dev_entry->dev;
>>  		ops = &dev_entry->ops;
>>
>>  		if ((ops != NULL) && (ops->dump_all_banks != NULL))
>> -			ops->dump_all_banks(&dummy_child);
>> +			ops->dump_all_banks(dummy_child);
>>  	}
> 
> 	kfree(dummy_child); /* should go here... */
>>  }
>>  EXPORT_SYMBOL(abx500_dump_all_banks);
> 
> The weird part is that the entries on abx500_list apparently don't
> have valid ->parent pointers already, so we have have to invent dummy ones.
> 
> Anybody understand why that's the case?  This smells like we're not fixing
> the actual problem here, just changing the way we paper it over to be a less
> ugly papering over....
> 
> 
Waiting to hear from the experts!
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 278 bytes
Desc: OpenPGP digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140508/53b0070f/attachment.bin 

  reply	other threads:[~2014-05-08  3:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 16:36 large frame size warning when compiling Jay Aurabind
2014-05-07 16:51 ` Valdis.Kletnieks at vt.edu
2014-05-08  3:54   ` Jay Aurabind [this message]
2014-05-08 15:46     ` Valdis.Kletnieks at vt.edu
2014-05-09 12:09       ` Jay Aurabind
2014-05-09 15:30         ` Valdis.Kletnieks at vt.edu
2014-05-10  6:43           ` Jay Aurabind
2014-05-09 15:56       ` Frank Ch. Eigler
2014-05-08 12:38 ` Martin Kepplinger
2014-05-09 12:13   ` Jay Aurabind
2014-05-09 12:36     ` Paul Davies C

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=536AFFFE.1090100@gmail.com \
    --to=jay.aurabind@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 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.