Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:accel:stk8312: use appropriate variable types

Adapt some variable types to reduce unnecessary casting.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Hartmut Knaack and committed by
Jonathan Cameron
7d73e02c 03ecd50c

+4 -4
+4 -4
drivers/iio/accel/stk8312.c
··· 69 69 }; 70 70 71 71 static const struct { 72 - u16 val; 73 - u32 val2; 72 + int val; 73 + int val2; 74 74 } stk8312_samp_freq_table[] = { 75 75 {400, 0}, {200, 0}, {100, 0}, {50, 0}, {25, 0}, 76 76 {12, 500000}, {6, 250000}, {3, 125000} ··· 103 103 struct stk8312_data { 104 104 struct i2c_client *client; 105 105 struct mutex lock; 106 - int range; 106 + u8 range; 107 107 u8 sample_rate_idx; 108 108 u8 mode; 109 109 struct iio_trigger *dready_trig; ··· 243 243 .owner = THIS_MODULE, 244 244 }; 245 245 246 - static int stk8312_set_sample_rate(struct stk8312_data *data, int rate) 246 + static int stk8312_set_sample_rate(struct stk8312_data *data, u8 rate) 247 247 { 248 248 int ret; 249 249 u8 masked_reg;