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 <[email protected]>
> Signed-off-by: Kyungmin Park <[email protected]>
> ---
>  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 +--<[email protected]>--<xmpp:[email protected]>--ooO--(_)--Ooo--

Attachment: signature.asc
Description: PGP signature

Reply via email to