Re: [PATCH] gadget/file_storage.c : Add a serial number parameter.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 25 May 2010, Alan Stern wrote:

> >  static       char fsg_string_manufacturer[64];
> >  static const char fsg_string_product[] = DRIVER_DESC;
> > -static       char fsg_string_serial[13];
> > +static       char fsg_string_serial[25];
> 
> Why did you choose 24?  The spec says only that the minimum length is 
> 12 digits.  Since this is an arbitrary choice, you should create a 
> #define'd symbol for it.

I take that back -- there's no need for a special symbol since it 
wouldn't get used anywhere else.

But after further thought, I don't see any reason to limit the string
length (except to make sure it's no longer than 126 characters,
obviously).  After all, you've already got a buffer containing the
user's desired serial number -- there's no reason to copy it.  The only
time you need to use fsg_string_serial[] is when you fall back to the
default string.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux