RE: [PATCH 5/7] iio:accel:stk8312: use appropriate variable types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Hartmut Knaack [mailto:knaack.h@xxxxxx]
> Sent: Tuesday, July 28, 2015 1:49 AM
> To: linux-iio@xxxxxxxxxxxxxxx
> Cc: Jonathan Cameron; Lars-Peter Clausen; Peter Meerwald; Breana, Tiberiu
> A
> Subject: [PATCH 5/7] iio:accel:stk8312: use appropriate variable types
> 
> Adapt some variable types to reduce unnecessary casting.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx>

+1

Reviewed-by: Tiberiu Breana <tiberiu.a.breana@xxxxxxxxx>

> ---
>  drivers/iio/accel/stk8312.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index
> 8783f0bf7c53..e3624e2b3ec4 100644
> --- a/drivers/iio/accel/stk8312.c
> +++ b/drivers/iio/accel/stk8312.c
> @@ -69,8 +69,8 @@ static const int stk8312_scale_table[][2] = {  };
> 
>  static const struct {
> -	u16 val;
> -	u32 val2;
> +	int val;
> +	int val2;
>  } stk8312_samp_freq_table[] = {
>  	{400, 0}, {200, 0}, {100, 0}, {50, 0}, {25, 0},
>  	{12, 500000}, {6, 250000}, {3, 125000} @@ -103,7 +103,7 @@ static
> const struct iio_chan_spec stk8312_channels[] = {  struct stk8312_data {
>  	struct i2c_client *client;
>  	struct mutex lock;
> -	int range;
> +	u8 range;
>  	u8 sample_rate_idx;
>  	u8 mode;
>  	struct iio_trigger *dready_trig;
> @@ -242,7 +242,7 @@ static const struct iio_trigger_ops stk8312_trigger_ops
> = {
>  	.owner = THIS_MODULE,
>  };
> 
> -static int stk8312_set_sample_rate(struct stk8312_data *data, int rate)
> +static int stk8312_set_sample_rate(struct stk8312_data *data, u8 rate)
>  {
>  	int ret;
>  	u8 masked_reg;
> --
> 2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux