LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] staging:iio:hmc5843: Constify register tables and struct regmap_config
@ 2015-02-24  9:41 Krzysztof Kozlowski
  2015-02-24  9:41 ` [PATCH 2/2] iio: jsa1212: Constify " Krzysztof Kozlowski
  2015-02-25 11:54 ` [PATCH 1/2] staging:iio:hmc5843: Constify register tables and " Jonathan Cameron
  0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2015-02-24  9:41 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Greg Kroah-Hartman, linux-iio, linux-kernel,
	devel
  Cc: Krzysztof Kozlowski

The regmap_access_table and regmap_config structures may be const
because they are not modified by the driver and regmap_init() accepts
pointer to const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/staging/iio/magnetometer/hmc5843_i2c.c | 8 ++++----
 drivers/staging/iio/magnetometer/hmc5843_spi.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
index 6acd614cdbc6..8346cf81fc2e 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
@@ -22,7 +22,7 @@ static const struct regmap_range hmc5843_readable_ranges[] = {
 		regmap_reg_range(0, HMC5843_ID_END),
 };
 
-static struct regmap_access_table hmc5843_readable_table = {
+static const struct regmap_access_table hmc5843_readable_table = {
 		.yes_ranges = hmc5843_readable_ranges,
 		.n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
 };
@@ -31,7 +31,7 @@ static const struct regmap_range hmc5843_writable_ranges[] = {
 		regmap_reg_range(0, HMC5843_MODE_REG),
 };
 
-static struct regmap_access_table hmc5843_writable_table = {
+static const struct regmap_access_table hmc5843_writable_table = {
 		.yes_ranges = hmc5843_writable_ranges,
 		.n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
 };
@@ -40,12 +40,12 @@ static const struct regmap_range hmc5843_volatile_ranges[] = {
 		regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
 };
 
-static struct regmap_access_table hmc5843_volatile_table = {
+static const struct regmap_access_table hmc5843_volatile_table = {
 		.yes_ranges = hmc5843_volatile_ranges,
 		.n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
 };
 
-static struct regmap_config hmc5843_i2c_regmap_config = {
+static const struct regmap_config hmc5843_i2c_regmap_config = {
 		.reg_bits = 8,
 		.val_bits = 8,
 
diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c b/drivers/staging/iio/magnetometer/hmc5843_spi.c
index 98c4b57101c9..8e658f736e1f 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_spi.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c
@@ -19,7 +19,7 @@ static const struct regmap_range hmc5843_readable_ranges[] = {
 		regmap_reg_range(0, HMC5843_ID_END),
 };
 
-static struct regmap_access_table hmc5843_readable_table = {
+static const struct regmap_access_table hmc5843_readable_table = {
 		.yes_ranges = hmc5843_readable_ranges,
 		.n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
 };
@@ -28,7 +28,7 @@ static const struct regmap_range hmc5843_writable_ranges[] = {
 		regmap_reg_range(0, HMC5843_MODE_REG),
 };
 
-static struct regmap_access_table hmc5843_writable_table = {
+static const struct regmap_access_table hmc5843_writable_table = {
 		.yes_ranges = hmc5843_writable_ranges,
 		.n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
 };
@@ -37,12 +37,12 @@ static const struct regmap_range hmc5843_volatile_ranges[] = {
 		regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
 };
 
-static struct regmap_access_table hmc5843_volatile_table = {
+static const struct regmap_access_table hmc5843_volatile_table = {
 		.yes_ranges = hmc5843_volatile_ranges,
 		.n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
 };
 
-static struct regmap_config hmc5843_spi_regmap_config = {
+static const struct regmap_config hmc5843_spi_regmap_config = {
 		.reg_bits = 8,
 		.val_bits = 8,
 
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] iio: jsa1212: Constify struct regmap_config
  2015-02-24  9:41 [PATCH 1/2] staging:iio:hmc5843: Constify register tables and struct regmap_config Krzysztof Kozlowski
@ 2015-02-24  9:41 ` Krzysztof Kozlowski
  2015-02-25 11:55   ` Jonathan Cameron
  2015-02-25 11:54 ` [PATCH 1/2] staging:iio:hmc5843: Constify register tables and " Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2015-02-24  9:41 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Greg Kroah-Hartman, linux-iio, linux-kernel,
	devel
  Cc: Krzysztof Kozlowski

The regmap_config struct may be const because it is not modified by the
driver and regmap_init() accepts pointer to const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/iio/light/jsa1212.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c
index 29de7e7d9562..3a3af89beaf9 100644
--- a/drivers/iio/light/jsa1212.c
+++ b/drivers/iio/light/jsa1212.c
@@ -308,7 +308,7 @@ static bool jsa1212_is_volatile_reg(struct device *dev, unsigned int reg)
 	}
 }
 
-static struct regmap_config jsa1212_regmap_config = {
+static const struct regmap_config jsa1212_regmap_config = {
 	.name =  JSA1212_REGMAP_NAME,
 	.reg_bits = 8,
 	.val_bits = 8,
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging:iio:hmc5843: Constify register tables and struct regmap_config
  2015-02-24  9:41 [PATCH 1/2] staging:iio:hmc5843: Constify register tables and struct regmap_config Krzysztof Kozlowski
  2015-02-24  9:41 ` [PATCH 2/2] iio: jsa1212: Constify " Krzysztof Kozlowski
@ 2015-02-25 11:54 ` Jonathan Cameron
  2015-02-26  9:11   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2015-02-25 11:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Greg Kroah-Hartman, linux-iio, linux-kernel,
	devel

On 24/02/15 09:41, Krzysztof Kozlowski wrote:
> The regmap_access_table and regmap_config structures may be const
> because they are not modified by the driver and regmap_init() accepts
> pointer to const.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Applied to the togreg branch of iio.git. Note I ended up hand applying
this due to DOS line endings and some fuzz.

Jonathan
> ---
>  drivers/staging/iio/magnetometer/hmc5843_i2c.c | 8 ++++----
>  drivers/staging/iio/magnetometer/hmc5843_spi.c | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> index 6acd614cdbc6..8346cf81fc2e 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> @@ -22,7 +22,7 @@ static const struct regmap_range hmc5843_readable_ranges[] = {
>  		regmap_reg_range(0, HMC5843_ID_END),
>  };
>  
> -static struct regmap_access_table hmc5843_readable_table = {
> +static const struct regmap_access_table hmc5843_readable_table = {
>  		.yes_ranges = hmc5843_readable_ranges,
>  		.n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
>  };
> @@ -31,7 +31,7 @@ static const struct regmap_range hmc5843_writable_ranges[] = {
>  		regmap_reg_range(0, HMC5843_MODE_REG),
>  };
>  
> -static struct regmap_access_table hmc5843_writable_table = {
> +static const struct regmap_access_table hmc5843_writable_table = {
>  		.yes_ranges = hmc5843_writable_ranges,
>  		.n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
>  };
> @@ -40,12 +40,12 @@ static const struct regmap_range hmc5843_volatile_ranges[] = {
>  		regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
>  };
>  
> -static struct regmap_access_table hmc5843_volatile_table = {
> +static const struct regmap_access_table hmc5843_volatile_table = {
>  		.yes_ranges = hmc5843_volatile_ranges,
>  		.n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
>  };
>  
> -static struct regmap_config hmc5843_i2c_regmap_config = {
> +static const struct regmap_config hmc5843_i2c_regmap_config = {
>  		.reg_bits = 8,
>  		.val_bits = 8,
>  
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c b/drivers/staging/iio/magnetometer/hmc5843_spi.c
> index 98c4b57101c9..8e658f736e1f 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_spi.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c
> @@ -19,7 +19,7 @@ static const struct regmap_range hmc5843_readable_ranges[] = {
>  		regmap_reg_range(0, HMC5843_ID_END),
>  };
>  
> -static struct regmap_access_table hmc5843_readable_table = {
> +static const struct regmap_access_table hmc5843_readable_table = {
>  		.yes_ranges = hmc5843_readable_ranges,
>  		.n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
>  };
> @@ -28,7 +28,7 @@ static const struct regmap_range hmc5843_writable_ranges[] = {
>  		regmap_reg_range(0, HMC5843_MODE_REG),
>  };
>  
> -static struct regmap_access_table hmc5843_writable_table = {
> +static const struct regmap_access_table hmc5843_writable_table = {
>  		.yes_ranges = hmc5843_writable_ranges,
>  		.n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
>  };
> @@ -37,12 +37,12 @@ static const struct regmap_range hmc5843_volatile_ranges[] = {
>  		regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
>  };
>  
> -static struct regmap_access_table hmc5843_volatile_table = {
> +static const struct regmap_access_table hmc5843_volatile_table = {
>  		.yes_ranges = hmc5843_volatile_ranges,
>  		.n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
>  };
>  
> -static struct regmap_config hmc5843_spi_regmap_config = {
> +static const struct regmap_config hmc5843_spi_regmap_config = {
>  		.reg_bits = 8,
>  		.val_bits = 8,
>  
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] iio: jsa1212: Constify struct regmap_config
  2015-02-24  9:41 ` [PATCH 2/2] iio: jsa1212: Constify " Krzysztof Kozlowski
@ 2015-02-25 11:55   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2015-02-25 11:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Greg Kroah-Hartman, linux-iio, linux-kernel,
	devel

On 24/02/15 09:41, Krzysztof Kozlowski wrote:
> The regmap_config struct may be const because it is not modified by the
> driver and regmap_init() accepts pointer to const.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Applied to the togreg branch of iio.git.  I'm having another of my periodic
days in a clean room (with a very dirty laptop), so will be a day or two before
I'm back home and can push out as testing for the autobuilders to play.

On the plus side, the machine I'm working on isn't running so lots of time
for patch review...

Jonathan
> ---
>  drivers/iio/light/jsa1212.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c
> index 29de7e7d9562..3a3af89beaf9 100644
> --- a/drivers/iio/light/jsa1212.c
> +++ b/drivers/iio/light/jsa1212.c
> @@ -308,7 +308,7 @@ static bool jsa1212_is_volatile_reg(struct device *dev, unsigned int reg)
>  	}
>  }
>  
> -static struct regmap_config jsa1212_regmap_config = {
> +static const struct regmap_config jsa1212_regmap_config = {
>  	.name =  JSA1212_REGMAP_NAME,
>  	.reg_bits = 8,
>  	.val_bits = 8,
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging:iio:hmc5843: Constify register tables and struct regmap_config
  2015-02-25 11:54 ` [PATCH 1/2] staging:iio:hmc5843: Constify register tables and " Jonathan Cameron
@ 2015-02-26  9:11   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2015-02-26  9:11 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Greg Kroah-Hartman, linux-iio, linux-kernel, devel

On śro, 2015-02-25 at 11:54 +0000, Jonathan Cameron wrote:
> On 24/02/15 09:41, Krzysztof Kozlowski wrote:
> > The regmap_access_table and regmap_config structures may be const
> > because they are not modified by the driver and regmap_init() accepts
> > pointer to const.
> > 
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Applied to the togreg branch of iio.git. Note I ended up hand applying
> this due to DOS line endings and some fuzz.

Thanks! I rebased the patchsed on next-20150224 so I did not expect any
fuzz.

Best regards,
Krzysztof

> 
> Jonathan
> > ---
> >  drivers/staging/iio/magnetometer/hmc5843_i2c.c | 8 ++++----
> >  drivers/staging/iio/magnetometer/hmc5843_spi.c | 8 ++++----
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> > index 6acd614cdbc6..8346cf81fc2e 100644
> > --- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> > +++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> > @@ -22,7 +22,7 @@ static const struct regmap_range hmc5843_readable_ranges[] = {
> >  		regmap_reg_range(0, HMC5843_ID_END),
> >  };
> >  
> > -static struct regmap_access_table hmc5843_readable_table = {
> > +static const struct regmap_access_table hmc5843_readable_table = {
> >  		.yes_ranges = hmc5843_readable_ranges,
> >  		.n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
> >  };
> > @@ -31,7 +31,7 @@ static const struct regmap_range hmc5843_writable_ranges[] = {
> >  		regmap_reg_range(0, HMC5843_MODE_REG),
> >  };
> >  
> > -static struct regmap_access_table hmc5843_writable_table = {
> > +static const struct regmap_access_table hmc5843_writable_table = {
> >  		.yes_ranges = hmc5843_writable_ranges,
> >  		.n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
> >  };
> > @@ -40,12 +40,12 @@ static const struct regmap_range hmc5843_volatile_ranges[] = {
> >  		regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
> >  };
> >  
> > -static struct regmap_access_table hmc5843_volatile_table = {
> > +static const struct regmap_access_table hmc5843_volatile_table = {
> >  		.yes_ranges = hmc5843_volatile_ranges,
> >  		.n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
> >  };
> >  
> > -static struct regmap_config hmc5843_i2c_regmap_config = {
> > +static const struct regmap_config hmc5843_i2c_regmap_config = {
> >  		.reg_bits = 8,
> >  		.val_bits = 8,
> >  
> > diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c b/drivers/staging/iio/magnetometer/hmc5843_spi.c
> > index 98c4b57101c9..8e658f736e1f 100644
> > --- a/drivers/staging/iio/magnetometer/hmc5843_spi.c
> > +++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c
> > @@ -19,7 +19,7 @@ static const struct regmap_range hmc5843_readable_ranges[] = {
> >  		regmap_reg_range(0, HMC5843_ID_END),
> >  };
> >  
> > -static struct regmap_access_table hmc5843_readable_table = {
> > +static const struct regmap_access_table hmc5843_readable_table = {
> >  		.yes_ranges = hmc5843_readable_ranges,
> >  		.n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
> >  };
> > @@ -28,7 +28,7 @@ static const struct regmap_range hmc5843_writable_ranges[] = {
> >  		regmap_reg_range(0, HMC5843_MODE_REG),
> >  };
> >  
> > -static struct regmap_access_table hmc5843_writable_table = {
> > +static const struct regmap_access_table hmc5843_writable_table = {
> >  		.yes_ranges = hmc5843_writable_ranges,
> >  		.n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
> >  };
> > @@ -37,12 +37,12 @@ static const struct regmap_range hmc5843_volatile_ranges[] = {
> >  		regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
> >  };
> >  
> > -static struct regmap_access_table hmc5843_volatile_table = {
> > +static const struct regmap_access_table hmc5843_volatile_table = {
> >  		.yes_ranges = hmc5843_volatile_ranges,
> >  		.n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
> >  };
> >  
> > -static struct regmap_config hmc5843_spi_regmap_config = {
> > +static const struct regmap_config hmc5843_spi_regmap_config = {
> >  		.reg_bits = 8,
> >  		.val_bits = 8,
> >  
> > 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-26  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24  9:41 [PATCH 1/2] staging:iio:hmc5843: Constify register tables and struct regmap_config Krzysztof Kozlowski
2015-02-24  9:41 ` [PATCH 2/2] iio: jsa1212: Constify " Krzysztof Kozlowski
2015-02-25 11:55   ` Jonathan Cameron
2015-02-25 11:54 ` [PATCH 1/2] staging:iio:hmc5843: Constify register tables and " Jonathan Cameron
2015-02-26  9:11   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).