[lkml]   [2008]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 06/13] PCI: cpqphp: stop managing hotplug_slot->name
On Tue, Sep 09, 2008 at 04:00:32AM -0600, Alex Chiang wrote:
> -static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot)
> -{
> - snprintf(buffer, buffer_size, "%d", slot->number);
> -}

> +
> + scnprintf(name, SLOT_NAME_SIZE, "%d", slot->number);

So ... we're using %d here and %u in acpiphp. Obviously we don't expect
to get a number above 2 billion, but I think if we do have some utterly
bogus firmware that gives us a number above 2 billion, printing a
positive number is a better user experience than a negative number.

We clearly have a common pattern here where hotplug drivers have a
number insteaqd of a name (I would venture this is the most common).
Maybe we need a common helper? I think this is a subject for the
long-term todo list, not something that needs to be addressed in the
context of this patch series.

Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."

 \ /
  Last update: 2008-09-09 17:11    [W:0.153 / U:3.332 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site