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

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

 



Hi,

Le 27/05/2010 10:59, Michał Nazarewicz a écrit :
>> checkpatch.pl don't catch this, nor am i... I now see the point.
> 
> It seems checkpatch.pl has problems with compound initialisers if it
> does not recognise the above case.
To be sure, i've launch checkpatch.pl against the whole file : 156 errors (wow),
but none related to this.

> Sort of but not quite.  The fsg_serial_string is accessed by the gadget via
> the fsg_strings array in storage_common.c.  To avoid copying of the serial
> it is enough to change pointer in the array hence:
> 
> fsg_strings[FSG_STRING_SERIAL - 1] = mod_data.serial_parm;
> 
> Note that FSG_STRING_* are indexed from one (in case of file_storage)
> whereas entries in fsg_strings are indexed from zero hence the "- 1".
Got it. 
We're left with an unused array when serial is submitted. Should it be better
to create it on-the-fly when necessary (fallback serial), using a kmalloc call ?
And in this case, when to kfree it ?

-- 
Yann Cantin
A4FEB47F
--


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