2022-03-09 09:43:08

by Hatim Muhammed

[permalink] [raw]
Subject: [PATCH 8/8] Constify comedi_lrange struct pointer

From: Hatim Muhammed <[email protected]>

Signed-off-by: Hatim Muhammed <[email protected]>
---
drivers/comedi/drivers/das16.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/comedi/drivers/das16.c b/drivers/comedi/drivers/das16.c
index 937a69ce0977..d1eeb5896f2d 100644
--- a/drivers/comedi/drivers/das16.c
+++ b/drivers/comedi/drivers/das16.c
@@ -956,7 +956,7 @@ static const struct comedi_lrange *das16_ai_range(struct comedi_device *dev,

/* get any user-defined input range */
if (pg_type == das16_pg_none && (min || max)) {
- struct comedi_lrange *lrange;
+ const struct comedi_lrange *lrange;
struct comedi_krange *krange;

/* allocate single-range range table */
@@ -990,7 +990,7 @@ static const struct comedi_lrange *das16_ao_range(struct comedi_device *dev,

/* get any user-defined output range */
if (min || max) {
- struct comedi_lrange *lrange;
+ const struct comedi_lrange *lrange;
struct comedi_krange *krange;

/* allocate single-range range table */
--
2.35.1


2022-03-09 13:33:14

by Ian Abbott

[permalink] [raw]
Subject: Re: [PATCH 8/8] Constify comedi_lrange struct pointer

On 09/03/2022 09:12, Hatim Muhammed wrote:
> From: Hatim Muhammed <[email protected]>
>
> Signed-off-by: Hatim Muhammed <[email protected]>
> ---
> drivers/comedi/drivers/das16.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/comedi/drivers/das16.c b/drivers/comedi/drivers/das16.c
> index 937a69ce0977..d1eeb5896f2d 100644
> --- a/drivers/comedi/drivers/das16.c
> +++ b/drivers/comedi/drivers/das16.c
> @@ -956,7 +956,7 @@ static const struct comedi_lrange *das16_ai_range(struct comedi_device *dev,
>
> /* get any user-defined input range */
> if (pg_type == das16_pg_none && (min || max)) {
> - struct comedi_lrange *lrange;
> + const struct comedi_lrange *lrange;
> struct comedi_krange *krange;
>
> /* allocate single-range range table */
> @@ -990,7 +990,7 @@ static const struct comedi_lrange *das16_ao_range(struct comedi_device *dev,
>
> /* get any user-defined output range */
> if (min || max) {
> - struct comedi_lrange *lrange;
> + const struct comedi_lrange *lrange;
> struct comedi_krange *krange;
>
> /* allocate single-range range table */

NAK. I'm pretty sure this will result in new compiler warnings because
*lrange really isn't const.

--
-=( Ian Abbott <[email protected]> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || http://www.mev.co.uk )=-