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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad_sigma_delta: use u8 instead of uint8_t

Replace uint8_t with u8 in the ad_sigma_delta driver.

Technically, uint8_t comes from the C standard library, while u8 is a
Linux kernel type. Since we don't use the C standard library in the
kernel, we should use the kernel types instead.

There is also one instance where int64_t is replaced with s64.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250701-iio-adc-ad7173-add-spi-offload-support-v3-3-42abb83e3dac@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
11d58620 67189665

+14 -13
+9 -8
drivers/iio/adc/ad_sigma_delta.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/slab.h> 16 16 #include <linux/spi/spi.h> 17 + #include <linux/types.h> 17 18 #include <linux/unaligned.h> 18 19 19 20 #include <linux/iio/adc/ad_sigma_delta.h> ··· 39 38 * @sigma_delta: The sigma delta device 40 39 * @comm: New value for the communications register 41 40 */ 42 - void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm) 41 + void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, u8 comm) 43 42 { 44 43 /* Some variants use the lower two bits of the communications register 45 44 * to select the channel */ ··· 60 59 int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, 61 60 unsigned int size, unsigned int val) 62 61 { 63 - uint8_t *data = sigma_delta->tx_buf; 62 + u8 *data = sigma_delta->tx_buf; 64 63 struct spi_transfer t = { 65 64 .tx_buf = data, 66 65 .len = size + 1, ··· 100 99 EXPORT_SYMBOL_NS_GPL(ad_sd_write_reg, "IIO_AD_SIGMA_DELTA"); 101 100 102 101 static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta, 103 - unsigned int reg, unsigned int size, uint8_t *val) 102 + unsigned int reg, unsigned int size, u8 *val) 104 103 { 105 - uint8_t *data = sigma_delta->tx_buf; 104 + u8 *data = sigma_delta->tx_buf; 106 105 int ret; 107 106 struct spi_transfer t[] = { 108 107 { ··· 186 185 int ad_sd_reset(struct ad_sigma_delta *sigma_delta) 187 186 { 188 187 unsigned int reset_length = sigma_delta->info->num_resetclks; 189 - uint8_t *buf; 190 188 unsigned int size; 189 + u8 *buf; 191 190 int ret; 192 191 193 192 size = DIV_ROUND_UP(reset_length, 8); ··· 455 454 struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); 456 455 unsigned int i, slot, samples_buf_size; 457 456 unsigned int channel; 458 - uint8_t *samples_buf; 457 + u8 *samples_buf; 459 458 int ret; 460 459 461 460 if (sigma_delta->num_slots == 1) { ··· 489 488 } 490 489 491 490 samples_buf_size = ALIGN(slot * indio_dev->channels[0].scan_type.storagebits / 8, 8); 492 - samples_buf_size += sizeof(int64_t); 491 + samples_buf_size += sizeof(s64); 493 492 samples_buf = devm_krealloc(&sigma_delta->spi->dev, sigma_delta->samples_buf, 494 493 samples_buf_size, GFP_KERNEL); 495 494 if (!samples_buf) ··· 544 543 struct iio_poll_func *pf = p; 545 544 struct iio_dev *indio_dev = pf->indio_dev; 546 545 struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); 547 - uint8_t *data = sigma_delta->rx_buf; 546 + u8 *data = sigma_delta->rx_buf; 548 547 unsigned int transfer_size; 549 548 unsigned int sample_size; 550 549 unsigned int sample_pos;
+5 -5
include/linux/iio/adc/ad_sigma_delta.h
··· 94 94 bool bus_locked; 95 95 bool keep_cs_asserted; 96 96 97 - uint8_t comm; 97 + u8 comm; 98 98 99 99 const struct ad_sigma_delta_info *info; 100 100 unsigned int active_slots; ··· 105 105 bool status_appended; 106 106 /* map slots to channels in order to know what to expect from devices */ 107 107 unsigned int *slots; 108 - uint8_t *samples_buf; 108 + u8 *samples_buf; 109 109 110 110 /* 111 111 * DMA (thus cache coherency maintenance) requires the ··· 114 114 * 'rx_buf' is up to 32 bits per sample + 64 bit timestamp, 115 115 * rounded to 16 bytes to take into account padding. 116 116 */ 117 - uint8_t tx_buf[4] __aligned(IIO_DMA_MINALIGN); 118 - uint8_t rx_buf[16] __aligned(8); 117 + u8 tx_buf[4] __aligned(IIO_DMA_MINALIGN); 118 + u8 rx_buf[16] __aligned(8); 119 119 }; 120 120 121 121 static inline int ad_sigma_delta_set_channel(struct ad_sigma_delta *sd, ··· 177 177 return 0; 178 178 } 179 179 180 - void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm); 180 + void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, u8 comm); 181 181 int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, 182 182 unsigned int size, unsigned int val); 183 183 int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,