2012-05-26 23:32:52

by Michal Nazarewicz

[permalink] [raw]
Subject: [PATCH] usb: gadget: f_mass_storage: change default value of the removable parameter

This commit changes the default value of the removable module parameter
from “y” to “n”. This comes with line with file_storag's default and
seems to be a better default.

Signed-off-by: Michal Nazarewicz <[email protected]>
---
drivers/usb/gadget/f_mass_storage.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

Alternatively I can add a warning about the default being changed and
schedule the change for the future. Dunno if it's worth it.

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index f67b453..72116fa 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -124,7 +124,7 @@
* backing storage.
* ro=b[,b...] Default false, boolean for read-only access.
* removable=b[,b...]
- * Default true, boolean for removable media.
+ * Default false, boolean for removable media.
* cdrom=b[,b...] Default false, boolean for whether to emulate
* a CD-ROM drive.
* nofua=b[,b...] Default false, booleans for ignore FUA flag
@@ -3167,8 +3167,7 @@ fsg_config_from_params(struct fsg_config *cfg,
for (i = 0, lun = cfg->luns; i < cfg->nluns; ++i, ++lun) {
lun->ro = !!params->ro[i];
lun->cdrom = !!params->cdrom[i];
- lun->removable = /* Removable by default */
- params->removable_count <= i || params->removable[i];
+ lun->removable = !!params->removable[i];
lun->filename =
params->file_count > i && params->file[i][0]
? params->file[i]
@@ -3203,4 +3202,3 @@ fsg_common_from_params(struct fsg_common *common,
fsg_config_from_params(&cfg, params);
return fsg_common_init(common, cdev, &cfg);
}
-
--
1.7.7.3


2012-05-27 16:03:49

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH] usb: gadget: f_mass_storage: change default value of the removable parameter

On Sat, 26 May 2012, Michal Nazarewicz wrote:

> This commit changes the default value of the removable module parameter
> from “y” to “n”. This comes with line with file_storag's default and
> seems to be a better default.
>
> Signed-off-by: Michal Nazarewicz <[email protected]>
> ---
> drivers/usb/gadget/f_mass_storage.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> Alternatively I can add a warning about the default being changed and
> schedule the change for the future. Dunno if it's worth it.

I think this patch is good as it stands.

Would you like to write a gadget-mass-storage.txt file for
Documentation/usb? Putting all the instructions for using the
mass-storage gadget in a recognized place would help people to find it.

Alan Stern

2012-05-27 20:59:08

by Michal Nazarewicz

[permalink] [raw]
Subject: Re: [PATCH] usb: gadget: f_mass_storage: change default value of the removable parameter

> On Sat, 26 May 2012, Michal Nazarewicz wrote:
>> This commit changes the default value of the removable module parameter
>> from “y” to “n”. This comes with line with file_storag's default and
>> seems to be a better default.
>>
>> Signed-off-by: Michal Nazarewicz <[email protected]>
>> ---
>> drivers/usb/gadget/f_mass_storage.c | 6 ++----
>> 1 files changed, 2 insertions(+), 4 deletions(-)
>>
>> Alternatively I can add a warning about the default being changed and
>> schedule the change for the future. Dunno if it's worth it.

On Sun, 27 May 2012 09:03:26 -0700, Alan Stern <[email protected]> wrote:
> I think this patch is good as it stands.
>
> Would you like to write a gadget-mass-storage.txt file for
> Documentation/usb? Putting all the instructions for using the
> mass-storage gadget in a recognized place would help people to find it.

Sure.

--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: [email protected]>--------------ooO--(_)--Ooo--