All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
To: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: julia.lawall-L2FTfq7BK8M@public.gmane.org,
	rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org,
	lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	knaack.h-Mmb7MZpHnFY@public.gmane.org,
	lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org,
	pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	hch-jcswGhMUV9g@public.gmane.org,
	sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org,
	kishon-l0cyMroinI0@public.gmane.org,
	bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org,
	balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org,
	ccaulfie-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	teigland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	mfasheh-rOS7oXVqrJRBDgjK7y7TUQ@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org
Subject: Re: [PATCH v2 02/15] usb: gadget: make config_item_type structures const
Date: Wed, 18 Oct 2017 19:05:11 +0300	[thread overview]
Message-ID: <1985905.z83BJQzMUS@avalon> (raw)
In-Reply-To: <1508167134-6243-3-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Bhumika,

Thank you for the patch.

On Monday, 16 October 2017 18:18:41 EEST Bhumika Goyal wrote:
> Make these structures const as they are only passed to the const
> argument of the functions config_{group/item}_init_type_name.
> 
> Signed-off-by: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> * Changes in v2- Combine all the followup patches and the constification
> patches into a series.
> 
>  drivers/usb/gadget/function/f_acm.c          |  2 +-
>  drivers/usb/gadget/function/f_ecm.c          |  2 +-
>  drivers/usb/gadget/function/f_eem.c          |  2 +-
>  drivers/usb/gadget/function/f_fs.c           |  2 +-
>  drivers/usb/gadget/function/f_hid.c          |  2 +-
>  drivers/usb/gadget/function/f_loopback.c     |  2 +-
>  drivers/usb/gadget/function/f_mass_storage.c |  4 +--
>  drivers/usb/gadget/function/f_midi.c         |  2 +-
>  drivers/usb/gadget/function/f_ncm.c          |  2 +-
>  drivers/usb/gadget/function/f_obex.c         |  2 +-
>  drivers/usb/gadget/function/f_phonet.c       |  2 +-
>  drivers/usb/gadget/function/f_printer.c      |  2 +-
>  drivers/usb/gadget/function/f_rndis.c        |  2 +-
>  drivers/usb/gadget/function/f_serial.c       |  2 +-
>  drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
>  drivers/usb/gadget/function/f_subset.c       |  2 +-
>  drivers/usb/gadget/function/f_tcm.c          |  2 +-
>  drivers/usb/gadget/function/f_uac1.c         |  2 +-
>  drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
>  drivers/usb/gadget/function/f_uac2.c         |  2 +-
>  drivers/usb/gadget/function/uvc_configfs.c   | 50 ++++++++++++------------
>  21 files changed, 46 insertions(+), 46 deletions(-)

[snip]

> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -127,7 +127,7 @@ static struct uvcg_control_header
> *to_uvcg_control_header(struct config_item *it NULL,
>  };
> 
> -static struct config_item_type uvcg_control_header_type = {
> +static const struct config_item_type uvcg_control_header_type = {
>  	.ct_attrs	= uvcg_control_header_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group
> *group, .drop_item		= uvcg_control_header_drop,
>  };
> 
> -static struct config_item_type uvcg_control_header_grp_type = {
> +static const struct config_item_type uvcg_control_header_grp_type = {
>  	.ct_group_ops	= &uvcg_control_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> NULL,
>  };
> 
> -static struct config_item_type uvcg_default_processing_type = {
> +static const struct config_item_type uvcg_default_processing_type = {
>  	.ct_attrs	= uvcg_default_processing_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> struct config_group	group;
>  } uvcg_processing_grp;
> 
> -static struct config_item_type uvcg_processing_grp_type = {
> +static const struct config_item_type uvcg_processing_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_camera_type = {
> +static const struct config_item_type uvcg_default_camera_type = {
>  	.ct_attrs	= uvcg_default_camera_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_camera_grp;
> 
> -static struct config_item_type uvcg_camera_grp_type = {
> +static const struct config_item_type uvcg_camera_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_output_type = {
> +static const struct config_item_type uvcg_default_output_type = {
>  	.ct_attrs	= uvcg_default_output_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_output_grp;
> 
> -static struct config_item_type uvcg_output_grp_type = {
> +static const struct config_item_type uvcg_output_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_terminal_grp;
> 
> -static struct config_item_type uvcg_terminal_grp_type = {
> +static const struct config_item_type uvcg_terminal_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_control_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_control_class_type = {
> +static const struct config_item_type uvcg_control_class_type = {
>  	.ct_item_ops	= &uvcg_control_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_class_grp;
> 
> -static struct config_item_type uvcg_control_class_grp_type = {
> +static const struct config_item_type uvcg_control_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_grp;
> 
> -static struct config_item_type uvcg_control_grp_type = {
> +static const struct config_item_type uvcg_control_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, NULL,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_type = {
> +static const struct config_item_type uvcg_streaming_header_type = {
>  	.ct_item_ops	= &uvcg_streaming_header_item_ops,
>  	.ct_attrs	= uvcg_streaming_header_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct
> config_group *group, .drop_item		= uvcg_streaming_header_drop,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_grp_type = {
> +static const struct config_item_type uvcg_streaming_header_grp_type = {
>  	.ct_group_ops	= &uvcg_streaming_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1150,7 +1150,7 @@ static ssize_t
> uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_frame_type = {
> +static const struct config_item_type uvcg_frame_type = {
>  	.ct_attrs	= uvcg_frame_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1419,7 +1419,7 @@ static ssize_t
> uvcg_uncompressed_guid_format_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_type = {
> +static const struct config_item_type uvcg_uncompressed_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_group_ops,
>  	.ct_attrs	= uvcg_uncompressed_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group
> *group, .drop_item		= uvcg_uncompressed_drop,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_grp_type = {
> +static const struct config_item_type uvcg_uncompressed_grp_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct
> config_item *item) NULL,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_type = {
> +static const struct config_item_type uvcg_mjpeg_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_group_ops,
>  	.ct_attrs	= uvcg_mjpeg_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, .drop_item		= uvcg_mjpeg_drop,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_grp_type = {
> +static const struct config_item_type uvcg_mjpeg_grp_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, NULL,
>  };
> 
> -static struct config_item_type uvcg_default_color_matching_type = {
> +static const struct config_item_type uvcg_default_color_matching_type = {
>  	.ct_attrs	= uvcg_default_color_matching_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, struct config_group	group;
>  } uvcg_color_matching_grp;
> 
> -static struct config_item_type uvcg_color_matching_grp_type = {
> +static const struct config_item_type uvcg_color_matching_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_streaming_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_streaming_class_type = {
> +static const struct config_item_type uvcg_streaming_class_type = {
>  	.ct_item_ops	= &uvcg_streaming_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_class_grp;
> 
> -static struct config_item_type uvcg_streaming_class_grp_type = {
> +static const struct config_item_type uvcg_streaming_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_grp;
> 
> -static struct config_item_type uvcg_streaming_grp_type = {
> +static const struct config_item_type uvcg_streaming_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };

Now we have 9 const instances of the config_item_type structure that are 
identical, with only the .ct_owner field set. Should they be all merged into a 
single structure ?

> @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item)
> NULL,
>  };
> 
> -static struct config_item_type uvc_func_type = {
> +static const struct config_item_type uvc_func_type = {
>  	.ct_item_ops	= &uvc_item_ops,
>  	.ct_attrs	= uvc_attrs,
>  	.ct_owner	= THIS_MODULE,


-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Bhumika Goyal <bhumirks@gmail.com>
Cc: julia.lawall@lip6.fr, rjw@rjwysocki.net, lenb@kernel.org,
	alexander.shishkin@linux.intel.com, jic23@kernel.org,
	knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	dledford@redhat.com, sean.hefty@intel.com,
	hal.rosenstock@gmail.com, hch@lst.de, sagi@grimberg.me,
	kishon@ti.com, bhelgaas@google.com, nab@linux-iscsi.org,
	balbi@kernel.org, gregkh@linuxfoundation.org, jlbec@evilplan.org,
	ccaulfie@redhat.com, teigland@redhat.com, mfasheh@versity.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-rdma@vger.kernel.org,
	netdev@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org, linux-usb@vger.kernel.org,
	cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 02/15] usb: gadget: make config_item_type structures const
Date: Wed, 18 Oct 2017 19:05:11 +0300	[thread overview]
Message-ID: <1985905.z83BJQzMUS@avalon> (raw)
In-Reply-To: <1508167134-6243-3-git-send-email-bhumirks@gmail.com>

Hi Bhumika,

Thank you for the patch.

On Monday, 16 October 2017 18:18:41 EEST Bhumika Goyal wrote:
> Make these structures const as they are only passed to the const
> argument of the functions config_{group/item}_init_type_name.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> * Changes in v2- Combine all the followup patches and the constification
> patches into a series.
> 
>  drivers/usb/gadget/function/f_acm.c          |  2 +-
>  drivers/usb/gadget/function/f_ecm.c          |  2 +-
>  drivers/usb/gadget/function/f_eem.c          |  2 +-
>  drivers/usb/gadget/function/f_fs.c           |  2 +-
>  drivers/usb/gadget/function/f_hid.c          |  2 +-
>  drivers/usb/gadget/function/f_loopback.c     |  2 +-
>  drivers/usb/gadget/function/f_mass_storage.c |  4 +--
>  drivers/usb/gadget/function/f_midi.c         |  2 +-
>  drivers/usb/gadget/function/f_ncm.c          |  2 +-
>  drivers/usb/gadget/function/f_obex.c         |  2 +-
>  drivers/usb/gadget/function/f_phonet.c       |  2 +-
>  drivers/usb/gadget/function/f_printer.c      |  2 +-
>  drivers/usb/gadget/function/f_rndis.c        |  2 +-
>  drivers/usb/gadget/function/f_serial.c       |  2 +-
>  drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
>  drivers/usb/gadget/function/f_subset.c       |  2 +-
>  drivers/usb/gadget/function/f_tcm.c          |  2 +-
>  drivers/usb/gadget/function/f_uac1.c         |  2 +-
>  drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
>  drivers/usb/gadget/function/f_uac2.c         |  2 +-
>  drivers/usb/gadget/function/uvc_configfs.c   | 50 ++++++++++++------------
>  21 files changed, 46 insertions(+), 46 deletions(-)

[snip]

> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -127,7 +127,7 @@ static struct uvcg_control_header
> *to_uvcg_control_header(struct config_item *it NULL,
>  };
> 
> -static struct config_item_type uvcg_control_header_type = {
> +static const struct config_item_type uvcg_control_header_type = {
>  	.ct_attrs	= uvcg_control_header_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group
> *group, .drop_item		= uvcg_control_header_drop,
>  };
> 
> -static struct config_item_type uvcg_control_header_grp_type = {
> +static const struct config_item_type uvcg_control_header_grp_type = {
>  	.ct_group_ops	= &uvcg_control_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> NULL,
>  };
> 
> -static struct config_item_type uvcg_default_processing_type = {
> +static const struct config_item_type uvcg_default_processing_type = {
>  	.ct_attrs	= uvcg_default_processing_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> struct config_group	group;
>  } uvcg_processing_grp;
> 
> -static struct config_item_type uvcg_processing_grp_type = {
> +static const struct config_item_type uvcg_processing_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_camera_type = {
> +static const struct config_item_type uvcg_default_camera_type = {
>  	.ct_attrs	= uvcg_default_camera_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_camera_grp;
> 
> -static struct config_item_type uvcg_camera_grp_type = {
> +static const struct config_item_type uvcg_camera_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_output_type = {
> +static const struct config_item_type uvcg_default_output_type = {
>  	.ct_attrs	= uvcg_default_output_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_output_grp;
> 
> -static struct config_item_type uvcg_output_grp_type = {
> +static const struct config_item_type uvcg_output_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_terminal_grp;
> 
> -static struct config_item_type uvcg_terminal_grp_type = {
> +static const struct config_item_type uvcg_terminal_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_control_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_control_class_type = {
> +static const struct config_item_type uvcg_control_class_type = {
>  	.ct_item_ops	= &uvcg_control_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_class_grp;
> 
> -static struct config_item_type uvcg_control_class_grp_type = {
> +static const struct config_item_type uvcg_control_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_grp;
> 
> -static struct config_item_type uvcg_control_grp_type = {
> +static const struct config_item_type uvcg_control_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, NULL,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_type = {
> +static const struct config_item_type uvcg_streaming_header_type = {
>  	.ct_item_ops	= &uvcg_streaming_header_item_ops,
>  	.ct_attrs	= uvcg_streaming_header_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct
> config_group *group, .drop_item		= uvcg_streaming_header_drop,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_grp_type = {
> +static const struct config_item_type uvcg_streaming_header_grp_type = {
>  	.ct_group_ops	= &uvcg_streaming_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1150,7 +1150,7 @@ static ssize_t
> uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_frame_type = {
> +static const struct config_item_type uvcg_frame_type = {
>  	.ct_attrs	= uvcg_frame_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1419,7 +1419,7 @@ static ssize_t
> uvcg_uncompressed_guid_format_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_type = {
> +static const struct config_item_type uvcg_uncompressed_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_group_ops,
>  	.ct_attrs	= uvcg_uncompressed_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group
> *group, .drop_item		= uvcg_uncompressed_drop,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_grp_type = {
> +static const struct config_item_type uvcg_uncompressed_grp_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct
> config_item *item) NULL,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_type = {
> +static const struct config_item_type uvcg_mjpeg_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_group_ops,
>  	.ct_attrs	= uvcg_mjpeg_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, .drop_item		= uvcg_mjpeg_drop,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_grp_type = {
> +static const struct config_item_type uvcg_mjpeg_grp_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, NULL,
>  };
> 
> -static struct config_item_type uvcg_default_color_matching_type = {
> +static const struct config_item_type uvcg_default_color_matching_type = {
>  	.ct_attrs	= uvcg_default_color_matching_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, struct config_group	group;
>  } uvcg_color_matching_grp;
> 
> -static struct config_item_type uvcg_color_matching_grp_type = {
> +static const struct config_item_type uvcg_color_matching_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_streaming_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_streaming_class_type = {
> +static const struct config_item_type uvcg_streaming_class_type = {
>  	.ct_item_ops	= &uvcg_streaming_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_class_grp;
> 
> -static struct config_item_type uvcg_streaming_class_grp_type = {
> +static const struct config_item_type uvcg_streaming_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_grp;
> 
> -static struct config_item_type uvcg_streaming_grp_type = {
> +static const struct config_item_type uvcg_streaming_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };

Now we have 9 const instances of the config_item_type structure that are 
identical, with only the .ct_owner field set. Should they be all merged into a 
single structure ?

> @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item)
> NULL,
>  };
> 
> -static struct config_item_type uvc_func_type = {
> +static const struct config_item_type uvc_func_type = {
>  	.ct_item_ops	= &uvc_item_ops,
>  	.ct_attrs	= uvc_attrs,
>  	.ct_owner	= THIS_MODULE,


-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
To: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: julia.lawall-L2FTfq7BK8M@public.gmane.org,
	rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org,
	lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	knaack.h-Mmb7MZpHnFY@public.gmane.org,
	lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org,
	pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	hch-jcswGhMUV9g@public.gmane.org,
	sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org,
	kishon-l0cyMroinI0@public.gmane.org,
	bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org,
	balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org,
	ccaulfie-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	teigland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	mfasheh-rOS7oXVqrJRBDgjK7y7TUQ@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org,
Subject: Re: [PATCH v2 02/15] usb: gadget: make config_item_type structures const
Date: Wed, 18 Oct 2017 19:05:11 +0300	[thread overview]
Message-ID: <1985905.z83BJQzMUS@avalon> (raw)
In-Reply-To: <1508167134-6243-3-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Bhumika,

Thank you for the patch.

On Monday, 16 October 2017 18:18:41 EEST Bhumika Goyal wrote:
> Make these structures const as they are only passed to the const
> argument of the functions config_{group/item}_init_type_name.
> 
> Signed-off-by: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> * Changes in v2- Combine all the followup patches and the constification
> patches into a series.
> 
>  drivers/usb/gadget/function/f_acm.c          |  2 +-
>  drivers/usb/gadget/function/f_ecm.c          |  2 +-
>  drivers/usb/gadget/function/f_eem.c          |  2 +-
>  drivers/usb/gadget/function/f_fs.c           |  2 +-
>  drivers/usb/gadget/function/f_hid.c          |  2 +-
>  drivers/usb/gadget/function/f_loopback.c     |  2 +-
>  drivers/usb/gadget/function/f_mass_storage.c |  4 +--
>  drivers/usb/gadget/function/f_midi.c         |  2 +-
>  drivers/usb/gadget/function/f_ncm.c          |  2 +-
>  drivers/usb/gadget/function/f_obex.c         |  2 +-
>  drivers/usb/gadget/function/f_phonet.c       |  2 +-
>  drivers/usb/gadget/function/f_printer.c      |  2 +-
>  drivers/usb/gadget/function/f_rndis.c        |  2 +-
>  drivers/usb/gadget/function/f_serial.c       |  2 +-
>  drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
>  drivers/usb/gadget/function/f_subset.c       |  2 +-
>  drivers/usb/gadget/function/f_tcm.c          |  2 +-
>  drivers/usb/gadget/function/f_uac1.c         |  2 +-
>  drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
>  drivers/usb/gadget/function/f_uac2.c         |  2 +-
>  drivers/usb/gadget/function/uvc_configfs.c   | 50 ++++++++++++------------
>  21 files changed, 46 insertions(+), 46 deletions(-)

[snip]

> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -127,7 +127,7 @@ static struct uvcg_control_header
> *to_uvcg_control_header(struct config_item *it NULL,
>  };
> 
> -static struct config_item_type uvcg_control_header_type = {
> +static const struct config_item_type uvcg_control_header_type = {
>  	.ct_attrs	= uvcg_control_header_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group
> *group, .drop_item		= uvcg_control_header_drop,
>  };
> 
> -static struct config_item_type uvcg_control_header_grp_type = {
> +static const struct config_item_type uvcg_control_header_grp_type = {
>  	.ct_group_ops	= &uvcg_control_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> NULL,
>  };
> 
> -static struct config_item_type uvcg_default_processing_type = {
> +static const struct config_item_type uvcg_default_processing_type = {
>  	.ct_attrs	= uvcg_default_processing_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> struct config_group	group;
>  } uvcg_processing_grp;
> 
> -static struct config_item_type uvcg_processing_grp_type = {
> +static const struct config_item_type uvcg_processing_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_camera_type = {
> +static const struct config_item_type uvcg_default_camera_type = {
>  	.ct_attrs	= uvcg_default_camera_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_camera_grp;
> 
> -static struct config_item_type uvcg_camera_grp_type = {
> +static const struct config_item_type uvcg_camera_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_output_type = {
> +static const struct config_item_type uvcg_default_output_type = {
>  	.ct_attrs	= uvcg_default_output_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_output_grp;
> 
> -static struct config_item_type uvcg_output_grp_type = {
> +static const struct config_item_type uvcg_output_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_terminal_grp;
> 
> -static struct config_item_type uvcg_terminal_grp_type = {
> +static const struct config_item_type uvcg_terminal_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_control_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_control_class_type = {
> +static const struct config_item_type uvcg_control_class_type = {
>  	.ct_item_ops	= &uvcg_control_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_class_grp;
> 
> -static struct config_item_type uvcg_control_class_grp_type = {
> +static const struct config_item_type uvcg_control_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_grp;
> 
> -static struct config_item_type uvcg_control_grp_type = {
> +static const struct config_item_type uvcg_control_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, NULL,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_type = {
> +static const struct config_item_type uvcg_streaming_header_type = {
>  	.ct_item_ops	= &uvcg_streaming_header_item_ops,
>  	.ct_attrs	= uvcg_streaming_header_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct
> config_group *group, .drop_item		= uvcg_streaming_header_drop,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_grp_type = {
> +static const struct config_item_type uvcg_streaming_header_grp_type = {
>  	.ct_group_ops	= &uvcg_streaming_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1150,7 +1150,7 @@ static ssize_t
> uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_frame_type = {
> +static const struct config_item_type uvcg_frame_type = {
>  	.ct_attrs	= uvcg_frame_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1419,7 +1419,7 @@ static ssize_t
> uvcg_uncompressed_guid_format_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_type = {
> +static const struct config_item_type uvcg_uncompressed_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_group_ops,
>  	.ct_attrs	= uvcg_uncompressed_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group
> *group, .drop_item		= uvcg_uncompressed_drop,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_grp_type = {
> +static const struct config_item_type uvcg_uncompressed_grp_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct
> config_item *item) NULL,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_type = {
> +static const struct config_item_type uvcg_mjpeg_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_group_ops,
>  	.ct_attrs	= uvcg_mjpeg_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, .drop_item		= uvcg_mjpeg_drop,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_grp_type = {
> +static const struct config_item_type uvcg_mjpeg_grp_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, NULL,
>  };
> 
> -static struct config_item_type uvcg_default_color_matching_type = {
> +static const struct config_item_type uvcg_default_color_matching_type = {
>  	.ct_attrs	= uvcg_default_color_matching_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, struct config_group	group;
>  } uvcg_color_matching_grp;
> 
> -static struct config_item_type uvcg_color_matching_grp_type = {
> +static const struct config_item_type uvcg_color_matching_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_streaming_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_streaming_class_type = {
> +static const struct config_item_type uvcg_streaming_class_type = {
>  	.ct_item_ops	= &uvcg_streaming_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_class_grp;
> 
> -static struct config_item_type uvcg_streaming_class_grp_type = {
> +static const struct config_item_type uvcg_streaming_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_grp;
> 
> -static struct config_item_type uvcg_streaming_grp_type = {
> +static const struct config_item_type uvcg_streaming_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };

Now we have 9 const instances of the config_item_type structure that are 
identical, with only the .ct_owner field set. Should they be all merged into a 
single structure ?

> @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item)
> NULL,
>  };
> 
> -static struct config_item_type uvc_func_type = {
> +static const struct config_item_type uvc_func_type = {
>  	.ct_item_ops	= &uvc_item_ops,
>  	.ct_attrs	= uvc_attrs,
>  	.ct_owner	= THIS_MODULE,


-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Bhumika Goyal <bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: julia.lawall-L2FTfq7BK8M@public.gmane.org,
	rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org,
	lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	knaack.h-Mmb7MZpHnFY@public.gmane.org,
	lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org,
	pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	hch-jcswGhMUV9g@public.gmane.org,
	sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org,
	kishon-l0cyMroinI0@public.gmane.org,
	bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org,
	balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org,
	ccaulfie-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	teigland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	mfasheh-rOS7oXVqrJRBDgjK7y7TUQ@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org
Subject: Re: [PATCH v2 02/15] usb: gadget: make config_item_type structures const
Date: Wed, 18 Oct 2017 16:05:11 +0000	[thread overview]
Message-ID: <1985905.z83BJQzMUS@avalon> (raw)
In-Reply-To: <1508167134-6243-3-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Bhumika,

Thank you for the patch.

On Monday, 16 October 2017 18:18:41 EEST Bhumika Goyal wrote:
> Make these structures const as they are only passed to the const
> argument of the functions config_{group/item}_init_type_name.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> * Changes in v2- Combine all the followup patches and the constification
> patches into a series.
> 
>  drivers/usb/gadget/function/f_acm.c          |  2 +-
>  drivers/usb/gadget/function/f_ecm.c          |  2 +-
>  drivers/usb/gadget/function/f_eem.c          |  2 +-
>  drivers/usb/gadget/function/f_fs.c           |  2 +-
>  drivers/usb/gadget/function/f_hid.c          |  2 +-
>  drivers/usb/gadget/function/f_loopback.c     |  2 +-
>  drivers/usb/gadget/function/f_mass_storage.c |  4 +--
>  drivers/usb/gadget/function/f_midi.c         |  2 +-
>  drivers/usb/gadget/function/f_ncm.c          |  2 +-
>  drivers/usb/gadget/function/f_obex.c         |  2 +-
>  drivers/usb/gadget/function/f_phonet.c       |  2 +-
>  drivers/usb/gadget/function/f_printer.c      |  2 +-
>  drivers/usb/gadget/function/f_rndis.c        |  2 +-
>  drivers/usb/gadget/function/f_serial.c       |  2 +-
>  drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
>  drivers/usb/gadget/function/f_subset.c       |  2 +-
>  drivers/usb/gadget/function/f_tcm.c          |  2 +-
>  drivers/usb/gadget/function/f_uac1.c         |  2 +-
>  drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
>  drivers/usb/gadget/function/f_uac2.c         |  2 +-
>  drivers/usb/gadget/function/uvc_configfs.c   | 50 ++++++++++++------------
>  21 files changed, 46 insertions(+), 46 deletions(-)

[snip]

> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -127,7 +127,7 @@ static struct uvcg_control_header
> *to_uvcg_control_header(struct config_item *it NULL,
>  };
> 
> -static struct config_item_type uvcg_control_header_type = {
> +static const struct config_item_type uvcg_control_header_type = {
>  	.ct_attrs	= uvcg_control_header_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group
> *group, .drop_item		= uvcg_control_header_drop,
>  };
> 
> -static struct config_item_type uvcg_control_header_grp_type = {
> +static const struct config_item_type uvcg_control_header_grp_type = {
>  	.ct_group_ops	= &uvcg_control_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> NULL,
>  };
> 
> -static struct config_item_type uvcg_default_processing_type = {
> +static const struct config_item_type uvcg_default_processing_type = {
>  	.ct_attrs	= uvcg_default_processing_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> struct config_group	group;
>  } uvcg_processing_grp;
> 
> -static struct config_item_type uvcg_processing_grp_type = {
> +static const struct config_item_type uvcg_processing_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_camera_type = {
> +static const struct config_item_type uvcg_default_camera_type = {
>  	.ct_attrs	= uvcg_default_camera_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_camera_grp;
> 
> -static struct config_item_type uvcg_camera_grp_type = {
> +static const struct config_item_type uvcg_camera_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_output_type = {
> +static const struct config_item_type uvcg_default_output_type = {
>  	.ct_attrs	= uvcg_default_output_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_output_grp;
> 
> -static struct config_item_type uvcg_output_grp_type = {
> +static const struct config_item_type uvcg_output_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_terminal_grp;
> 
> -static struct config_item_type uvcg_terminal_grp_type = {
> +static const struct config_item_type uvcg_terminal_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_control_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_control_class_type = {
> +static const struct config_item_type uvcg_control_class_type = {
>  	.ct_item_ops	= &uvcg_control_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_class_grp;
> 
> -static struct config_item_type uvcg_control_class_grp_type = {
> +static const struct config_item_type uvcg_control_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_grp;
> 
> -static struct config_item_type uvcg_control_grp_type = {
> +static const struct config_item_type uvcg_control_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, NULL,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_type = {
> +static const struct config_item_type uvcg_streaming_header_type = {
>  	.ct_item_ops	= &uvcg_streaming_header_item_ops,
>  	.ct_attrs	= uvcg_streaming_header_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct
> config_group *group, .drop_item		= uvcg_streaming_header_drop,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_grp_type = {
> +static const struct config_item_type uvcg_streaming_header_grp_type = {
>  	.ct_group_ops	= &uvcg_streaming_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1150,7 +1150,7 @@ static ssize_t
> uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_frame_type = {
> +static const struct config_item_type uvcg_frame_type = {
>  	.ct_attrs	= uvcg_frame_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1419,7 +1419,7 @@ static ssize_t
> uvcg_uncompressed_guid_format_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_type = {
> +static const struct config_item_type uvcg_uncompressed_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_group_ops,
>  	.ct_attrs	= uvcg_uncompressed_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group
> *group, .drop_item		= uvcg_uncompressed_drop,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_grp_type = {
> +static const struct config_item_type uvcg_uncompressed_grp_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct
> config_item *item) NULL,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_type = {
> +static const struct config_item_type uvcg_mjpeg_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_group_ops,
>  	.ct_attrs	= uvcg_mjpeg_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, .drop_item		= uvcg_mjpeg_drop,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_grp_type = {
> +static const struct config_item_type uvcg_mjpeg_grp_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, NULL,
>  };
> 
> -static struct config_item_type uvcg_default_color_matching_type = {
> +static const struct config_item_type uvcg_default_color_matching_type = {
>  	.ct_attrs	= uvcg_default_color_matching_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, struct config_group	group;
>  } uvcg_color_matching_grp;
> 
> -static struct config_item_type uvcg_color_matching_grp_type = {
> +static const struct config_item_type uvcg_color_matching_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_streaming_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_streaming_class_type = {
> +static const struct config_item_type uvcg_streaming_class_type = {
>  	.ct_item_ops	= &uvcg_streaming_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_class_grp;
> 
> -static struct config_item_type uvcg_streaming_class_grp_type = {
> +static const struct config_item_type uvcg_streaming_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_grp;
> 
> -static struct config_item_type uvcg_streaming_grp_type = {
> +static const struct config_item_type uvcg_streaming_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };

Now we have 9 const instances of the config_item_type structure that are 
identical, with only the .ct_owner field set. Should they be all merged into a 
single structure ?

> @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item)
> NULL,
>  };
> 
> -static struct config_item_type uvc_func_type = {
> +static const struct config_item_type uvc_func_type = {
>  	.ct_item_ops	= &uvc_item_ops,
>  	.ct_attrs	= uvc_attrs,
>  	.ct_owner	= THIS_MODULE,


-- 
Regards,

Laurent Pinchart


WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH v2 02/15] usb: gadget: make config_item_type structures const
Date: Wed, 18 Oct 2017 19:05:11 +0300	[thread overview]
Message-ID: <1985905.z83BJQzMUS@avalon> (raw)
In-Reply-To: <1508167134-6243-3-git-send-email-bhumirks@gmail.com>

Hi Bhumika,

Thank you for the patch.

On Monday, 16 October 2017 18:18:41 EEST Bhumika Goyal wrote:
> Make these structures const as they are only passed to the const
> argument of the functions config_{group/item}_init_type_name.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> * Changes in v2- Combine all the followup patches and the constification
> patches into a series.
> 
>  drivers/usb/gadget/function/f_acm.c          |  2 +-
>  drivers/usb/gadget/function/f_ecm.c          |  2 +-
>  drivers/usb/gadget/function/f_eem.c          |  2 +-
>  drivers/usb/gadget/function/f_fs.c           |  2 +-
>  drivers/usb/gadget/function/f_hid.c          |  2 +-
>  drivers/usb/gadget/function/f_loopback.c     |  2 +-
>  drivers/usb/gadget/function/f_mass_storage.c |  4 +--
>  drivers/usb/gadget/function/f_midi.c         |  2 +-
>  drivers/usb/gadget/function/f_ncm.c          |  2 +-
>  drivers/usb/gadget/function/f_obex.c         |  2 +-
>  drivers/usb/gadget/function/f_phonet.c       |  2 +-
>  drivers/usb/gadget/function/f_printer.c      |  2 +-
>  drivers/usb/gadget/function/f_rndis.c        |  2 +-
>  drivers/usb/gadget/function/f_serial.c       |  2 +-
>  drivers/usb/gadget/function/f_sourcesink.c   |  2 +-
>  drivers/usb/gadget/function/f_subset.c       |  2 +-
>  drivers/usb/gadget/function/f_tcm.c          |  2 +-
>  drivers/usb/gadget/function/f_uac1.c         |  2 +-
>  drivers/usb/gadget/function/f_uac1_legacy.c  |  2 +-
>  drivers/usb/gadget/function/f_uac2.c         |  2 +-
>  drivers/usb/gadget/function/uvc_configfs.c   | 50 ++++++++++++------------
>  21 files changed, 46 insertions(+), 46 deletions(-)

[snip]

> diff --git a/drivers/usb/gadget/function/uvc_configfs.c
> b/drivers/usb/gadget/function/uvc_configfs.c index 844cb73..f76619f 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -127,7 +127,7 @@ static struct uvcg_control_header
> *to_uvcg_control_header(struct config_item *it NULL,
>  };
> 
> -static struct config_item_type uvcg_control_header_type = {
> +static const struct config_item_type uvcg_control_header_type = {
>  	.ct_attrs	= uvcg_control_header_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -170,7 +170,7 @@ static void uvcg_control_header_drop(struct config_group
> *group, .drop_item		= uvcg_control_header_drop,
>  };
> 
> -static struct config_item_type uvcg_control_header_grp_type = {
> +static const struct config_item_type uvcg_control_header_grp_type = {
>  	.ct_group_ops	= &uvcg_control_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -265,7 +265,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> NULL,
>  };
> 
> -static struct config_item_type uvcg_default_processing_type = {
> +static const struct config_item_type uvcg_default_processing_type = {
>  	.ct_attrs	= uvcg_default_processing_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -277,7 +277,7 @@ static ssize_t uvcg_default_processing_bm_controls_show(
> struct config_group	group;
>  } uvcg_processing_grp;
> 
> -static struct config_item_type uvcg_processing_grp_type = {
> +static const struct config_item_type uvcg_processing_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -382,7 +382,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_camera_type = {
> +static const struct config_item_type uvcg_default_camera_type = {
>  	.ct_attrs	= uvcg_default_camera_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -394,7 +394,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_camera_grp;
> 
> -static struct config_item_type uvcg_camera_grp_type = {
> +static const struct config_item_type uvcg_camera_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -460,7 +460,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	NULL,
>  };
> 
> -static struct config_item_type uvcg_default_output_type = {
> +static const struct config_item_type uvcg_default_output_type = {
>  	.ct_attrs	= uvcg_default_output_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -472,7 +472,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_output_grp;
> 
> -static struct config_item_type uvcg_output_grp_type = {
> +static const struct config_item_type uvcg_output_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -481,7 +481,7 @@ static ssize_t uvcg_default_camera_bm_controls_show(
>  	struct config_group	group;
>  } uvcg_terminal_grp;
> 
> -static struct config_item_type uvcg_terminal_grp_type = {
> +static const struct config_item_type uvcg_terminal_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -586,7 +586,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_control_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_control_class_type = {
> +static const struct config_item_type uvcg_control_class_type = {
>  	.ct_item_ops	= &uvcg_control_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -596,7 +596,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_class_grp;
> 
> -static struct config_item_type uvcg_control_class_grp_type = {
> +static const struct config_item_type uvcg_control_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -605,7 +605,7 @@ static void uvcg_control_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_control_grp;
> 
> -static struct config_item_type uvcg_control_grp_type = {
> +static const struct config_item_type uvcg_control_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -857,7 +857,7 @@ static void uvcg_streaming_header_drop_link(struct
> config_item *src, NULL,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_type = {
> +static const struct config_item_type uvcg_streaming_header_type = {
>  	.ct_item_ops	= &uvcg_streaming_header_item_ops,
>  	.ct_attrs	= uvcg_streaming_header_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -901,7 +901,7 @@ static void uvcg_streaming_header_drop(struct
> config_group *group, .drop_item		= uvcg_streaming_header_drop,
>  };
> 
> -static struct config_item_type uvcg_streaming_header_grp_type = {
> +static const struct config_item_type uvcg_streaming_header_grp_type = {
>  	.ct_group_ops	= &uvcg_streaming_header_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1150,7 +1150,7 @@ static ssize_t
> uvcg_frame_dw_frame_interval_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_frame_type = {
> +static const struct config_item_type uvcg_frame_type = {
>  	.ct_attrs	= uvcg_frame_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1419,7 +1419,7 @@ static ssize_t
> uvcg_uncompressed_guid_format_store(struct config_item *item, NULL,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_type = {
> +static const struct config_item_type uvcg_uncompressed_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_group_ops,
>  	.ct_attrs	= uvcg_uncompressed_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1469,7 +1469,7 @@ static void uvcg_uncompressed_drop(struct config_group
> *group, .drop_item		= uvcg_uncompressed_drop,
>  };
> 
> -static struct config_item_type uvcg_uncompressed_grp_type = {
> +static const struct config_item_type uvcg_uncompressed_grp_type = {
>  	.ct_group_ops	= &uvcg_uncompressed_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1619,7 +1619,7 @@ static struct uvcg_mjpeg *to_uvcg_mjpeg(struct
> config_item *item) NULL,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_type = {
> +static const struct config_item_type uvcg_mjpeg_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_group_ops,
>  	.ct_attrs	= uvcg_mjpeg_attrs,
>  	.ct_owner	= THIS_MODULE,
> @@ -1663,7 +1663,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, .drop_item		= uvcg_mjpeg_drop,
>  };
> 
> -static struct config_item_type uvcg_mjpeg_grp_type = {
> +static const struct config_item_type uvcg_mjpeg_grp_type = {
>  	.ct_group_ops	= &uvcg_mjpeg_grp_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1728,7 +1728,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, NULL,
>  };
> 
> -static struct config_item_type uvcg_default_color_matching_type = {
> +static const struct config_item_type uvcg_default_color_matching_type = {
>  	.ct_attrs	= uvcg_default_color_matching_attrs,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -1740,7 +1740,7 @@ static void uvcg_mjpeg_drop(struct config_group
> *group, struct config_group	group;
>  } uvcg_color_matching_grp;
> 
> -static struct config_item_type uvcg_color_matching_grp_type = {
> +static const struct config_item_type uvcg_color_matching_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2085,7 +2085,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, .drop_link	= uvcg_streaming_class_drop_link,
>  };
> 
> -static struct config_item_type uvcg_streaming_class_type = {
> +static const struct config_item_type uvcg_streaming_class_type = {
>  	.ct_item_ops	= &uvcg_streaming_class_item_ops,
>  	.ct_owner	= THIS_MODULE,
>  };
> @@ -2095,7 +2095,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_class_grp;
> 
> -static struct config_item_type uvcg_streaming_class_grp_type = {
> +static const struct config_item_type uvcg_streaming_class_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };
> 
> @@ -2104,7 +2104,7 @@ static void uvcg_streaming_class_drop_link(struct
> config_item *src, struct config_group	group;
>  } uvcg_streaming_grp;
> 
> -static struct config_item_type uvcg_streaming_grp_type = {
> +static const struct config_item_type uvcg_streaming_grp_type = {
>  	.ct_owner = THIS_MODULE,
>  };

Now we have 9 const instances of the config_item_type structure that are 
identical, with only the .ct_owner field set. Should they be all merged into a 
single structure ?

> @@ -2190,7 +2190,7 @@ static void uvc_attr_release(struct config_item *item)
> NULL,
>  };
> 
> -static struct config_item_type uvc_func_type = {
> +static const struct config_item_type uvc_func_type = {
>  	.ct_item_ops	= &uvc_item_ops,
>  	.ct_attrs	= uvc_attrs,
>  	.ct_owner	= THIS_MODULE,


-- 
Regards,

Laurent Pinchart



  parent reply	other threads:[~2017-10-18 16:05 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 15:18 [PATCH v2 00/15] make structure field, function arguments and structures const Bhumika Goyal
2017-10-16 15:18 ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18 ` Bhumika Goyal
2017-10-16 15:18 ` Bhumika Goyal
2017-10-16 15:18 ` [PATCH v2 01/15] configfs: make ci_type field, some pointers and function arguments const Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-17 10:24   ` Greg KH
2017-10-17 10:24     ` [Cluster-devel] " Greg KH
2017-10-17 10:24     ` Greg KH
2017-10-17 10:24     ` Greg KH
2017-10-16 15:18 ` [PATCH v2 02/15] usb: gadget: make config_item_type structures const Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
     [not found]   ` <1508167134-6243-3-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-17  8:30     ` Felipe Balbi
2017-10-17  8:30       ` [Cluster-devel] " Felipe Balbi
2017-10-17  8:30       ` Felipe Balbi
2017-10-17  8:30       ` Felipe Balbi
2017-10-17  8:30       ` Felipe Balbi
2017-10-18 16:05     ` Laurent Pinchart [this message]
2017-10-18 16:05       ` [Cluster-devel] " Laurent Pinchart
2017-10-18 16:05       ` Laurent Pinchart
2017-10-18 16:05       ` Laurent Pinchart
2017-10-18 16:05       ` Laurent Pinchart
2017-10-19 14:06       ` Christoph Hellwig
2017-10-19 14:06         ` [Cluster-devel] " Christoph Hellwig
2017-10-19 14:06         ` Christoph Hellwig
2017-10-19 14:06         ` Christoph Hellwig
2017-10-19 15:05         ` Laurent Pinchart
2017-10-19 15:05           ` [Cluster-devel] " Laurent Pinchart
2017-10-19 15:05           ` Laurent Pinchart
2017-10-19 15:05           ` Laurent Pinchart
2017-10-20  8:02           ` Julia Lawall
2017-10-20  8:02             ` [Cluster-devel] " Julia Lawall
2017-10-20  8:02             ` Julia Lawall
2017-10-20  8:02             ` Julia Lawall
2017-10-20  8:02             ` Julia Lawall
2017-10-20  8:13           ` Bhumika Goyal
2017-10-20  8:13             ` [Cluster-devel] " Bhumika Goyal
2017-10-20  8:13             ` Bhumika Goyal
2017-10-20  8:13             ` Bhumika Goyal
2017-10-20  8:13             ` Bhumika Goyal
     [not found] ` <1508167134-6243-1-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-16 15:18   ` [PATCH v2 03/15] target: make config_item_type const Bhumika Goyal
2017-10-16 15:18     ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18     ` Bhumika Goyal
2017-10-16 15:18     ` Bhumika Goyal
2017-10-16 15:18 ` [PATCH v2 04/15] iio: make function argument and some structures const Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 18:48   ` Jonathan Cameron
2017-10-16 18:48     ` [Cluster-devel] " Jonathan Cameron
2017-10-16 18:48     ` Jonathan Cameron
2017-10-16 18:48     ` Jonathan Cameron
2017-10-16 18:48     ` Jonathan Cameron
2017-10-16 18:48   ` Jonathan Cameron
2017-10-16 15:18 ` [PATCH v2 05/15] ocfs2/cluster: make config_item_type const Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18 ` [PATCH v2 06/15] PCI: endpoint: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 18:24   ` Bjorn Helgaas
2017-10-16 18:24     ` [Cluster-devel] " Bjorn Helgaas
2017-10-16 18:24     ` Bjorn Helgaas
2017-10-16 18:24     ` Bjorn Helgaas
2017-10-16 15:18 ` [PATCH v2 07/15] usb: gadget: configfs: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
     [not found]   ` <1508167134-6243-8-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-17  8:31     ` Felipe Balbi
2017-10-17  8:31       ` [Cluster-devel] " Felipe Balbi
2017-10-17  8:31       ` Felipe Balbi
2017-10-17  8:31       ` Felipe Balbi
2017-10-17  8:31       ` Felipe Balbi
2017-10-16 15:18 ` [PATCH v2 08/15] nvmet: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-17 10:18   ` Sagi Grimberg
2017-10-17 10:18     ` [Cluster-devel] " Sagi Grimberg
2017-10-17 10:18     ` Sagi Grimberg
2017-10-17 10:18     ` Sagi Grimberg
2017-10-17 10:18     ` Sagi Grimberg
2017-10-16 15:18 ` [PATCH v2 09/15] ACPI: configfs: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-17  0:10   ` Rafael J. Wysocki
2017-10-17  0:10     ` [Cluster-devel] " Rafael J. Wysocki
2017-10-17  0:10     ` Rafael J. Wysocki
2017-10-17  0:10     ` Rafael J. Wysocki
2017-10-16 15:18 ` [PATCH v2 10/15] nullb: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18 ` [PATCH v2 11/15] stm class: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-17 10:25   ` Greg KH
2017-10-17 10:25     ` [Cluster-devel] " Greg KH
2017-10-17 10:25     ` Greg KH
2017-10-17 10:25     ` Greg KH
2017-10-16 15:18 ` [PATCH v2 12/15] RDMA/cma: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
     [not found]   ` <1508167134-6243-13-git-send-email-bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-17 10:56     ` Leon Romanovsky
2017-10-17 10:56       ` [Cluster-devel] " Leon Romanovsky
2017-10-17 10:56       ` Leon Romanovsky
2017-10-17 10:56       ` Leon Romanovsky
2017-10-18 14:33   ` Doug Ledford
2017-10-18 14:33     ` [Cluster-devel] " Doug Ledford
2017-10-18 14:33     ` Doug Ledford
2017-10-18 14:33     ` Doug Ledford
2017-10-18 14:33     ` Doug Ledford
2017-10-16 15:18 ` [PATCH v2 13/15] netconsole: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18 ` [PATCH v2 14/15] dlm: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18 ` [PATCH v2 15/15] configfs: " Bhumika Goyal
2017-10-16 15:18   ` [Cluster-devel] " Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-16 15:18   ` Bhumika Goyal
2017-10-17 10:12 ` [PATCH v2 00/15] make structure field, function arguments and structures const Greg KH
2017-10-17 10:12   ` [Cluster-devel] " Greg KH
2017-10-17 10:12   ` Greg KH
2017-10-17 10:12   ` Greg KH
2017-10-17 10:16   ` Julia Lawall
2017-10-17 10:16     ` [Cluster-devel] " Julia Lawall
2017-10-17 10:16     ` Julia Lawall
2017-10-17 10:16     ` Julia Lawall
2017-10-17 10:23     ` Greg KH
2017-10-17 10:23       ` [Cluster-devel] " Greg KH
2017-10-17 10:23       ` Greg KH
2017-10-17 10:23       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1985905.z83BJQzMUS@avalon \
    --to=laurent.pinchart-rylnwiuwjnjg/c1bvhzhaw@public.gmane.org \
    --cc=alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=bhumirks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ccaulfie-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org \
    --cc=julia.lawall-L2FTfq7BK8M@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mfasheh-rOS7oXVqrJRBDgjK7y7TUQ@public.gmane.org \
    --cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
    --cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
    --cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=teigland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.