Re: [PATCH v4 5/5] usb: gadget: mass_storage: Warn if LUNs ids are not contiguous

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

 



On Mon, Jul 20, 2015 at 09:40:48PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 07/20/2015 09:15 PM, Krzysztof Opasiak wrote:
> 
> >According to mass storage specification:
> 
> >"Logical Unit Numbers on the device shall be numbered contiguously
> >  starting from LUN 0 to a maximum LUN of 15 (Fh)"
> 
> >So let's at least print a warning message that LUNs ids should be
> >contiguous.
> 
> >Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
> >Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>
> >---
> >  drivers/usb/gadget/function/f_mass_storage.c |    7 +++++++
> >  1 file changed, 7 insertions(+)
> 
> >diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
> >index 5fcd9a0..69167ad 100644
> >--- a/drivers/usb/gadget/function/f_mass_storage.c
> >+++ b/drivers/usb/gadget/function/f_mass_storage.c
> >@@ -3042,6 +3042,13 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
> >  		return -EINVAL;
> >  	}
> >
> >+	for (i = 0; i < ARRAY_SIZE(common->luns); ++i)
> >+		if (!common->luns[i])
> >+			break;
> >+
> >+	if (ret != i - 1)
> >+		pr_err("LUN ids should be contiguous.\n");
> 
>    I suggest just "LUNs" instead of "LUN ids" which sounds somewhat strange
> (logical unit number ids, hm?).

fixed while applying, thanks

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux