kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* large frame size warning when compiling
@ 2014-05-07 16:36 Jay Aurabind
  2014-05-07 16:51 ` Valdis.Kletnieks at vt.edu
  2014-05-08 12:38 ` Martin Kepplinger
  0 siblings, 2 replies; 11+ messages in thread
From: Jay Aurabind @ 2014-05-07 16:36 UTC (permalink / raw)
  To: kernelnewbies

Hello list, Time for a noob discussion,

When I was building the kernel, I found a warning from drivers/mfd/abx500-core.c, that the Frame size is larger than 1024 bytes. Apparently the stack frame size can be changed from the config, but my question is, whether 1024 bytes low ? I am on an x86_64 (core i3). 

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? I
mean, could there be some reason why the original developer went with static option ?


---
 drivers/mfd/abx500-core.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
index f3a15aa..709a84f 100644
--- a/drivers/mfd/abx500-core.c
+++ b/drivers/mfd/abx500-core.c
@@ -154,15 +154,17 @@ EXPORT_SYMBOL(abx500_startup_irq_enabled);
 void abx500_dump_all_banks(void)
 {
 	struct abx500_ops *ops;
-	struct device dummy_child = {NULL};
+	struct device *dummy_child;
 	struct abx500_device_entry *dev_entry;
 
+	dummy_child = kzalloc(sizeof(struct device),GFP_KERNEL);
+
 	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);
 	}
 }
 EXPORT_SYMBOL(abx500_dump_all_banks);
-- 
1.9.1


--
Thanks and Regards,
Jay Aurabind
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140507/a7231430/attachment.bin 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-05-10  6:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).