Re: [PATCH] firmware: avoiding multiple replication for same firmware file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Tuesday, August 5, 2008 - 2:03 pm

On Fri, 01 Aug 2008 11:30:59 +0530
Jaswinder Singh <jaswinder@infradead.org> wrote:


OK, that's a per-item data structure.


No, we shouldn't declare an entire static `struct firmware_list' just
for storage of all the dynamically allocated ones. Instead simply do:

static LIST_HEAD(firmwarelist);

and use that.

Please also add a comment indicating which lock protects that global
list.  If it is indeed protected.  If not, fix it.  If no fix is
needed, add a comment explaining why this list doesn't need locking.


And this becomes

	list_for_each_entry(tmp, &firmwarelist, list)


I don't think that existing printk was needed - the page allocator (or
the oom-killer) will dump information for us in the unlikely event that
this allocation failed.


So the newly-added ones don't have much value.


Could have been kmalloc(), but see below.


Unneeeded printk.


Please replace the kmalloc+strcpy with a call to kstrdup().


That is excessively parenthesised.

There is no locking for that list.


locking.



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] firmware: avoiding multiple replication for sa ..., Andrew Morton, (Tue Aug 5, 2:03 pm)