Re: [PATCH] HID: intel-ish-hid: constify device_type structure

From: Srinivas Pandruvada
Date: Sat Feb 11 2017 - 04:40:16 EST


On Sat, 2017-02-11 at 12:40 +0530, Bhumika Goyal wrote:
> Declare device_type structure as const as it is only stored in the
> type field of a device structure. This field is of type const, so add
> const to the declaration of device_type structure.
>
> File size before: drivers/hid/intel-ish-hid/ishtp/bus.o
> ÂÂÂtext ÂÂÂdata ÂÂÂÂbss ÂÂÂÂdec ÂÂÂÂhex
> filename
> ÂÂÂ4260 ÂÂÂÂ336 ÂÂÂÂÂ16 ÂÂÂ4612 ÂÂÂ1204
> hid/intel-ish-hid/ishtp/bus.o
>
> File size after: drivers/hid/intel-ish-hid/ishtp/bus.o
> ÂÂÂtext ÂÂÂdata ÂÂÂÂbss ÂÂÂÂdec ÂÂÂÂhex
> filename
> ÂÂÂ4324 ÂÂÂÂ272 ÂÂÂÂÂ16 ÂÂÂ4612 ÂÂÂ1204
> hid/intel-ish-hid/ishtp/bus.o
>
> Signed-off-by: Bhumika Goyal <bhumirks@xxxxxxxxx>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>

> ---
> Âdrivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c
> b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index f4cbc74..5f382fe 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -358,7 +358,7 @@ static void ishtp_cl_dev_release(struct device
> *dev)
> Â kfree(to_ishtp_cl_device(dev));
> Â}
> Â
> -static struct device_type ishtp_cl_device_type = {
> +static const struct device_type ishtp_cl_device_type = {
> Â .release = ishtp_cl_dev_release,
> Â};
> Â