linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: Don't use bare "unsigned"
@ 2022-06-24  2:18 Joe Simmons-Talbott
  2022-06-25 11:17 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Simmons-Talbott @ 2022-06-24  2:18 UTC (permalink / raw)
  To: jic23, lars, linux-iio, linux-kernel; +Cc: Joe Simmons-Talbott

Use "unsigned int" rather than bare "unsigned". Reported by checkpatch.pl.

Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com>
---
 drivers/iio/industrialio-buffer.c     | 10 +++++-----
 drivers/iio/industrialio-core.c       |  4 ++--
 drivers/iio/industrialio-sw-device.c  |  2 +-
 drivers/iio/industrialio-sw-trigger.c |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index b078eb2f3c9d..513a34a0b593 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -705,7 +705,7 @@ static unsigned int iio_storage_bytes_for_timestamp(struct iio_dev *indio_dev)
 static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
 				const unsigned long *mask, bool timestamp)
 {
-	unsigned bytes = 0;
+	unsigned int bytes = 0;
 	int length, i, largest = 0;
 
 	/* How much space will the demuxed element take? */
@@ -934,9 +934,9 @@ static int iio_verify_update(struct iio_dev *indio_dev,
  * @l:		list head used for management
  */
 struct iio_demux_table {
-	unsigned from;
-	unsigned to;
-	unsigned length;
+	unsigned int from;
+	unsigned int to;
+	unsigned int length;
 	struct list_head l;
 };
 
@@ -974,7 +974,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
 				   struct iio_buffer *buffer)
 {
 	int ret, in_ind = -1, out_ind, length;
-	unsigned in_loc = 0, out_loc = 0;
+	unsigned int in_loc = 0, out_loc = 0;
 	struct iio_demux_table *p = NULL;
 
 	/* Clear out any old demux */
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index e1ed44dec2ab..ca28f76b8f40 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -384,7 +384,7 @@ static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
 {
 	struct iio_dev *indio_dev = file->private_data;
 	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
-	unsigned val = 0;
+	unsigned int val = 0;
 	int ret;
 
 	if (*ppos > 0)
@@ -414,7 +414,7 @@ static ssize_t iio_debugfs_write_reg(struct file *file,
 {
 	struct iio_dev *indio_dev = file->private_data;
 	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
-	unsigned reg, val;
+	unsigned int reg, val;
 	char buf[80];
 	int ret;
 
diff --git a/drivers/iio/industrialio-sw-device.c b/drivers/iio/industrialio-sw-device.c
index 49f775f16ad5..cdaf30a3f233 100644
--- a/drivers/iio/industrialio-sw-device.c
+++ b/drivers/iio/industrialio-sw-device.c
@@ -27,7 +27,7 @@ static DEFINE_MUTEX(iio_device_types_lock);
 
 static
 struct iio_sw_device_type *__iio_find_sw_device_type(const char *name,
-						     unsigned len)
+						     unsigned int len)
 {
 	struct iio_sw_device_type *d = NULL, *iter;
 
diff --git a/drivers/iio/industrialio-sw-trigger.c b/drivers/iio/industrialio-sw-trigger.c
index 9ae793a70b8b..994f03a71520 100644
--- a/drivers/iio/industrialio-sw-trigger.c
+++ b/drivers/iio/industrialio-sw-trigger.c
@@ -27,7 +27,7 @@ static DEFINE_MUTEX(iio_trigger_types_lock);
 
 static
 struct iio_sw_trigger_type *__iio_find_sw_trigger_type(const char *name,
-						       unsigned len)
+						       unsigned int len)
 {
 	struct iio_sw_trigger_type *t = NULL, *iter;
 
-- 
2.35.3


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

* Re: [PATCH] iio: Don't use bare "unsigned"
  2022-06-24  2:18 [PATCH] iio: Don't use bare "unsigned" Joe Simmons-Talbott
@ 2022-06-25 11:17 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-06-25 11:17 UTC (permalink / raw)
  To: Joe Simmons-Talbott; +Cc: lars, linux-iio, linux-kernel

On Thu, 23 Jun 2022 22:18:06 -0400
Joe Simmons-Talbott <joetalbott@gmail.com> wrote:

> Use "unsigned int" rather than bare "unsigned". Reported by checkpatch.pl.
> 
> Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com>

I've always wondered when someone would get around to tidying this up.
Never seemed worth the effort to do it myself :)

Anyhow, thanks.  Applied to the togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/industrialio-buffer.c     | 10 +++++-----
>  drivers/iio/industrialio-core.c       |  4 ++--
>  drivers/iio/industrialio-sw-device.c  |  2 +-
>  drivers/iio/industrialio-sw-trigger.c |  2 +-
>  4 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index b078eb2f3c9d..513a34a0b593 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -705,7 +705,7 @@ static unsigned int iio_storage_bytes_for_timestamp(struct iio_dev *indio_dev)
>  static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
>  				const unsigned long *mask, bool timestamp)
>  {
> -	unsigned bytes = 0;
> +	unsigned int bytes = 0;
>  	int length, i, largest = 0;
>  
>  	/* How much space will the demuxed element take? */
> @@ -934,9 +934,9 @@ static int iio_verify_update(struct iio_dev *indio_dev,
>   * @l:		list head used for management
>   */
>  struct iio_demux_table {
> -	unsigned from;
> -	unsigned to;
> -	unsigned length;
> +	unsigned int from;
> +	unsigned int to;
> +	unsigned int length;
>  	struct list_head l;
>  };
>  
> @@ -974,7 +974,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
>  				   struct iio_buffer *buffer)
>  {
>  	int ret, in_ind = -1, out_ind, length;
> -	unsigned in_loc = 0, out_loc = 0;
> +	unsigned int in_loc = 0, out_loc = 0;
>  	struct iio_demux_table *p = NULL;
>  
>  	/* Clear out any old demux */
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index e1ed44dec2ab..ca28f76b8f40 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -384,7 +384,7 @@ static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
>  {
>  	struct iio_dev *indio_dev = file->private_data;
>  	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
> -	unsigned val = 0;
> +	unsigned int val = 0;
>  	int ret;
>  
>  	if (*ppos > 0)
> @@ -414,7 +414,7 @@ static ssize_t iio_debugfs_write_reg(struct file *file,
>  {
>  	struct iio_dev *indio_dev = file->private_data;
>  	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
> -	unsigned reg, val;
> +	unsigned int reg, val;
>  	char buf[80];
>  	int ret;
>  
> diff --git a/drivers/iio/industrialio-sw-device.c b/drivers/iio/industrialio-sw-device.c
> index 49f775f16ad5..cdaf30a3f233 100644
> --- a/drivers/iio/industrialio-sw-device.c
> +++ b/drivers/iio/industrialio-sw-device.c
> @@ -27,7 +27,7 @@ static DEFINE_MUTEX(iio_device_types_lock);
>  
>  static
>  struct iio_sw_device_type *__iio_find_sw_device_type(const char *name,
> -						     unsigned len)
> +						     unsigned int len)
>  {
>  	struct iio_sw_device_type *d = NULL, *iter;
>  
> diff --git a/drivers/iio/industrialio-sw-trigger.c b/drivers/iio/industrialio-sw-trigger.c
> index 9ae793a70b8b..994f03a71520 100644
> --- a/drivers/iio/industrialio-sw-trigger.c
> +++ b/drivers/iio/industrialio-sw-trigger.c
> @@ -27,7 +27,7 @@ static DEFINE_MUTEX(iio_trigger_types_lock);
>  
>  static
>  struct iio_sw_trigger_type *__iio_find_sw_trigger_type(const char *name,
> -						       unsigned len)
> +						       unsigned int len)
>  {
>  	struct iio_sw_trigger_type *t = NULL, *iter;
>  


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

end of thread, other threads:[~2022-06-25 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24  2:18 [PATCH] iio: Don't use bare "unsigned" Joe Simmons-Talbott
2022-06-25 11:17 ` Jonathan Cameron

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).