Skip to contentSkip to conversation

iio: make iio_device_get_drvdata take a const struct iio_dev *.

PATCH Applied [email protected] 2 participants 4 messages May 21, 2020 – Jun 14, 2020 1 message not in the archive IIO

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 iio: make iio_device_get_drvdata take a const struct iio_dev *.

From: Jonathan Cameron <[email protected]>

As this just calls dev_get_drvdata underneath which is happy with a const struct device * we should change and avoid potentially casting away a const in order to then put it back again.

Cc Jean-Baptiste Maneyrol <[email protected]>
---
 include/linux/iio/iio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/iio.h +1 -1
index a1be82e74c93..e846a0a7001e 100644
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
  *
  * Returns the data previously set with iio_device_set_drvdata()
  */
-static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
+static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
 {
 	return dev_get_drvdata(&indio_dev->dev);
 }
Signature · 1 line
2.26.2

A message that is not in the archive (sent off-list or not yet received): SA0PR12MB44290C81C03F7DAEE315DBFBC48B0@SA0PR12MB4429.namprd12.prod.outlook.com

author maintainer Applied
#2 lore raw
Quoted 8 lines · On Tue, 2 Jun 2020 07:39:52 +0000 Jean-Baptiste Maneyrol…

Hi Jonathan,

simple and perfect.

Thanks,
JB

Applied.

Thanks,

Jonathan

Quoted 38 lines

________________________________
From: [email protected] <[email protected]>
Sent: Thursday, May 21, 2020 19:53
To: [email protected] <[email protected]>
Cc: Jonathan Cameron <[email protected]>; Jean-Baptiste Maneyrol <[email protected]>
Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.

CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.

From: Jonathan Cameron <[email protected]>

As this just calls dev_get_drvdata underneath which is happy with a const struct device * we should change and avoid potentially casting away a const in order to then put it back again.

Cc Jean-Baptiste Maneyrol <[email protected]>
---
 include/linux/iio/iio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/iio.h +1 -2
index a1be82e74c93..e846a0a7001e 100644
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
  *
  * Returns the data previously set with iio_device_set_drvdata()
  */
-static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
+static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
 {
         return dev_get_drvdata(&indio_dev->dev);
 }
--

2.26.2

#3 lore raw

Hello Jonathan,

thanks a lot, but I'm currently not able to find this patch in iio git repository, neither in testing or fixes-togreg branches.

Is there something I am missing or I just have to wait more ?

Thanks,
JB

From: [email protected] <[email protected]> on behalf of Jonathan Cameron <[email protected]>
Sent: Saturday, June 6, 2020 16:24
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; Jonathan Cameron <[email protected]>
Subject: Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.

 CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 8 lines · On Tue, 2 Jun 2020 07:39:52 +0000 Jean-Baptiste Maneyrol…

Hi Jonathan,

simple and perfect.

Thanks,
JB

Applied.

Thanks,

Jonathan

Quoted 38 lines

________________________________
From: [email protected] <[email protected]>
Sent: Thursday, May 21, 2020 19:53
To: [email protected] <[email protected]>
Cc: Jonathan Cameron <[email protected]>; Jean-Baptiste Maneyrol <[email protected]>
Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.

  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.

From: Jonathan Cameron <[email protected]>

As this just calls dev_get_drvdata underneath which is happy with a const struct device * we should change and avoid potentially casting away a const in order to then put it back again.

Cc Jean-Baptiste Maneyrol <[email protected]>

---
  include/linux/iio/iio.h | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/iio.h +1 -2
index a1be82e74c93..e846a0a7001e 100644
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
    *
    * Returns the data previously set with iio_device_set_drvdata()
    */
-static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
+static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
   {
           return dev_get_drvdata(&indio_dev->dev);
   }
--

2.26.2

author maintainer
#4 lore raw
Quoted 5 lines · On Mon, 8 Jun 2020 09:43:26 +0000 Jean-Baptiste Maneyrol…

Hello Jonathan,

thanks a lot, but I'm currently not able to find this patch in iio git repository, neither in testing or fixes-togreg branches.

Is there something I am missing or I just have to wait more ?

I forgot to push out. Did so mid week after I saw another email saying things weren't there that should have been.

Given I've just rebased testing, I won't push out a togreg branch until at least mid week to let the build reports come in.

Thanks,

Jonathan

Quoted 70 lines

Thanks,
JB

From: [email protected] <[email protected]> on behalf of Jonathan Cameron <[email protected]>
Sent: Saturday, June 6, 2020 16:24
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; Jonathan Cameron <[email protected]>
Subject: Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.

 CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 8 lines · On Tue, 2 Jun 2020 07:39:52 +0000 Jean-Baptiste Maneyrol…

Hi Jonathan,

simple and perfect.

Thanks,
JB

Applied.

Thanks,

Jonathan

Quoted 38 lines

________________________________
From: [email protected] <[email protected]>
Sent: Thursday, May 21, 2020 19:53
To: [email protected] <[email protected]>
Cc: Jonathan Cameron <[email protected]>; Jean-Baptiste Maneyrol <[email protected]>
Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.

  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.

From: Jonathan Cameron <[email protected]>

As this just calls dev_get_drvdata underneath which is happy with a const struct device * we should change and avoid potentially casting away a const in order to then put it back again.

Cc Jean-Baptiste Maneyrol <[email protected]>

---
  include/linux/iio/iio.h | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/iio/iio.h +1 -2
index a1be82e74c93..e846a0a7001e 100644
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
    *
    * Returns the data previously set with iio_device_set_drvdata()
    */
-static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
+static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
   {
           return dev_get_drvdata(&indio_dev->dev);
   }
--

2.26.2