Re: [PATCH v5 06/15] usb/gadget: f_mass_storage: create fsg_common_set_ops/_private_data for use in fsg_common_init

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

 



On Thu, Oct 03 2013, Andrzej Pietrasiewicz wrote:
> fsg_common_init is a lengthy function. Factor portions of it out.
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
> ---
>  drivers/usb/gadget/f_mass_storage.c |   16 ++++++++++++++--
>  drivers/usb/gadget/f_mass_storage.h |    5 +++++
>  2 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
> index 16a44e1..39f7f1f 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -2789,6 +2789,17 @@ int fsg_common_set_nluns(struct fsg_common *common, int nluns)
>  	return 0;
>  }
>  
> +void fsg_common_set_ops(struct fsg_common *common,
> +			const struct fsg_operations *ops)
> +{
> +	common->ops = ops;
> +}
> +
> +void fsg_common_set_private_data(struct fsg_common *common, void *priv)
> +{
> +	common->private_data = priv;
> +}
> +

This looks like over engineering to me to be honest.  What's wrong with
directly setting the fields in the structure?  At the very least, those
should be static inlines in the header file.

>  #define MAX_LUN_NAME_LEN 80
>  
>  struct fsg_common *fsg_common_init(struct fsg_common *common,

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

Attachment: signature.asc
Description: PGP 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