zephyr: replace zephyr integer types with C99 types

git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-05-27 11:26:57 -05:00 committed by Kumar Gala
commit a1b77fd589
2364 changed files with 32505 additions and 32505 deletions

View file

@ -31,7 +31,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
static int eth_enc28j60_soft_reset(struct device *dev)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[2] = { ENC28J60_SPI_SC, 0xFF };
uint8_t buf[2] = { ENC28J60_SPI_SC, 0xFF };
const struct spi_buf tx_buf = {
.buf = buf,
.len = 1,
@ -44,10 +44,10 @@ static int eth_enc28j60_soft_reset(struct device *dev)
return spi_write(context->spi, &context->spi_cfg, &tx);
}
static void eth_enc28j60_set_bank(struct device *dev, u16_t reg_addr)
static void eth_enc28j60_set_bank(struct device *dev, uint16_t reg_addr)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[2];
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
.len = 2
@ -78,11 +78,11 @@ static void eth_enc28j60_set_bank(struct device *dev, u16_t reg_addr)
}
}
static void eth_enc28j60_write_reg(struct device *dev, u16_t reg_addr,
u8_t value)
static void eth_enc28j60_write_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[2];
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
.len = 2
@ -98,11 +98,11 @@ static void eth_enc28j60_write_reg(struct device *dev, u16_t reg_addr,
spi_write(context->spi, &context->spi_cfg, &tx);
}
static void eth_enc28j60_read_reg(struct device *dev, u16_t reg_addr,
u8_t *value)
static void eth_enc28j60_read_reg(struct device *dev, uint16_t reg_addr,
uint8_t *value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[3];
uint8_t buf[3];
const struct spi_buf tx_buf = {
.buf = buf,
.len = 2
@ -118,7 +118,7 @@ static void eth_enc28j60_read_reg(struct device *dev, u16_t reg_addr,
.buffers = &rx_buf,
.count = 1
};
u8_t rx_size = 2U;
uint8_t rx_size = 2U;
if (reg_addr & 0xF000) {
rx_size = 3U;
@ -137,11 +137,11 @@ static void eth_enc28j60_read_reg(struct device *dev, u16_t reg_addr,
}
}
static void eth_enc28j60_set_eth_reg(struct device *dev, u16_t reg_addr,
u8_t value)
static void eth_enc28j60_set_eth_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[2];
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
.len = 2
@ -158,11 +158,11 @@ static void eth_enc28j60_set_eth_reg(struct device *dev, u16_t reg_addr,
}
static void eth_enc28j60_clear_eth_reg(struct device *dev, u16_t reg_addr,
u8_t value)
static void eth_enc28j60_clear_eth_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[2];
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
.len = 2
@ -178,11 +178,11 @@ static void eth_enc28j60_clear_eth_reg(struct device *dev, u16_t reg_addr,
spi_write(context->spi, &context->spi_cfg, &tx);
}
static void eth_enc28j60_write_mem(struct device *dev, u8_t *data_buffer,
u16_t buf_len)
static void eth_enc28j60_write_mem(struct device *dev, uint8_t *data_buffer,
uint16_t buf_len)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[1] = { ENC28J60_SPI_WBM };
uint8_t buf[1] = { ENC28J60_SPI_WBM };
struct spi_buf tx_buf[2] = {
{
.buf = buf,
@ -193,8 +193,8 @@ static void eth_enc28j60_write_mem(struct device *dev, u8_t *data_buffer,
.buffers = tx_buf,
.count = 2
};
u16_t num_segments;
u16_t num_remaining;
uint16_t num_segments;
uint16_t num_remaining;
int i;
num_segments = buf_len / MAX_BUFFER_LENGTH;
@ -220,11 +220,11 @@ static void eth_enc28j60_write_mem(struct device *dev, u8_t *data_buffer,
}
}
static void eth_enc28j60_read_mem(struct device *dev, u8_t *data_buffer,
u16_t buf_len)
static void eth_enc28j60_read_mem(struct device *dev, uint8_t *data_buffer,
uint16_t buf_len)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t buf[1] = { ENC28J60_SPI_RBM };
uint8_t buf[1] = { ENC28J60_SPI_RBM };
const struct spi_buf tx_buf = {
.buf = buf,
.len = 1
@ -243,8 +243,8 @@ static void eth_enc28j60_read_mem(struct device *dev, u8_t *data_buffer,
.buffers = rx_buf,
.count = 2
};
u16_t num_segments;
u16_t num_remaining;
uint16_t num_segments;
uint16_t num_remaining;
int i;
num_segments = buf_len / MAX_BUFFER_LENGTH;
@ -271,10 +271,10 @@ static void eth_enc28j60_read_mem(struct device *dev, u8_t *data_buffer,
}
}
static void eth_enc28j60_write_phy(struct device *dev, u16_t reg_addr,
s16_t data)
static void eth_enc28j60_write_phy(struct device *dev, uint16_t reg_addr,
int16_t data)
{
u8_t data_mistat;
uint8_t data_mistat;
eth_enc28j60_set_bank(dev, ENC28J60_REG_MIREGADR);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MIREGADR, reg_addr);
@ -292,7 +292,7 @@ static void eth_enc28j60_write_phy(struct device *dev, u16_t reg_addr,
static void eth_enc28j60_gpio_callback(struct device *dev,
struct gpio_callback *cb,
u32_t pins)
uint32_t pins)
{
struct eth_enc28j60_runtime *context =
CONTAINER_OF(cb, struct eth_enc28j60_runtime, gpio_cb);
@ -302,7 +302,7 @@ static void eth_enc28j60_gpio_callback(struct device *dev,
static void eth_enc28j60_init_buffers(struct device *dev)
{
u8_t data_estat;
uint8_t data_estat;
/* Reception buffers initialization */
eth_enc28j60_set_bank(dev, ENC28J60_REG_ERXSTL);
@ -351,7 +351,7 @@ static void eth_enc28j60_init_mac(struct device *dev)
{
const struct eth_enc28j60_config *config = dev->config_info;
struct eth_enc28j60_runtime *context = dev->driver_data;
u8_t data_macon;
uint8_t data_macon;
eth_enc28j60_set_bank(dev, ENC28J60_REG_MACON1);
@ -413,7 +413,7 @@ static void eth_enc28j60_init_phy(struct device *dev)
}
static struct net_if *get_iface(struct eth_enc28j60_runtime *ctx,
u16_t vlan_tag)
uint16_t vlan_tag)
{
#if defined(CONFIG_NET_VLAN)
struct net_if *iface;
@ -434,12 +434,12 @@ static struct net_if *get_iface(struct eth_enc28j60_runtime *ctx,
static int eth_enc28j60_tx(struct device *dev, struct net_pkt *pkt)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u16_t tx_bufaddr = ENC28J60_TXSTART;
u16_t len = net_pkt_get_len(pkt);
u8_t per_packet_control;
u16_t tx_bufaddr_end;
uint16_t tx_bufaddr = ENC28J60_TXSTART;
uint16_t len = net_pkt_get_len(pkt);
uint8_t per_packet_control;
uint16_t tx_bufaddr_end;
struct net_buf *frag;
u8_t tx_end;
uint8_t tx_end;
LOG_DBG("pkt %p (len %u)", pkt, len);
@ -504,12 +504,12 @@ static int eth_enc28j60_tx(struct device *dev, struct net_pkt *pkt)
return 0;
}
static int eth_enc28j60_rx(struct device *dev, u16_t *vlan_tag)
static int eth_enc28j60_rx(struct device *dev, uint16_t *vlan_tag)
{
const struct eth_enc28j60_config *config = dev->config_info;
struct eth_enc28j60_runtime *context = dev->driver_data;
u16_t lengthfr;
u8_t counter;
uint16_t lengthfr;
uint8_t counter;
/* Errata 6. The Receive Packet Pending Interrupt Flag (EIR.PKTIF)
* does not reliably/accurately report the status of pending packet.
@ -525,12 +525,12 @@ static int eth_enc28j60_rx(struct device *dev, u16_t *vlan_tag)
do {
struct net_buf *pkt_buf = NULL;
u16_t frm_len = 0U;
u8_t info[RSV_SIZE];
uint16_t frm_len = 0U;
uint8_t info[RSV_SIZE];
struct net_pkt *pkt;
u16_t next_packet;
u8_t rdptl = 0U;
u8_t rdpth = 0U;
uint16_t next_packet;
uint8_t rdptl = 0U;
uint8_t rdpth = 0U;
/* remove read fifo address to packet header address */
eth_enc28j60_set_bank(dev, ENC28J60_REG_ERXRDPTL);
@ -541,7 +541,7 @@ static int eth_enc28j60_rx(struct device *dev, u16_t *vlan_tag)
/* Read address for next packet */
eth_enc28j60_read_mem(dev, info, 2);
next_packet = info[0] | (u16_t)info[1] << 8;
next_packet = info[0] | (uint16_t)info[1] << 8;
/* Errata 14. Even values in ERXRDPT
* may corrupt receive buffer.
@ -576,7 +576,7 @@ static int eth_enc28j60_rx(struct device *dev, u16_t *vlan_tag)
do {
size_t frag_len;
u8_t *data_ptr;
uint8_t *data_ptr;
size_t spi_frame_len;
data_ptr = pkt_buf->data;
@ -660,8 +660,8 @@ done:
static void eth_enc28j60_rx_thread(struct device *dev)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
u16_t vlan_tag = NET_VLAN_TAG_UNSPEC;
u8_t int_stat;
uint16_t vlan_tag = NET_VLAN_TAG_UNSPEC;
uint8_t int_stat;
while (true) {
k_sem_take(&context->int_sem, K_FOREVER);