Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569616
| From | Jarkko Nikula <jarkko.nikula@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] i2c: busses: constify i2c_algorithm structures |
| Date | 2017-01-30 12:20 +0100 |
| Message-ID | <t5ia6-3jQ-15@gated-at.bofh.it> (permalink) |
| References | <t4j8d-7uS-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 01/27/2017 08:06 PM, Bhumika Goyal wrote:
> Declare i2c_algorithm structures as const as they are only stored in the
> algo field of an i2c_adapter structure. This field is of type const, so
> i2c_algorithm structures having this property can be made const too.
> Done using Coccinelle:
>
...
> diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
> index 6d81c56..a62c14c 100644
> --- a/drivers/i2c/busses/i2c-designware-core.c
> +++ b/drivers/i2c/busses/i2c-designware-core.c
> @@ -822,7 +822,7 @@ static u32 i2c_dw_func(struct i2c_adapter *adap)
> return dev->functionality;
> }
>
> -static struct i2c_algorithm i2c_dw_algo = {
> +static const struct i2c_algorithm i2c_dw_algo = {
> .master_xfer = i2c_dw_xfer,
> .functionality = i2c_dw_func,
> };
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] i2c: busses: constify i2c_algorithm structures Bhumika Goyal <bhumirks@gmail.com> - 2017-01-27 19:10 +0100 Re: [PATCH] i2c: busses: constify i2c_algorithm structures Uwe Kleine-König <u.kleine-koenig@pengutronix.de> - 2017-01-29 12:00 +0100 Re: [PATCH] i2c: busses: constify i2c_algorithm structures Patrice CHOTARD <patrice.chotard@st.com> - 2017-01-30 10:50 +0100 Re: [PATCH] i2c: busses: constify i2c_algorithm structures Jarkko Nikula <jarkko.nikula@linux.intel.com> - 2017-01-30 12:20 +0100 Re: [PATCH] i2c: busses: constify i2c_algorithm structures Jean Delvare <jdelvare@suse.de> - 2017-01-31 15:30 +0100 Re: [PATCH] i2c: busses: constify i2c_algorithm structures Ludovic Desroches <ludovic.desroches@microchip.com> - 2017-02-06 17:20 +0100 Re: [PATCH] i2c: busses: constify i2c_algorithm structures Wolfram Sang <wsa@the-dreams.de> - 2017-02-09 17:20 +0100
csiph-web