coccicnelle: Ignore return of memset

The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-09-11 19:09:03 -07:00 committed by Anas Nashif
parent 5884c7f54b
commit da49f2e440
220 changed files with 577 additions and 550 deletions

View file

@ -347,9 +347,8 @@ static int ttable_get_empty_slot(void)
}
/* Clear new piece of table */
memset(&threads_table[threads_table_size],
0,
PC_ALLOC_CHUNK_SIZE * sizeof(struct threads_table_el));
(void)memset(&threads_table[threads_table_size], 0,
PC_ALLOC_CHUNK_SIZE * sizeof(struct threads_table_el));
threads_table_size += PC_ALLOC_CHUNK_SIZE;

View file

@ -66,7 +66,8 @@ void _new_thread(struct k_thread *thread, k_thread_stack_t *stack,
#if XCHAL_CP_NUM > 0
/* Ensure CP state descriptor is correctly initialized */
cpStack = thread->arch.preempCoprocReg.cpStack; /* short hand alias */
memset(cpStack, 0, XT_CP_ASA); /* Set to zero to avoid bad surprises */
/* Set to zero to avoid bad surprises */
(void)memset(cpStack, 0, XT_CP_ASA);
/* Coprocessor's stack is allocated just after the k_thread */
cpSA = (u32_t *)(thread->arch.preempCoprocReg.cpStack + XT_CP_ASA);
/* Coprocessor's save area alignment is at leat 16 bytes */

View file

@ -27,7 +27,7 @@ void *xtensa_init_stack(int *stack_top,
const int bsasz = BASE_SAVE_AREA_SIZE - 16;
void **bsa = (void **) (((char *) stack_top) - bsasz);
memset(bsa, 0, bsasz);
(void)memset(bsa, 0, bsasz);
bsa[BSA_PC_OFF/4] = _thread_entry;
bsa[BSA_PS_OFF/4] = (void *)(PS_WOE | PS_UM | PS_CALLINC(1));

View file

@ -168,7 +168,7 @@ static int ti_adc108s102_read(struct device *dev,
s32_t delay;
/* Resetting all internal channel data */
memset(adc->chans, 0, ADC108S102_CHANNELS_SIZE);
(void)memset(adc->chans, 0, ADC108S102_CHANNELS_SIZE);
if (_verify_entries(seq_table) == 0) {
return -EINVAL;

View file

@ -286,7 +286,7 @@ static void h5_send(const u8_t *payload, u8_t type, int len)
hexdump("<= ", payload, len);
memset(hdr, 0, sizeof(hdr));
(void)memset(hdr, 0, sizeof(hdr));
/* Set ACK for outgoing packet and stop delayed work */
H5_SET_ACK(hdr, h5.tx_ack);

View file

@ -285,7 +285,7 @@ static void bt_spi_rx_thread(void)
u8_t size = 0;
int ret;
memset(&txmsg, 0xFF, SPI_MAX_MSG_LEN);
(void)memset(&txmsg, 0xFF, SPI_MAX_MSG_LEN);
while (true) {
k_sem_take(&sem_request, K_FOREVER);

View file

@ -164,7 +164,7 @@ static int user_chan_open(u16_t index)
return -errno;
}
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
addr.hci_family = AF_BLUETOOTH;
addr.hci_dev = index;
addr.hci_channel = HCI_CHANNEL_USER;

View file

@ -285,7 +285,8 @@ static int can_stm32_init(struct device *dev)
data->mb2.tx_callback = NULL;
data->filter_usage = (1ULL << CAN_MAX_NUMBER_OF_FILTES) - 1ULL;
memset(data->rx_response, 0, sizeof(void *) * CONFIG_CAN_MAX_FILTER);
(void)memset(data->rx_response, 0,
sizeof(void *) * CONFIG_CAN_MAX_FILTER);
data->response_type = 0;
clock = device_get_binding(STM32_CLOCK_CONTROL_NAME);
@ -418,7 +419,7 @@ static int can_stm32_shift_arr(void **arr, int start, int count)
cnt = (CONFIG_CAN_MAX_FILTER - start - count) * sizeof(void *);
move_dest = start_ptr + count;
memmove(move_dest, start_ptr, cnt);
memset(start_ptr, 0, count * sizeof(void *));
(void)memset(start_ptr, 0, count * sizeof(void *));
} else if (count < 0) {
count = -count;
@ -428,8 +429,8 @@ static int can_stm32_shift_arr(void **arr, int start, int count)
cnt = (CONFIG_CAN_MAX_FILTER - start) * sizeof(void *);
memmove(start_ptr - count, start_ptr, cnt);
memset(arr + CONFIG_CAN_MAX_FILTER - count, 0,
count * sizeof(void *));
(void)memset(arr + CONFIG_CAN_MAX_FILTER - count, 0,
count * sizeof(void *));
}
return 0;

View file

@ -632,7 +632,7 @@ int ataes132a_aes_ecb_block(struct device *dev,
param_buffer[1] = key_id;
param_buffer[2] = 0x0;
memcpy(param_buffer + 3, pkt->in_buf, buf_len);
memset(param_buffer + 3 + buf_len, 0x0, 16 - buf_len);
(void)memset(param_buffer + 3 + buf_len, 0x0, 16 - buf_len);
return_code = ataes132a_send_command(dev, ATAES_LEGACY_OP, 0x00,
param_buffer, buf_len + 3,

View file

@ -294,7 +294,7 @@ static int tc_session_free(struct device *dev, struct cipher_ctx *sessn)
struct tc_shim_drv_state *data = sessn->drv_sessn_state;
ARG_UNUSED(dev);
memset(data, 0, sizeof(struct tc_shim_drv_state));
(void)memset(data, 0, sizeof(struct tc_shim_drv_state));
data->in_use = 0;
return 0;

View file

@ -164,7 +164,8 @@ static int dw_dma_config(struct device *dev, u32_t channel,
return -ENOMEM;
}
memset(chan_data->lli, 0, (sizeof(struct dw_lli2) * cfg->block_count));
(void)memset(chan_data->lli, 0,
(sizeof(struct dw_lli2) * cfg->block_count));
lli_desc = chan_data->lli;
lli_desc_tail = lli_desc + cfg->block_count - 1;

View file

@ -255,7 +255,7 @@ static int sam_xdmac_config(struct device *dev, u32_t channel,
dev_data->dma_channels[channel].callback = cfg->dma_callback;
memset(&transfer_cfg, 0, sizeof(transfer_cfg));
(void)memset(&transfer_cfg, 0, sizeof(transfer_cfg));
transfer_cfg.sa = cfg->head_block->source_address;
transfer_cfg.da = cfg->head_block->dest_address;
transfer_cfg.ublen = cfg->head_block->block_size >> data_size;

View file

@ -785,7 +785,7 @@ static int eth_0_init(struct device *dev)
#if defined(CONFIG_PTP_CLOCK_MCUX)
ts_tx_rd = 0;
ts_tx_wr = 0;
memset(ts_tx_pkt, 0, sizeof(ts_tx_pkt));
(void)memset(ts_tx_pkt, 0, sizeof(ts_tx_pkt));
#endif
k_sem_init(&context->tx_buf_sem,

View file

@ -61,7 +61,7 @@ int eth_iface_create(const char *if_name, bool tun_only)
return -errno;
}
memset(&ifr, 0, sizeof(ifr));
(void)memset(&ifr, 0, sizeof(ifr));
#ifdef __linux
ifr.ifr_flags = (tun_only ? IFF_TUN : IFF_TAP) | IFF_NO_PI;

View file

@ -327,7 +327,7 @@ static int i2s_cavs_configure(struct device *dev, enum i2s_dir dir,
if (i2s_cfg->frame_clk_freq == 0) {
strm->queue_drop(strm);
memset(&strm->cfg, 0, sizeof(struct i2s_config));
(void)memset(&strm->cfg, 0, sizeof(struct i2s_config));
strm->state = I2S_STATE_NOT_READY;
return 0;
}

View file

@ -169,7 +169,7 @@ static int start_dma(struct device *dev_dma, u32_t channel,
struct dma_block_config blk_cfg;
int ret;
memset(&blk_cfg, 0, sizeof(blk_cfg));
(void)memset(&blk_cfg, 0, sizeof(blk_cfg));
blk_cfg.block_size = blk_size;
blk_cfg.source_address = (u32_t)src;
blk_cfg.dest_address = (u32_t)dst;
@ -557,7 +557,7 @@ static int i2s_sam_configure(struct device *dev, enum i2s_dir dir,
if (i2s_cfg->frame_clk_freq == 0) {
stream->queue_drop(stream);
memset(&stream->cfg, 0, sizeof(struct i2s_config));
(void)memset(&stream->cfg, 0, sizeof(struct i2s_config));
stream->state = I2S_STATE_NOT_READY;
return 0;
}

View file

@ -320,7 +320,7 @@ static int upipe_init(struct device *dev)
{
struct upipe_context *upipe = dev->driver_data;
memset(upipe, 0, sizeof(struct upipe_context));
(void)memset(upipe, 0, sizeof(struct upipe_context));
uart_pipe_register(upipe->uart_pipe_buf, 1, upipe_rx);

View file

@ -205,7 +205,7 @@ int ioapic_suspend(struct device *port)
u32_t rte_lo;
ARG_UNUSED(port);
memset(ioapic_suspend_buf, 0, (SUSPEND_BITS_REQD >> 3));
(void)memset(ioapic_suspend_buf, 0, (SUSPEND_BITS_REQD >> 3));
for (irq = 0; irq < CONFIG_IOAPIC_NUM_RTES; irq++) {
/*
* The following check is to figure out the registered

View file

@ -432,7 +432,7 @@ static int loapic_suspend(struct device *port)
ARG_UNUSED(port);
memset(loapic_suspend_buf, 0, (LOPIC_SUSPEND_BITS_REQD >> 3));
(void)memset(loapic_suspend_buf, 0, (LOPIC_SUSPEND_BITS_REQD >> 3));
for (loapic_irq = 0; loapic_irq < LOAPIC_IRQ_COUNT; loapic_irq++) {

View file

@ -68,7 +68,7 @@ static int lpd880x_update(struct device *dev, void *data, size_t size)
};
size_t rc;
memset(reset_buf, 0x00, reset_size);
(void)memset(reset_buf, 0x00, reset_size);
rc = spi_write(drv_data->spi, &drv_data->config, &tx);
if (rc) {

View file

@ -95,7 +95,7 @@ static int ws2812_reset_strip(struct ws2812_data *data)
.count = 1
};
memset(reset_buf, 0x00, sizeof(reset_buf));
(void)memset(reset_buf, 0x00, sizeof(reset_buf));
return spi_write(data->spi, &data->config, &tx);
}

View file

@ -304,8 +304,8 @@ static void socket_put(struct wncm14a2a_socket *sock)
sock->context = NULL;
sock->socket_id = 0;
memset(&sock->src, 0, sizeof(struct sockaddr));
memset(&sock->dst, 0, sizeof(struct sockaddr));
(void)memset(&sock->src, 0, sizeof(struct sockaddr));
(void)memset(&sock->dst, 0, sizeof(struct sockaddr));
}
char *wncm14a2a_sprint_ip_addr(const struct sockaddr *addr)
@ -512,7 +512,7 @@ static int net_pkt_setup_ip_data(struct net_pkt *pkt,
net_buf_add(pkt->frags, NET_UDPH_LEN);
udp = net_udp_get_hdr(pkt, &hdr);
memset(udp, 0, NET_UDPH_LEN);
(void)memset(udp, 0, NET_UDPH_LEN);
/* Setup UDP header */
udp->src_port = src_port;
@ -527,7 +527,7 @@ static int net_pkt_setup_ip_data(struct net_pkt *pkt,
net_buf_add(pkt->frags, NET_TCPH_LEN);
tcp = net_tcp_get_hdr(pkt, &hdr);
memset(tcp, 0, NET_TCPH_LEN);
(void)memset(tcp, 0, NET_TCPH_LEN);
/* Setup TCP header */
tcp->src_port = src_port;
@ -621,7 +621,7 @@ static void on_cmd_atcmdinfo_rssi(struct net_buf **buf, u16_t len)
char value[64];
value_size = sizeof(value);
memset(value, 0, value_size);
(void)memset(value, 0, value_size);
while (*buf && len > 0 && i < value_size) {
value[i] = net_buf_pull_u8(*buf);
if (!(*buf)->len) {
@ -777,7 +777,7 @@ static void on_cmd_sockread(struct net_buf **buf, u16_t len)
/* first comma marks the end of actual_length */
i = 0;
value_size = sizeof(value);
memset(value, 0, value_size);
(void)memset(value, 0, value_size);
while (*buf && i < value_size) {
value[i++] = net_buf_pull_u8(*buf);
len--;
@ -1444,7 +1444,7 @@ static int wncm14a2a_init(struct device *dev)
__ASSERT(sizeof(pinconfig) == MAX_MDM_CONTROL_PINS,
"Incorrect modem pinconfig!");
memset(&ictx, 0, sizeof(ictx));
(void)memset(&ictx, 0, sizeof(ictx));
for (i = 0; i < MDM_MAX_SOCKETS; i++) {
k_work_init(&ictx.sockets[i].recv_cb_work,
sockreadrecv_cb_work);

View file

@ -385,7 +385,7 @@ void pci_header_get(u32_t controller,
/* clear out the header */
memset(pci_dev_header, 0, sizeof(*pci_dev_header));
(void)memset(pci_dev_header, 0, sizeof(*pci_dev_header));
/* fill in the PCI header from the device */

View file

@ -126,7 +126,7 @@ static int dht_sample_fetch(struct device *dev, enum sensor_channel chan)
/* store bits in buf */
j = 0;
memset(buf, 0, sizeof(buf));
(void)memset(buf, 0, sizeof(buf));
for (i = 0; i < DHT_DATA_BITS_NUM; i++) {
if (signal_duration[i] >= avg_duration) {
buf[j] = (buf[j] << 1) | 1;

View file

@ -324,7 +324,7 @@ int lis2dh_init(struct device *dev)
* pin. Register values are retained if power is not removed.
* Default values see LIS2DH documentation page 30, chapter 6.
*/
memset(raw, 0, sizeof(raw));
(void)memset(raw, 0, sizeof(raw));
raw[LIS2DH_DATA_OFS] = LIS2DH_ACCEL_EN_BITS;
status = lis2dh_burst_write(dev, LIS2DH_REG_CTRL1, raw,

View file

@ -406,7 +406,7 @@ int lis2dh_init_interrupt(struct device *dev)
return status;
}
memset(raw, 0, sizeof(raw));
(void)memset(raw, 0, sizeof(raw));
status = lis2dh_burst_write(dev, LIS2DH_REG_INT2_THS, raw, sizeof(raw));
if (status < 0) {
SYS_LOG_ERR("Burst write to INT2 THS failed (%d)", status);

View file

@ -237,7 +237,7 @@ static int vl53l0x_init(struct device *dev)
drv_data->vl53l0x.I2cDevAddr = CONFIG_VL53L0X_I2C_ADDR;
/* Get info from sensor */
memset(&vl53l0x_dev_info, 0, sizeof(VL53L0X_DeviceInfo_t));
(void)memset(&vl53l0x_dev_info, 0, sizeof(VL53L0X_DeviceInfo_t));
ret = VL53L0X_GetDeviceInfo(&drv_data->vl53l0x, &vl53l0x_dev_info);
if (ret < 0) {

View file

@ -801,7 +801,7 @@ int usb_dc_reset(void)
ret = usb_dw_reset();
/* Clear private data */
memset(&usb_dw_ctrl, 0, sizeof(usb_dw_ctrl));
(void)memset(&usb_dw_ctrl, 0, sizeof(usb_dw_ctrl));
return ret;
}

View file

@ -193,7 +193,7 @@ int usb_dc_reset(void)
for (u8_t i = 0; i < 16; i++) {
USB0->ENDPOINT[i].ENDPT = 0;
}
memset(bdt, 0, sizeof(bdt));
(void)memset(bdt, 0, sizeof(bdt));
dev_data.bd_active = 0;
dev_data.address = 0;
@ -333,11 +333,11 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data * const cfg)
}
USB0->ENDPOINT[ep_idx].ENDPT = 0;
memset(&bdt[idx_even], 0, sizeof(struct buf_descriptor));
memset(&bdt[idx_odd], 0, sizeof(struct buf_descriptor));
(void)memset(&bdt[idx_even], 0, sizeof(struct buf_descriptor));
(void)memset(&bdt[idx_odd], 0, sizeof(struct buf_descriptor));
if (k_mem_pool_alloc(&ep_buf_pool, block, cfg->ep_mps * 2, 10) == 0) {
memset(block->data, 0, cfg->ep_mps * 2);
(void)memset(block->data, 0, cfg->ep_mps * 2);
} else {
SYS_LOG_ERR("Memory allocation time-out");
return -ENOMEM;

View file

@ -1671,28 +1671,28 @@ static void endpoint_ctx_deinit(void)
ep_ctx = in_endpoint_ctx(i);
__ASSERT_NO_MSG(ep_ctx);
k_mem_pool_free(&ep_ctx->buf.block);
memset(ep_ctx, 0, sizeof(*ep_ctx));
(void)memset(ep_ctx, 0, sizeof(*ep_ctx));
}
for (i = 0; i < CFG_EPOUT_CNT; i++) {
ep_ctx = out_endpoint_ctx(i);
__ASSERT_NO_MSG(ep_ctx);
k_mem_pool_free(&ep_ctx->buf.block);
memset(ep_ctx, 0, sizeof(*ep_ctx));
(void)memset(ep_ctx, 0, sizeof(*ep_ctx));
}
if (CFG_EP_ISOIN_CNT) {
ep_ctx = in_endpoint_ctx(NRF_USBD_EPIN(8));
__ASSERT_NO_MSG(ep_ctx);
k_mem_pool_free(&ep_ctx->buf.block);
memset(ep_ctx, 0, sizeof(*ep_ctx));
(void)memset(ep_ctx, 0, sizeof(*ep_ctx));
}
if (CFG_EP_ISOOUT_CNT) {
ep_ctx = out_endpoint_ctx(NRF_USBD_EPOUT(8));
__ASSERT_NO_MSG(ep_ctx);
k_mem_pool_free(&ep_ctx->buf.block);
memset(ep_ctx, 0, sizeof(*ep_ctx));
(void)memset(ep_ctx, 0, sizeof(*ep_ctx));
}
}

View file

@ -197,7 +197,7 @@ int usb_dc_attach(void)
regs->CTRLA.reg = USB_CTRLA_MODE_DEVICE | USB_CTRLA_RUNSTDBY;
regs->CTRLB.reg = USB_DEVICE_CTRLB_SPDCONF_HS;
memset(data->descriptors, 0, sizeof(data->descriptors));
(void)memset(data->descriptors, 0, sizeof(data->descriptors));
regs->DESCADD.reg = (uintptr_t)&data->descriptors[0];
regs->INTENSET.reg = USB_DEVICE_INTENSET_EORST;

View file

@ -204,7 +204,7 @@ static int wdt_esp32_init(struct device *dev)
{
struct wdt_esp32_data *data = dev->driver_data;
memset(&data->config, 0, sizeof(data->config));
(void)memset(&data->config, 0, sizeof(data->config));
#ifdef CONFIG_WDT_DISABLE_AT_BOOT
wdt_esp32_disable(dev);

View file

@ -161,7 +161,7 @@ static s32_t configure_simplelink(void)
ASSERT_ON_ERROR(retval, NETAPP_ERROR);
/* Remove all 64 RX filters (8*8) */
memset(rx_filterid_mask.FilterBitmap, 0xFF, 8);
(void)memset(rx_filterid_mask.FilterBitmap, 0xFF, 8);
retval = sl_WlanSet(SL_WLAN_RX_FILTERS_ID, SL_WLAN_RX_FILTER_REMOVE,
sizeof(SlWlanRxFilterOperationCommandBuff_t),
@ -263,8 +263,8 @@ void SimpleLinkWlanEventHandler(SlWlanEvent_t *wlan_event)
sl_conn.error = event_data->ReasonCode;
}
memset(&(sl_conn.ssid), 0x0, sizeof(sl_conn.ssid));
memset(&(sl_conn.bssid), 0x0, sizeof(sl_conn.bssid));
(void)memset(&(sl_conn.ssid), 0x0, sizeof(sl_conn.ssid));
(void)memset(&(sl_conn.bssid), 0x0, sizeof(sl_conn.bssid));
/* Continue the notification callback chain... */
nwp.cb(SL_WLAN_EVENT_DISCONNECT, &sl_conn);
@ -288,7 +288,7 @@ void SimpleLinkWlanEventHandler(SlWlanEvent_t *wlan_event)
sl_conn.bssid[2], sl_conn.bssid[3],
sl_conn.bssid[4], sl_conn.bssid[5]);
memset(&(sl_conn.bssid), 0x0, sizeof(sl_conn.bssid));
(void)memset(&(sl_conn.bssid), 0x0, sizeof(sl_conn.bssid));
break;
default:
SYS_LOG_ERR("\n[WLAN EVENT] Unexpected event [0x%lx]",
@ -496,7 +496,7 @@ void _simplelink_get_scan_result(int index,
__ASSERT_NO_MSG(index <= CONFIG_WIFI_SIMPLELINK_SCAN_COUNT);
net_entry = &nwp.net_entries[index];
memset(scan_result, 0x0, sizeof(struct wifi_scan_result));
(void)memset(scan_result, 0x0, sizeof(struct wifi_scan_result));
__ASSERT_NO_MSG(net_entry->SsidLen <= WIFI_SSID_MAX_LEN);
memcpy(scan_result->ssid, net_entry->Ssid, net_entry->SsidLen);
@ -519,7 +519,7 @@ int _simplelink_start_scan(void)
s32_t ret;
/* Clear the results buffer */
memset(&nwp.net_entries, 0x0, sizeof(nwp.net_entries));
(void)memset(&nwp.net_entries, 0x0, sizeof(nwp.net_entries));
/* Attempt to get scan results from NWP
* Note: If scan policy isn't set, invoking 'sl_WlanGetNetworkList()'
@ -588,7 +588,7 @@ int _simplelink_init(simplelink_wifi_cb_t wifi_cb)
nwp.role = ROLE_RESERVED;
nwp.cb = wifi_cb;
memset(&sl_conn, 0x0, sizeof(sl_conn));
(void)memset(&sl_conn, 0x0, sizeof(sl_conn));
retval = configure_simplelink();
__ASSERT(retval >= 0, "Unable to configure SimpleLink");

View file

@ -158,15 +158,15 @@ void k_call_stacks_analyze(void) { }
*/
void _bss_zero(void)
{
memset(&__bss_start, 0,
((u32_t) &__bss_end - (u32_t) &__bss_start));
(void)memset(&__bss_start, 0,
((u32_t) &__bss_end - (u32_t) &__bss_start));
#ifdef CONFIG_CCM_BASE_ADDRESS
memset(&__ccm_bss_start, 0,
((u32_t) &__ccm_bss_end - (u32_t) &__ccm_bss_start));
(void)memset(&__ccm_bss_start, 0,
((u32_t) &__ccm_bss_end - (u32_t) &__ccm_bss_start));
#endif
#ifdef CONFIG_APPLICATION_MEMORY
memset(&__app_bss_start, 0,
((u32_t) &__app_bss_end - (u32_t) &__app_bss_start));
(void)memset(&__app_bss_start, 0,
((u32_t) &__app_bss_end - (u32_t) &__app_bss_start));
#endif
}
@ -458,7 +458,7 @@ FUNC_NORETURN void _Cstart(void)
char dummy_thread_memory[sizeof(struct k_thread)];
struct k_thread *dummy_thread = (struct k_thread *)&dummy_thread_memory;
memset(dummy_thread_memory, 0, sizeof(dummy_thread_memory));
(void)memset(dummy_thread_memory, 0, sizeof(dummy_thread_memory));
#endif
#endif
/*

View file

@ -80,7 +80,7 @@ void k_mem_domain_init(struct k_mem_domain *domain, u8_t num_parts,
key = irq_lock();
domain->num_partitions = num_parts;
memset(domain->partitions, 0, sizeof(domain->partitions));
(void)memset(domain->partitions, 0, sizeof(domain->partitions));
if (num_parts) {
u32_t i;

View file

@ -193,7 +193,7 @@ void *k_calloc(size_t nmemb, size_t size)
ret = k_malloc(bounds);
if (ret) {
memset(ret, 0, bounds);
(void)memset(ret, 0, bounds);
}
return ret;
}

View file

@ -228,7 +228,7 @@ void *_impl_k_object_alloc(enum k_objects otype)
dyn_obj->kobj.name = (char *)&dyn_obj->data;
dyn_obj->kobj.type = otype;
dyn_obj->kobj.flags = K_OBJ_FLAG_ALLOC;
memset(dyn_obj->kobj.perms, 0, CONFIG_MAX_THREAD_BYTES);
(void)memset(dyn_obj->kobj.perms, 0, CONFIG_MAX_THREAD_BYTES);
/* Need to grab a new thread index for k_thread */
if (otype == K_OBJ_THREAD) {
@ -570,7 +570,7 @@ void _k_object_recycle(void *object)
struct _k_object *ko = _k_object_find(object);
if (ko) {
memset(ko->perms, 0, sizeof(ko->perms));
(void)memset(ko->perms, 0, sizeof(ko->perms));
_thread_perms_set(ko, k_current_get());
ko->flags |= K_OBJ_FLAG_INITIALIZED;
}

View file

@ -86,7 +86,7 @@ void *osMailCAlloc(osMailQId queue_id, uint32_t millisec)
}
if (retval == 0) {
memset(ptr, 0, queue_def->item_sz);
(void)memset(ptr, 0, queue_def->item_sz);
return ptr;
} else {
return NULL;
@ -109,7 +109,7 @@ osStatus osMailPut(osMailQId queue_id, void *mail)
return osErrorValue;
}
memset(&mmsg, 0, sizeof(mmsg));
(void)memset(&mmsg, 0, sizeof(mmsg));
mmsg.tx_data = mail;
mmsg.rx_source_thread = K_ANY;
mmsg.tx_target_thread = K_ANY;
@ -133,7 +133,7 @@ osEvent osMailGet(osMailQId queue_id, uint32_t millisec)
return evt;
}
memset(&mmsg, 0, sizeof(mmsg));
(void)memset(&mmsg, 0, sizeof(mmsg));
mmsg.rx_source_thread = K_ANY;
mmsg.tx_target_thread = K_ANY;

View file

@ -47,7 +47,7 @@ void *osPoolCAlloc(osPoolId pool_id)
if (k_mem_slab_alloc((struct k_mem_slab *)(osPool->pool),
&ptr, TIME_OUT) == 0) {
memset(ptr, 0, osPool->item_sz);
(void)memset(ptr, 0, osPool->item_sz);
return ptr;
} else {
return NULL;

View file

@ -26,7 +26,7 @@ osMutexId osMutexCreate(const osMutexDef_t *mutex_def)
}
if (k_mem_slab_alloc(&cmsis_mutex_slab, (void **)&mutex, 100) == 0) {
memset(mutex, 0, sizeof(struct k_mutex));
(void)memset(mutex, 0, sizeof(struct k_mutex));
} else {
return NULL;
}

View file

@ -28,7 +28,7 @@ osSemaphoreId osSemaphoreCreate(const osSemaphoreDef_t *semaphore_def,
if (k_mem_slab_alloc(&cmsis_semaphore_slab,
(void **)&semaphore, 100) == 0) {
memset(semaphore, 0, sizeof(struct k_sem));
(void)memset(semaphore, 0, sizeof(struct k_sem));
} else {
return NULL;
}

View file

@ -48,7 +48,7 @@ osTimerId osTimerCreate(const osTimerDef_t *timer_def, os_timer_type type,
}
if (k_mem_slab_alloc(&cmsis_timer_slab, (void **)&timer, 100) == 0) {
memset(timer, 0, sizeof(struct timer_obj));
(void)memset(timer, 0, sizeof(struct timer_obj));
} else {
return NULL;
}

View file

@ -83,7 +83,7 @@ void *calloc(size_t nmemb, size_t size)
ret = malloc(size);
if (ret) {
memset(ret, 0, size);
(void)memset(ret, 0, size);
}
return ret;

View file

@ -106,7 +106,7 @@ int open(const char *name, int flags)
errno = ENFILE;
return -1;
}
memset(ptr, 0, sizeof(struct fs_file_t));
(void)memset(ptr, 0, sizeof(struct fs_file_t));
rc = fs_open(ptr, name);
if (rc < 0) {
@ -233,7 +233,7 @@ DIR *opendir(const char *dirname)
errno = EMFILE;
return NULL;
}
memset(ptr, 0, sizeof(struct fs_dir_t));
(void)memset(ptr, 0, sizeof(struct fs_dir_t));
rc = fs_opendir(ptr, dirname);
if (rc < 0) {

View file

@ -97,7 +97,7 @@ mqd_t mq_open(const char *name, int oflags, ...)
mq_desc_ptr = k_malloc(sizeof(struct mqueue_desc));
if (mq_desc_ptr != NULL) {
memset(mq_desc_ptr, 0, sizeof(struct mqueue_desc));
(void)memset(mq_desc_ptr, 0, sizeof(struct mqueue_desc));
msg_queue_desc = (struct mqueue_desc *)mq_desc_ptr;
msg_queue_desc->mem_desc = mq_desc_ptr;
} else {
@ -116,7 +116,7 @@ mqd_t mq_open(const char *name, int oflags, ...)
mq_obj_ptr = k_malloc(sizeof(mqueue_object));
if (mq_obj_ptr != NULL) {
memset(mq_obj_ptr, 0, sizeof(mqueue_object));
(void)memset(mq_obj_ptr, 0, sizeof(mqueue_object));
msg_queue = (mqueue_object *)mq_obj_ptr;
msg_queue->mem_obj = mq_obj_ptr;
@ -126,7 +126,7 @@ mqd_t mq_open(const char *name, int oflags, ...)
mq_name_ptr = k_malloc(strlen(name) + 1);
if (mq_name_ptr != NULL) {
memset(mq_name_ptr, 0, strlen(name) + 1);
(void)memset(mq_name_ptr, 0, strlen(name) + 1);
msg_queue->name = mq_name_ptr;
} else {
@ -137,8 +137,8 @@ mqd_t mq_open(const char *name, int oflags, ...)
mq_buf_ptr = k_malloc(msg_size * max_msgs * sizeof(u8_t));
if (mq_buf_ptr != NULL) {
memset(mq_buf_ptr, 0,
msg_size * max_msgs * sizeof(u8_t));
(void)memset(mq_buf_ptr, 0,
msg_size * max_msgs * sizeof(u8_t));
msg_queue->mem_buffer = mq_buf_ptr;
} else {
goto free_mq_buffer;

View file

@ -59,7 +59,7 @@ int timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid)
}
if (k_mem_slab_alloc(&posix_timer_slab, (void **)&timer, 100) == 0) {
memset(timer, 0, sizeof(struct timer_obj));
(void)memset(timer, 0, sizeof(struct timer_obj));
} else {
errno = ENOMEM;
return -1;

View file

@ -281,5 +281,5 @@ stats_init_and_reg(struct stats_hdr *shdr, u8_t size, u8_t cnt,
void
stats_reset(struct stats_hdr *hdr)
{
memset(hdr + 1, 0, hdr->s_size * hdr->s_cnt);
(void)memset(hdr + 1, 0, hdr->s_size * hdr->s_cnt);
}

View file

@ -48,7 +48,7 @@ static u8_t discover_func(struct bt_conn *conn,
if (!attr) {
printk("Discover complete\n");
memset(params, 0, sizeof(*params));
(void)memset(params, 0, sizeof(*params));
return BT_GATT_ITER_STOP;
}

View file

@ -182,7 +182,7 @@ static void bt_tx_thread(void *p1, void *p2, void *p3)
ARG_UNUSED(p2);
ARG_UNUSED(p3);
memset(txmsg, 0xFF, SPI_MAX_MSG_LEN);
(void)memset(txmsg, 0xFF, SPI_MAX_MSG_LEN);
while (1) {
tx.buf = header_slave;

View file

@ -99,7 +99,7 @@ void main(void)
char row[16];
/* clear LCD */
memset(row, ' ', sizeof(row));
(void)memset(row, ' ', sizeof(row));
glcd_cursor_pos_set(glcd, 0, 0);
glcd_print(glcd, row, sizeof(row));
glcd_cursor_pos_set(glcd, 0, 1);

View file

@ -171,7 +171,7 @@ static u8_t discover_func(struct bt_conn *conn,
if (!attr) {
printk("Discover complete\n");
memset(&discov_param, 0, sizeof(discov_param));
(void)memset(&discov_param, 0, sizeof(discov_param));
return BT_GATT_ITER_STOP;
}

View file

@ -136,9 +136,9 @@ void main(void)
ccm_data_var_16 = ~CCM_DATA_VAR_16_VAL;
ccm_data_var_32 = ~CCM_DATA_VAR_32_VAL;
memset(ccm_data_array, 0xAA, sizeof(ccm_data_array));
memset(ccm_bss_array, 0xBB, sizeof(ccm_bss_array));
memset(ccm_noinit_array, 0xCC, sizeof(ccm_noinit_array));
(void)memset(ccm_data_array, 0xAA, sizeof(ccm_data_array));
(void)memset(ccm_bss_array, 0xBB, sizeof(ccm_bss_array));
(void)memset(ccm_noinit_array, 0xCC, sizeof(ccm_noinit_array));
printf("\nVariable values after writing:\n");
print_var_values();

View file

@ -63,7 +63,7 @@ void main(void)
/* Clear ili9340 frame buffer before enabling LCD, reuse corner buffer
*/
memset(buf, 0, buf_size);
(void)memset(buf, 0, buf_size);
h_step = (w * h) / SCREEN_WIDTH;
for (int idx = 0; idx < SCREEN_HEIGHT; idx += h_step) {
@ -76,7 +76,7 @@ void main(void)
/* Update the color of the rectangle buffer and write the buffer
* to one of the corners
*/
memset(buf, 0, buf_size);
(void)memset(buf, 0, buf_size);
for (size_t idx = color; idx < buf_size; idx += 3) {
*(buf + idx) = 255;
}

View file

@ -737,7 +737,7 @@ static int large_get(struct coap_resource *resource,
size = min(coap_block_size_to_bytes(ctx.block_size),
ctx.total_size - ctx.current);
memset(payload, 'A', min(size, sizeof(payload)));
(void)memset(payload, 'A', min(size, sizeof(payload)));
r = coap_packet_append_payload(&response, (u8_t *)payload, size);
if (r < 0) {
@ -748,7 +748,7 @@ static int large_get(struct coap_resource *resource,
r = coap_next_block(&response, &ctx);
if (!r) {
/* Will return 0 when it's the last block. */
memset(&ctx, 0, sizeof(ctx));
(void)memset(&ctx, 0, sizeof(ctx));
}
return net_context_sendto(pkt, (const struct sockaddr *)&from,

View file

@ -98,7 +98,7 @@ static int init_vlan(void)
struct ud ud;
int ret;
memset(&ud, 0, sizeof(ud));
(void)memset(&ud, 0, sizeof(ud));
net_if_foreach(iface_cb, &ud);

View file

@ -405,7 +405,7 @@ void main(void)
#elif ADDR_OPTION == 2
/* Accept any local listening address */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
net_sin(&addr)->sin_port = htons(ZEPHYR_PORT);
@ -416,7 +416,7 @@ void main(void)
#elif ADDR_OPTION == 3
/* Set the bind address according to your configuration */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
/* In this example, listen only IPv6 */
addr.family = AF_INET6;

View file

@ -97,7 +97,7 @@ static int init_vlan(void)
{
int ret;
memset(&ud, 0, sizeof(ud));
(void)memset(&ud, 0, sizeof(ud));
net_if_foreach(iface_cb, &ud);

View file

@ -358,7 +358,7 @@ void main(void)
return;
}
memset(&client, 0x0, sizeof(client));
(void)memset(&client, 0x0, sizeof(client));
client.net_init_timeout = WAIT_TIME;
client.net_timeout = CONNECT_TIME;
#if defined(CONFIG_NET_CONTEXT_NET_PKT_POOL)

View file

@ -297,7 +297,7 @@ static void publisher(void)
int i, rc;
/* Set everything to 0 and later just assign the required fields. */
memset(&client_ctx, 0x00, sizeof(client_ctx));
(void)memset(&client_ctx, 0x00, sizeof(client_ctx));
/* connect, disconnect and malformed may be set to NULL */
client_ctx.mqtt_ctx.connect = connect_cb;

View file

@ -30,7 +30,7 @@ void main(void)
}
/* Read prefix from KConfig and parse it */
memset(prefix_str, 0, sizeof(prefix_str));
(void)memset(prefix_str, 0, sizeof(prefix_str));
memcpy(prefix_str, CONFIG_NET_RPL_PREFIX,
min(strlen(CONFIG_NET_RPL_PREFIX), NET_IPV6_ADDR_LEN));

View file

@ -280,7 +280,7 @@ static int http_basic_auth(struct http_ctx *ctx,
char *end, *colon;
int ret;
memset(output, 0, sizeof(output));
(void)memset(output, 0, sizeof(output));
end = strstr(ptr + 2, HTTP_CRLF);
if (!end) {
@ -1926,7 +1926,7 @@ void start_http_server(struct net_if *iface)
#elif ADDR_OPTION == 2
/* Accept any local listening address */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
net_sin(&addr)->sin_port = htons(ZEPHYR_PORT);
@ -1937,7 +1937,7 @@ void start_http_server(struct net_if *iface)
#elif ADDR_OPTION == 3
/* Set the bind address according to your configuration */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
/* In this example, listen only IPv6 */
addr.sa_family = AF_INET6;

View file

@ -71,7 +71,7 @@ bool setup_rpl(struct net_if *iface, const char *addr_prefix)
/* As the addr_prefix is Kconfig option we need to copy it to temporary
* buffer in order to be able to manipulate it.
*/
memset(prefix, 0, sizeof(prefix));
(void)memset(prefix, 0, sizeof(prefix));
memcpy(prefix, addr_prefix, min(strlen(addr_prefix),
NET_IPV6_ADDR_LEN));

View file

@ -181,7 +181,7 @@ static void process_tcp4(void)
int ret;
struct sockaddr_in addr4;
memset(&addr4, 0, sizeof(addr4));
(void)memset(&addr4, 0, sizeof(addr4));
addr4.sin_family = AF_INET;
addr4.sin_port = htons(MY_PORT);
@ -205,7 +205,7 @@ static void process_tcp6(void)
int ret;
struct sockaddr_in6 addr6;
memset(&addr6, 0, sizeof(addr6));
(void)memset(&addr6, 0, sizeof(addr6));
addr6.sin6_family = AF_INET6;
addr6.sin6_port = htons(MY_PORT);

View file

@ -134,7 +134,7 @@ static void process_udp4(void)
int ret;
struct sockaddr_in addr4;
memset(&addr4, 0, sizeof(addr4));
(void)memset(&addr4, 0, sizeof(addr4));
addr4.sin_family = AF_INET;
addr4.sin_port = htons(MY_PORT);
@ -158,7 +158,7 @@ static void process_udp6(void)
int ret;
struct sockaddr_in6 addr6;
memset(&addr6, 0, sizeof(addr6));
(void)memset(&addr6, 0, sizeof(addr6));
addr6.sin6_family = AF_INET6;
addr6.sin6_port = htons(MY_PORT);

View file

@ -401,7 +401,7 @@ void start_ws_console(void)
#elif ADDR_OPTION == 2
/* Accept any local listening address */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
net_sin(&addr)->sin_port = htons(ZEPHYR_PORT);
@ -412,7 +412,7 @@ void start_ws_console(void)
#elif ADDR_OPTION == 3
/* Set the bind address according to your configuration */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
/* In this example, listen only IPv6 */
addr.sa_family = AF_INET6;

View file

@ -459,7 +459,7 @@ void start_server(void)
#elif ADDR_OPTION == 2
/* Accept any local listening address */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
net_sin(&addr)->sin_port = htons(ZEPHYR_PORT);
@ -470,7 +470,7 @@ void start_server(void)
#elif ADDR_OPTION == 3
/* Set the bind address according to your configuration */
memset(&addr, 0, sizeof(addr));
(void)memset(&addr, 0, sizeof(addr));
/* In this example, listen only IPv6 */
addr.sa_family = AF_INET6;

View file

@ -42,7 +42,7 @@ void zperf_tcp_upload(struct net_context *ctx,
last_loop_time = start_time;
printk(TAG "New session started\n");
memset(sample_packet, 'z', sizeof(sample_packet));
(void)memset(sample_packet, 'z', sizeof(sample_packet));
do {
int ret = 0;

View file

@ -211,7 +211,7 @@ void zperf_udp_upload(struct net_context *context,
last_print_time = start_time;
last_loop_time = start_time;
memset(sample_packet, 'z', sizeof(sample_packet));
(void)memset(sample_packet, 'z', sizeof(sample_packet));
do {
struct zperf_udp_datagram datagram;

View file

@ -54,7 +54,7 @@ void main(void)
char row[16];
/* clear LCD */
memset(row, ' ', sizeof(row));
(void)memset(row, ' ', sizeof(row));
glcd_cursor_pos_set(glcd, 0, 0);
glcd_print(glcd, row, sizeof(row));
glcd_cursor_pos_set(glcd, 0, 1);

View file

@ -81,7 +81,7 @@ void main(void)
char row[16];
/* clear LCD */
memset(row, ' ', sizeof(row));
(void)memset(row, ' ', sizeof(row));
glcd_cursor_pos_set(glcd, 0, 0);
glcd_print(glcd, row, sizeof(row));
glcd_cursor_pos_set(glcd, 0, 1);

View file

@ -18,5 +18,5 @@ void sample_instance_call(struct sample_instance *inst)
LOG_INST_INF(inst->log, "counter_value: %d", inst->cnt++);
LOG_INST_HEXDUMP_WRN(inst->log, data, sizeof(data),
"Example of hexdump:");
memset(data, 0, sizeof(data));
(void)memset(data, 0, sizeof(data));
}

View file

@ -258,7 +258,7 @@ int test_switch(void)
printk("%s\n", __func__);
memset(stack2, 0, sizeof(stack2));
(void)memset(stack2, 0, sizeof(stack2));
int *sp = xtensa_init_stack(&stack2[ARRAY_SIZE(stack2)],
(void *)test_switch_bounce,

View file

@ -0,0 +1,11 @@
// Copyright (c) 2017 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0//
@@
expression e1,e2,e3;
@@
- memset(e1,e2,e3);
+ (void)memset(e1,e2,e3);

View file

@ -39,7 +39,8 @@ void __attribute__((section(".iram1"))) __start(void)
: "r"(&_init_start));
/* Zero out BSS. Clobber _bss_start to avoid memset() elision. */
memset(&_bss_start, 0, (&_bss_end - &_bss_start) * sizeof(_bss_start));
(void)memset(&_bss_start, 0,
(&_bss_end - &_bss_start) * sizeof(_bss_start));
__asm__ __volatile__ (
""
:

View file

@ -21,7 +21,7 @@ void app_bss_zero(void)
{
struct app_region *region =
CONTAINER_OF(node, struct app_region, lnode);
memset(region->bmem_start, 0, region->bmem_size);
(void)memset(region->bmem_start, 0, region->bmem_size);
}
}

View file

@ -36,7 +36,7 @@ static int ah(const u8_t irk[16], const u8_t r[3], u8_t out[3])
/* r' = padding || r */
memcpy(res, r, 3);
memset(res + 3, 0, 13);
(void)memset(res + 3, 0, 13);
err = bt_encrypt_le(irk, res, res);
if (err) {

View file

@ -221,7 +221,7 @@ static void reset(struct net_buf *buf, struct net_buf **evt)
hci_hbuf_total = 0;
hci_hbuf_sent = 0;
hci_hbuf_acked = 0;
memset(hci_hbuf_pend, 0, sizeof(hci_hbuf_pend));
(void)memset(hci_hbuf_pend, 0, sizeof(hci_hbuf_pend));
conn_count = 0;
if (buf) {
atomic_set_bit(&hci_state_mask, HCI_STATE_BIT_RESET);
@ -269,7 +269,7 @@ static void set_ctl_to_host_flow(struct net_buf *buf, struct net_buf **evt)
hci_hbuf_sent = 0;
hci_hbuf_acked = 0;
memset(hci_hbuf_pend, 0, sizeof(hci_hbuf_pend));
(void)memset(hci_hbuf_pend, 0, sizeof(hci_hbuf_pend));
hci_hbuf_total = -hci_hbuf_total;
}
@ -468,7 +468,7 @@ static void read_supported_commands(struct net_buf *buf, struct net_buf **evt)
rp = cmd_complete(evt, sizeof(*rp));
rp->status = 0x00;
memset(&rp->commands[0], 0, sizeof(rp->commands));
(void)memset(&rp->commands[0], 0, sizeof(rp->commands));
/* Read Remote Version Info. */
rp->commands[2] |= BIT(7);
@ -611,7 +611,7 @@ static void read_local_features(struct net_buf *buf, struct net_buf **evt)
rp = cmd_complete(evt, sizeof(*rp));
rp->status = 0x00;
memset(&rp->features[0], 0x00, sizeof(rp->features));
(void)memset(&rp->features[0], 0x00, sizeof(rp->features));
/* BR/EDR not supported and LE supported */
rp->features[4] = (1 << 5) | (1 << 6);
}
@ -722,7 +722,7 @@ static void le_read_local_features(struct net_buf *buf, struct net_buf **evt)
rp->status = 0x00;
memset(&rp->features[0], 0x00, sizeof(rp->features));
(void)memset(&rp->features[0], 0x00, sizeof(rp->features));
rp->features[0] = RADIO_BLE_FEAT & 0xFF;
rp->features[1] = (RADIO_BLE_FEAT >> 8) & 0xFF;
rp->features[2] = (RADIO_BLE_FEAT >> 16) & 0xFF;
@ -1765,7 +1765,7 @@ static void vs_read_supported_commands(struct net_buf *buf,
rp = cmd_complete(evt, sizeof(*rp));
rp->status = 0x00;
memset(&rp->commands[0], 0, sizeof(rp->commands));
(void)memset(&rp->commands[0], 0, sizeof(rp->commands));
/* Set Version Information, Supported Commands, Supported Features. */
rp->commands[0] |= BIT(0) | BIT(1) | BIT(2);
@ -1785,7 +1785,7 @@ static void vs_read_supported_features(struct net_buf *buf,
rp = cmd_complete(evt, sizeof(*rp));
rp->status = 0x00;
memset(&rp->features[0], 0x00, sizeof(rp->features));
(void)memset(&rp->features[0], 0x00, sizeof(rp->features));
}
#if defined(CONFIG_BT_HCI_VS_EXT)
@ -1852,7 +1852,7 @@ static void vs_read_static_addrs(struct net_buf *buf, struct net_buf **evt)
BT_ADDR_SET_STATIC(&addr->bdaddr);
/* Mark IR as invalid */
memset(addr->ir, 0x00, sizeof(addr->ir));
(void)memset(addr->ir, 0x00, sizeof(addr->ir));
return;
}
@ -1883,7 +1883,7 @@ static void vs_read_key_hierarchy_roots(struct net_buf *buf,
sys_put_le32(NRF_FICR->IR[3], &rp->ir[12]);
} else {
/* Mark IR as invalid */
memset(rp->ir, 0x00, sizeof(rp->ir));
(void)memset(rp->ir, 0x00, sizeof(rp->ir));
}
/* Fill in ER if present */
@ -1897,15 +1897,15 @@ static void vs_read_key_hierarchy_roots(struct net_buf *buf,
sys_put_le32(NRF_FICR->ER[3], &rp->er[12]);
} else {
/* Mark ER as invalid */
memset(rp->er, 0x00, sizeof(rp->er));
(void)memset(rp->er, 0x00, sizeof(rp->er));
}
return;
#else
/* Mark IR as invalid */
memset(rp->ir, 0x00, sizeof(rp->ir));
(void)memset(rp->ir, 0x00, sizeof(rp->ir));
/* Mark ER as invalid */
memset(rp->er, 0x00, sizeof(rp->er));
(void)memset(rp->er, 0x00, sizeof(rp->er));
#endif /* CONFIG_SOC_FAMILY_NRF */
}
@ -2415,7 +2415,7 @@ static void le_conn_complete(u8_t status, struct radio_le_conn_cmplt *radio_cc,
sizeof(*leecc));
if (status) {
memset(leecc, 0x00, sizeof(*leecc));
(void)memset(leecc, 0x00, sizeof(*leecc));
leecc->status = status;
return;
}
@ -2436,7 +2436,8 @@ static void le_conn_complete(u8_t status, struct radio_le_conn_cmplt *radio_cc,
memcpy(&leecc->local_rpa.val[0], &radio_cc->own_addr[0],
BDADDR_SIZE);
} else {
memset(&leecc->local_rpa.val[0], 0x0, BDADDR_SIZE);
(void)memset(&leecc->local_rpa.val[0], 0x0,
BDADDR_SIZE);
}
memcpy(&leecc->peer_rpa.val[0], &radio_cc->peer_rpa[0],
@ -2453,7 +2454,7 @@ static void le_conn_complete(u8_t status, struct radio_le_conn_cmplt *radio_cc,
lecc = meta_evt(buf, BT_HCI_EVT_LE_CONN_COMPLETE, sizeof(*lecc));
if (status) {
memset(lecc, 0x00, sizeof(*lecc));
(void)memset(lecc, 0x00, sizeof(*lecc));
lecc->status = status;
return;
}
@ -2759,7 +2760,7 @@ static void le_remote_feat_complete(u8_t status, struct pdu_data *pdu_data,
&pdu_data->llctrl.feature_rsp.features[0],
sizeof(sep->features));
} else {
memset(&sep->features[0], 0x00, sizeof(sep->features));
(void)memset(&sep->features[0], 0x00, sizeof(sep->features));
}
}

View file

@ -6222,7 +6222,8 @@ static void mayfly_adv_stop(void *param)
/* prepare connection complete structure */
pdu_data_rx = (void *)node_rx->pdu_data;
radio_le_conn_cmplt = (void *)pdu_data_rx->lldata;
memset(radio_le_conn_cmplt, 0x00, sizeof(struct radio_le_conn_cmplt));
(void)memset(radio_le_conn_cmplt, 0x00,
sizeof(struct radio_le_conn_cmplt));
radio_le_conn_cmplt->status = BT_HCI_ERR_ADV_TIMEOUT;
/* enqueue connection complete structure into queue */
@ -7176,8 +7177,9 @@ static inline void event_fex_prep(struct connection *conn)
!conn->role ?
PDU_DATA_LLCTRL_TYPE_FEATURE_REQ :
PDU_DATA_LLCTRL_TYPE_SLAVE_FEATURE_REQ;
memset(&pdu_ctrl_tx->llctrl.feature_req.features[0], 0x00,
sizeof(pdu_ctrl_tx->llctrl.feature_req.features));
(void)memset(&pdu_ctrl_tx->llctrl.feature_req.features[0],
0x00,
sizeof(pdu_ctrl_tx->llctrl.feature_req.features));
pdu_ctrl_tx->llctrl.feature_req.features[0] =
conn->llcp_features & 0xFF;
pdu_ctrl_tx->llctrl.feature_req.features[1] =
@ -9557,8 +9559,8 @@ static u8_t feature_rsp_send(struct connection *conn,
pdu_ctrl_tx->len = offsetof(struct pdu_data_llctrl, feature_rsp) +
sizeof(struct pdu_data_llctrl_feature_rsp);
pdu_ctrl_tx->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;
memset(&pdu_ctrl_tx->llctrl.feature_rsp.features[0], 0x00,
sizeof(pdu_ctrl_tx->llctrl.feature_rsp.features));
(void)memset(&pdu_ctrl_tx->llctrl.feature_rsp.features[0], 0x00,
sizeof(pdu_ctrl_tx->llctrl.feature_rsp.features));
pdu_ctrl_tx->llctrl.feature_req.features[0] =
conn->llcp_features & 0xFF;
pdu_ctrl_tx->llctrl.feature_req.features[1] =

View file

@ -759,7 +759,7 @@ u32_t ll_rl_add(bt_addr_le_t *id_addr, const u8_t pirk[16],
memcpy(rl[i].local_irk, lirk, 16);
rl[i].local_rpa = NULL;
}
memset(rl[i].curr_rpa.val, 0x00, sizeof(rl[i].curr_rpa));
(void)memset(rl[i].curr_rpa.val, 0x00, sizeof(rl[i].curr_rpa));
rl[i].rpas_ready = 0;
/* Default to Network Privacy */
rl[i].dev = 0;

View file

@ -222,11 +222,11 @@ u32_t ll_test_tx(u8_t chan, u8_t len, u8_t type, u8_t phy)
break;
case 0x01:
memset(payload, 0x0f, len);
(void)memset(payload, 0x0f, len);
break;
case 0x02:
memset(payload, 0x55, len);
(void)memset(payload, 0x55, len);
break;
case 0x03:
@ -234,19 +234,19 @@ u32_t ll_test_tx(u8_t chan, u8_t len, u8_t type, u8_t phy)
break;
case 0x04:
memset(payload, 0xff, len);
(void)memset(payload, 0xff, len);
break;
case 0x05:
memset(payload, 0x00, len);
(void)memset(payload, 0x00, len);
break;
case 0x06:
memset(payload, 0xf0, len);
(void)memset(payload, 0xf0, len);
break;
case 0x07:
memset(payload, 0xaa, len);
(void)memset(payload, 0xaa, len);
break;
}

View file

@ -25,8 +25,8 @@ void mem_init(void *mem_pool, u16_t mem_size, u16_t mem_count,
/* Initialize next pointers to form a free list,
* next pointer is stored in the first 32-bit of each block
*/
memset(((u8_t *)mem_pool + (mem_size * (--mem_count))), 0,
sizeof(mem_pool));
(void)memset(((u8_t *)mem_pool + (mem_size * (--mem_count))), 0,
sizeof(mem_pool));
while (mem_count--) {
u32_t next;

View file

@ -41,7 +41,7 @@ static struct bt_a2dp connection[CONFIG_BT_MAX_CONN];
void a2d_reset(struct bt_a2dp *a2dp_conn)
{
memset(a2dp_conn, 0, sizeof(struct bt_a2dp));
(void)memset(a2dp_conn, 0, sizeof(struct bt_a2dp));
}
struct bt_a2dp *get_new_connection(struct bt_conn *conn)

View file

@ -151,7 +151,7 @@ static int get_response_string(struct at_client *at, struct net_buf *buf,
static void reset_buffer(struct at_client *at)
{
memset(at->buf, 0, at->buf_max_len);
(void)memset(at->buf, 0, at->buf_max_len);
at->pos = 0;
}

View file

@ -107,7 +107,7 @@ static void att_req_destroy(struct bt_att_req *req)
req->destroy(req);
}
memset(req, 0, sizeof(*req));
(void)memset(req, 0, sizeof(*req));
}
static struct bt_att *att_get(struct bt_conn *conn)
@ -459,7 +459,7 @@ static u8_t att_find_info_rsp(struct bt_att *att, u16_t start_handle,
struct bt_conn *conn = att->chan.chan.conn;
struct find_info_data data;
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.buf = bt_att_create_pdu(conn, BT_ATT_OP_FIND_INFO_RSP, 0);
if (!data.buf) {
@ -579,7 +579,7 @@ static u8_t att_find_type_rsp(struct bt_att *att, u16_t start_handle,
struct bt_conn *conn = att->chan.chan.conn;
struct find_type_data data;
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.buf = bt_att_create_pdu(conn, BT_ATT_OP_FIND_TYPE_RSP, 0);
if (!data.buf) {
@ -793,7 +793,7 @@ static u8_t att_read_type_rsp(struct bt_att *att, struct bt_uuid *uuid,
struct bt_conn *conn = att->chan.chan.conn;
struct read_type_data data;
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.buf = bt_att_create_pdu(conn, BT_ATT_OP_READ_TYPE_RSP,
sizeof(*data.rsp));
@ -916,7 +916,7 @@ static u8_t att_read_rsp(struct bt_att *att, u8_t op, u8_t rsp, u16_t handle,
return BT_ATT_ERR_INVALID_HANDLE;
}
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.buf = bt_att_create_pdu(conn, rsp, 0);
if (!data.buf) {
@ -982,7 +982,7 @@ static u8_t att_read_mult_req(struct bt_att *att, struct net_buf *buf)
struct read_data data;
u16_t handle;
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.buf = bt_att_create_pdu(conn, BT_ATT_OP_READ_MULT_RSP, 0);
if (!data.buf) {
@ -1097,7 +1097,7 @@ static u8_t att_read_group_rsp(struct bt_att *att, struct bt_uuid *uuid,
struct bt_conn *conn = att->chan.chan.conn;
struct read_group_data data;
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.buf = bt_att_create_pdu(conn, BT_ATT_OP_READ_GROUP_RSP,
sizeof(*data.rsp));
@ -1224,7 +1224,7 @@ static u8_t att_write_rsp(struct bt_conn *conn, u8_t op, u8_t rsp,
return BT_ATT_ERR_INVALID_HANDLE;
}
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
/* Only allocate buf if required to respond */
if (rsp) {
@ -1340,7 +1340,7 @@ static u8_t att_prep_write_rsp(struct bt_att *att, u16_t handle, u16_t offset,
return BT_ATT_ERR_INVALID_HANDLE;
}
memset(&data, 0, sizeof(data));
(void)memset(&data, 0, sizeof(data));
data.conn = conn;
data.offset = offset;
@ -2120,7 +2120,7 @@ static int bt_att_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan)
continue;
}
memset(att, 0, sizeof(*att));
(void)memset(att, 0, sizeof(*att));
att->chan.chan.ops = &ops;
k_sem_init(&att->tx_sem, CONFIG_BT_ATT_TX_MAX,
CONFIG_BT_ATT_TX_MAX);

View file

@ -227,7 +227,7 @@ static struct bt_conn *conn_new(void)
return NULL;
}
memset(conn, 0, sizeof(*conn));
(void)memset(conn, 0, sizeof(*conn));
atomic_set(&conn->ref, 1);
@ -258,7 +258,7 @@ static struct bt_conn *sco_conn_new(void)
return NULL;
}
memset(sco_conn, 0, sizeof(*sco_conn));
(void)memset(sco_conn, 0, sizeof(*sco_conn));
atomic_set(&sco_conn->ref, 1);
@ -297,7 +297,7 @@ struct bt_conn *bt_conn_create_br(const bt_addr_t *peer,
cp = net_buf_add(buf, sizeof(*cp));
memset(cp, 0, sizeof(*cp));
(void)memset(cp, 0, sizeof(*cp));
memcpy(&cp->bdaddr, peer, sizeof(cp->bdaddr));
cp->packet_type = sys_cpu_to_le16(0xcc18); /* DM1 DH1 DM3 DH5 DM5 DH5 */
@ -354,7 +354,7 @@ struct bt_conn *bt_conn_create_sco(const bt_addr_t *peer)
cp = net_buf_add(buf, sizeof(*cp));
memset(cp, 0, sizeof(*cp));
(void)memset(cp, 0, sizeof(*cp));
BT_ERR("handle : %x", sco_conn->sco.acl->handle);
@ -805,7 +805,7 @@ int bt_conn_le_start_encryption(struct bt_conn *conn, u8_t rand[8],
memcpy(cp->ltk, ltk, len);
if (len < sizeof(cp->ltk)) {
memset(cp->ltk + len, 0, sizeof(cp->ltk) - len);
(void)memset(cp->ltk + len, 0, sizeof(cp->ltk) - len);
}
return bt_hci_cmd_send_sync(BT_HCI_OP_LE_START_ENCRYPTION, buf, NULL);
@ -1997,7 +1997,7 @@ int bt_conn_le_conn_update(struct bt_conn *conn,
}
conn_update = net_buf_add(buf, sizeof(*conn_update));
memset(conn_update, 0, sizeof(*conn_update));
(void)memset(conn_update, 0, sizeof(*conn_update));
conn_update->handle = sys_cpu_to_le16(conn->handle);
conn_update->conn_interval_min = sys_cpu_to_le16(param->interval_min);
conn_update->conn_interval_max = sys_cpu_to_le16(param->interval_max);

View file

@ -960,7 +960,7 @@ static void sc_restore(struct bt_gatt_ccc_cfg *cfg)
sc_indicate(&gatt_sc, data->start, data->end);
/* Reset config data */
memset(cfg->data, 0, sizeof(cfg->data));
(void)memset(cfg->data, 0, sizeof(cfg->data));
}
static u8_t connected_cb(const struct bt_gatt_attr *attr, void *user_data)
@ -1047,7 +1047,7 @@ static u8_t disconnected_cb(const struct bt_gatt_attr *attr, void *user_data)
}
/* Reset value while disconnected */
memset(&ccc->value, 0, sizeof(ccc->value));
(void)memset(&ccc->value, 0, sizeof(ccc->value));
if (ccc->cfg_changed) {
ccc->cfg_changed(attr, ccc->value);
}

View file

@ -566,7 +566,7 @@ static int hci_le_create_conn(const struct bt_conn *conn)
}
cp = net_buf_add(buf, sizeof(*cp));
memset(cp, 0, sizeof(*cp));
(void)memset(cp, 0, sizeof(*cp));
/* Interval == window for continuous scanning */
cp->scan_interval = sys_cpu_to_le16(BT_GAP_SCAN_FAST_INTERVAL);
@ -1153,7 +1153,7 @@ static int le_conn_param_req_reply(u16_t handle,
}
cp = net_buf_add(buf, sizeof(*cp));
memset(cp, 0, sizeof(*cp));
(void)memset(cp, 0, sizeof(*cp));
cp->handle = sys_cpu_to_le16(handle);
cp->interval_min = sys_cpu_to_le16(param->interval_min);
@ -1306,7 +1306,7 @@ static int set_flow_control(void)
}
hbs = net_buf_add(buf, sizeof(*hbs));
memset(hbs, 0, sizeof(*hbs));
(void)memset(hbs, 0, sizeof(*hbs));
hbs->acl_mtu = sys_cpu_to_le16(CONFIG_BT_L2CAP_RX_MTU +
sizeof(struct bt_l2cap_hdr));
hbs->acl_pkts = sys_cpu_to_le16(CONFIG_BT_ACL_RX_COUNT);
@ -1690,8 +1690,8 @@ static void link_key_notify(struct net_buf *buf)
break;
default:
BT_WARN("Unsupported Link Key type %u", evt->key_type);
memset(conn->br.link_key->val, 0,
sizeof(conn->br.link_key->val));
(void)memset(conn->br.link_key->val, 0,
sizeof(conn->br.link_key->val));
break;
}
@ -2137,7 +2137,7 @@ static void inquiry_result_with_rssi(struct net_buf *buf)
result->rssi = evt->rssi;
/* we could reuse slot so make sure EIR is cleared */
memset(result->eir, 0, sizeof(result->eir));
(void)memset(result->eir, 0, sizeof(result->eir));
/*
* Get next report iteration by moving pointer to right offset
@ -2467,7 +2467,7 @@ static int hci_id_add(const bt_addr_le_t *addr, u8_t val[16])
#if defined(CONFIG_BT_PRIVACY)
memcpy(cp->local_irk, bt_dev.irk, 16);
#else
memset(cp->local_irk, 0, 16);
(void)memset(cp->local_irk, 0, 16);
#endif
return bt_hci_cmd_send_sync(BT_HCI_OP_LE_ADD_DEV_TO_RL, buf, NULL);
@ -2891,8 +2891,8 @@ static void le_ltk_request(struct net_buf *buf)
memcpy(cp->ltk, conn->le.keys->ltk.val,
conn->le.keys->enc_size);
if (conn->le.keys->enc_size < sizeof(cp->ltk)) {
memset(cp->ltk + conn->le.keys->enc_size, 0,
sizeof(cp->ltk) - conn->le.keys->enc_size);
(void)memset(cp->ltk + conn->le.keys->enc_size, 0,
sizeof(cp->ltk) - conn->le.keys->enc_size);
}
bt_hci_cmd_send(BT_HCI_OP_LE_LTK_REQ_REPLY, buf);
@ -2917,8 +2917,8 @@ static void le_ltk_request(struct net_buf *buf)
memcpy(cp->ltk, conn->le.keys->slave_ltk.val,
conn->le.keys->enc_size);
if (conn->le.keys->enc_size < sizeof(cp->ltk)) {
memset(cp->ltk + conn->le.keys->enc_size, 0,
sizeof(cp->ltk) - conn->le.keys->enc_size);
(void)memset(cp->ltk + conn->le.keys->enc_size, 0,
sizeof(cp->ltk) - conn->le.keys->enc_size);
}
bt_hci_cmd_send(BT_HCI_OP_LE_LTK_REQ_REPLY, buf);
@ -3058,7 +3058,7 @@ static int start_le_scan(u8_t scan_type, u16_t interval, u16_t window)
struct net_buf *buf;
int err;
memset(&set_param, 0, sizeof(set_param));
(void)memset(&set_param, 0, sizeof(set_param));
set_param.scan_type = scan_type;
@ -4741,7 +4741,7 @@ static int set_ad(u16_t hci_op, const struct bt_ad *ad, size_t ad_len)
set_data = net_buf_add(buf, sizeof(*set_data));
memset(set_data, 0, sizeof(*set_data));
(void)memset(set_data, 0, sizeof(*set_data));
for (c = 0; c < ad_len; c++) {
const struct bt_data *data = ad[c].data;
@ -5009,7 +5009,7 @@ int bt_id_delete(u8_t id)
}
#if defined(CONFIG_BT_PRIVACY)
memset(bt_dev.irk[id], 0, 16);
(void)memset(bt_dev.irk[id], 0, 16);
#endif
bt_addr_le_copy(&bt_dev.id_addr[id], BT_ADDR_LE_ANY);
@ -5153,7 +5153,7 @@ int bt_le_adv_start_internal(const struct bt_le_adv_param *param,
}
}
memset(&set_param, 0, sizeof(set_param));
(void)memset(&set_param, 0, sizeof(set_param));
set_param.min_interval = sys_cpu_to_le16(param->interval_min);
set_param.max_interval = sys_cpu_to_le16(param->interval_max);
@ -5482,7 +5482,7 @@ int bt_br_discovery_start(const struct bt_br_discovery_param *param,
atomic_set_bit(bt_dev.flags, BT_DEV_INQUIRY);
memset(results, 0, sizeof(*results) * cnt);
(void)memset(results, 0, sizeof(*results) * cnt);
discovery_cb = cb;
discovery_results = results;

View file

@ -144,7 +144,7 @@ static void emulate_le_p256_public_key_cmd(void)
evt->status = status;
if (status) {
memset(evt->key, 0, sizeof(evt->key));
(void)memset(evt->key, 0, sizeof(evt->key));
} else {
/* Convert X and Y coordinates from big-endian (provided
* by crypto API) to little endian HCI.
@ -188,7 +188,7 @@ static void emulate_le_generate_dhkey(void)
if (ret == TC_CRYPTO_FAIL) {
evt->status = BT_HCI_ERR_UNSPECIFIED;
memset(evt->dhkey, 0, sizeof(evt->dhkey));
(void)memset(evt->dhkey, 0, sizeof(evt->dhkey));
} else {
evt->status = 0;
/* Convert from big-endian (provided by crypto API) to

View file

@ -202,7 +202,7 @@ void bt_keys_clear(struct bt_keys *keys)
settings_save_one(key, NULL);
}
memset(keys, 0, sizeof(*keys));
(void)memset(keys, 0, sizeof(*keys));
}
static void keys_clear_id(struct bt_keys *keys, void *data)
@ -285,7 +285,7 @@ static int keys_set(int argc, char **argv, char *val)
if (!val) {
keys = bt_keys_find(BT_KEYS_ALL, id, &addr);
if (keys) {
memset(keys, 0, sizeof(*keys));
(void)memset(keys, 0, sizeof(*keys));
BT_DBG("Cleared keys for %s", bt_addr_le_str(&addr));
} else {
BT_WARN("Unable to find deleted keys for %s",

View file

@ -67,7 +67,7 @@ void bt_keys_link_key_clear(struct bt_keys_link_key *link_key)
{
BT_DBG("%s", bt_addr_str(&link_key->addr));
memset(link_key, 0, sizeof(*link_key));
(void)memset(link_key, 0, sizeof(*link_key));
}
void bt_keys_link_key_clear_addr(const bt_addr_t *addr)
@ -75,7 +75,7 @@ void bt_keys_link_key_clear_addr(const bt_addr_t *addr)
struct bt_keys_link_key *key;
if (!addr) {
memset(key_pool, 0, sizeof(key_pool));
(void)memset(key_pool, 0, sizeof(key_pool));
return;
}

View file

@ -671,7 +671,7 @@ static void l2cap_chan_tx_init(struct bt_l2cap_le_chan *chan)
{
BT_DBG("chan %p", chan);
memset(&chan->tx, 0, sizeof(chan->tx));
(void)memset(&chan->tx, 0, sizeof(chan->tx));
k_sem_init(&chan->tx.credits, 0, UINT_MAX);
k_fifo_init(&chan->tx_queue);
}
@ -752,7 +752,7 @@ static void le_conn_req(struct bt_l2cap *l2cap, u8_t ident,
sizeof(*rsp));
rsp = net_buf_add(buf, sizeof(*rsp));
memset(rsp, 0, sizeof(*rsp));
(void)memset(rsp, 0, sizeof(*rsp));
/* Check if there is a server registered */
server = l2cap_server_lookup_psm(psm);

View file

@ -430,7 +430,7 @@ static int l2cap_br_info_req(struct bt_l2cap_br *l2cap, u8_t ident,
rsp->type = sys_cpu_to_le16(BT_L2CAP_INFO_FIXED_CHAN);
rsp->result = sys_cpu_to_le16(BT_L2CAP_INFO_SUCCESS);
/* fixed channel mask protocol data is 8 octets wide */
memset(net_buf_add(rsp_buf, 8), 0, 8);
(void)memset(net_buf_add(rsp_buf, 8), 0, 8);
rsp->data[0] = get_fixed_channels_mask();
hdr_info->len = sys_cpu_to_le16(sizeof(*rsp) + 8);
@ -519,7 +519,7 @@ static void l2cap_br_conf(struct bt_l2cap_chan *chan)
hdr->code = BT_L2CAP_CONF_REQ;
hdr->ident = l2cap_br_get_ident();
conf = net_buf_add(buf, sizeof(*conf));
memset(conf, 0, sizeof(*conf));
(void)memset(conf, 0, sizeof(*conf));
conf->dcid = sys_cpu_to_le16(BR_CHAN(chan)->tx.cid);
/*
@ -1009,7 +1009,7 @@ send_rsp:
hdr->code = BT_L2CAP_CONF_RSP;
hdr->ident = ident;
rsp = net_buf_add(buf, sizeof(*rsp));
memset(rsp, 0, sizeof(*rsp));
(void)memset(rsp, 0, sizeof(*rsp));
rsp->result = sys_cpu_to_le16(result);
rsp->scid = sys_cpu_to_le16(BR_CHAN(chan)->tx.cid);

View file

@ -221,7 +221,7 @@ struct net_buf *bt_mesh_adv_create_from_pool(struct net_buf_pool *pool,
adv = get_id(net_buf_id(buf));
BT_MESH_ADV(buf) = adv;
memset(adv, 0, sizeof(*adv));
(void)memset(adv, 0, sizeof(*adv));
adv->type = type;
adv->xmit = xmit;

View file

@ -556,7 +556,7 @@ void bt_mesh_app_key_del(struct bt_mesh_app_key *key, bool store)
}
key->net_idx = BT_MESH_KEY_UNUSED;
memset(key->keys, 0, sizeof(key->keys));
(void)memset(key->keys, 0, sizeof(key->keys));
}
static void app_key_del(struct bt_mesh_model *model,
@ -1020,7 +1020,7 @@ static void send_mod_pub_status(struct bt_mesh_model *cfg_mod,
net_buf_simple_add_le16(&msg, elem_addr);
if (status != STATUS_SUCCESS) {
memset(net_buf_simple_add(&msg, 7), 0, 7);
(void)memset(net_buf_simple_add(&msg, 7), 0, 7);
} else {
u16_t idx_cred;
@ -1230,7 +1230,7 @@ static void mod_sub_list_clear(struct bt_mesh_model *mod)
}
/* Clear all subscriptions (0x0000 is the unassigned address) */
memset(mod->groups, 0, sizeof(mod->groups));
(void)memset(mod->groups, 0, sizeof(mod->groups));
}
static void mod_pub_va_set(struct bt_mesh_model *model,
@ -1305,7 +1305,7 @@ send_status:
static void mod_sub_list_clear(struct bt_mesh_model *mod)
{
/* Clear all subscriptions (0x0000 is the unassigned address) */
memset(mod->groups, 0, sizeof(mod->groups));
(void)memset(mod->groups, 0, sizeof(mod->groups));
}
static void mod_pub_va_set(struct bt_mesh_model *model,
@ -3360,7 +3360,7 @@ void bt_mesh_cfg_reset(void)
bt_mesh_model_foreach(mod_reset, NULL);
memset(labels, 0, sizeof(labels));
(void)memset(labels, 0, sizeof(labels));
}
void bt_mesh_heartbeat(u16_t src, u16_t dst, u8_t hops, u16_t feat)
@ -3527,6 +3527,6 @@ void bt_mesh_subnet_del(struct bt_mesh_subnet *sub, bool store)
bt_mesh_clear_subnet(sub);
}
memset(sub, 0, sizeof(*sub));
(void)memset(sub, 0, sizeof(*sub));
sub->net_idx = BT_MESH_KEY_UNUSED;
}

View file

@ -191,7 +191,7 @@ static void friend_clear(struct bt_mesh_friend *frnd)
frnd->fsn = 0;
frnd->queue_size = 0;
frnd->pending_req = 0;
memset(frnd->sub_list, 0, sizeof(frnd->sub_list));
(void)memset(frnd->sub_list, 0, sizeof(frnd->sub_list));
}
void bt_mesh_friend_clear_net_idx(u16_t net_idx)

View file

@ -111,7 +111,7 @@ void bt_mesh_reset(void)
bt_mesh_clear_net();
}
memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key));
(void)memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key));
bt_mesh_scan_disable();
bt_mesh_beacon_disable();

View file

@ -341,7 +341,7 @@ void friend_cred_clear(struct friend_cred *cred)
cred->addr = BT_MESH_ADDR_UNASSIGNED;
cred->lpn_counter = 0;
cred->frnd_counter = 0;
memset(cred->cred, 0, sizeof(cred->cred));
(void)memset(cred->cred, 0, sizeof(cred->cred));
}
int friend_cred_del(u16_t net_idx, u16_t addr)
@ -451,7 +451,7 @@ int bt_mesh_net_create(u16_t idx, u8_t flags, const u8_t key[16],
return -EALREADY;
}
memset(msg_cache, 0, sizeof(msg_cache));
(void)memset(msg_cache, 0, sizeof(msg_cache));
msg_cache_next = 0;
sub = &bt_mesh.sub[0];
@ -571,7 +571,7 @@ void bt_mesh_rpl_reset(void)
if (rpl->src) {
if (rpl->old_iv) {
memset(rpl, 0, sizeof(*rpl));
(void)memset(rpl, 0, sizeof(*rpl));
} else {
rpl->old_iv = true;
}
@ -654,7 +654,7 @@ bool bt_mesh_net_iv_update(u32_t iv_index, bool iv_update)
if (iv_index > bt_mesh.iv_index + 1) {
BT_WARN("Performing IV Index Recovery");
memset(bt_mesh.rpl, 0, sizeof(bt_mesh.rpl));
(void)memset(bt_mesh.rpl, 0, sizeof(bt_mesh.rpl));
bt_mesh.iv_index = iv_index;
bt_mesh.seq = 0;
goto do_update;

View file

@ -238,7 +238,7 @@ static void reset_link(void)
}
/* Clear everything except the retransmit delayed work config */
memset(&link, 0, offsetof(struct prov_link, tx.retransmit));
(void)memset(&link, 0, offsetof(struct prov_link, tx.retransmit));
link.rx.prev_id = XACT_NVAL;
@ -603,7 +603,7 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
return -EINVAL;
}
memset(link.auth, 0, sizeof(link.auth));
(void)memset(link.auth, 0, sizeof(link.auth));
return 0;
case AUTH_METHOD_STATIC:
if (action || size) {
@ -612,7 +612,8 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
memcpy(link.auth + 16 - prov->static_val_len,
prov->static_val, prov->static_val_len);
memset(link.auth, 0, sizeof(link.auth) - prov->static_val_len);
(void)memset(link.auth, 0,
sizeof(link.auth) - prov->static_val_len);
return 0;
case AUTH_METHOD_OUTPUT:
@ -647,7 +648,8 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
str[size] = '\0';
memcpy(link.auth, str, size);
memset(link.auth + size, 0, sizeof(link.auth) - size);
(void)memset(link.auth + size, 0,
sizeof(link.auth) - size);
return prov->output_string((char *)str);
} else {
@ -659,7 +661,7 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
num %= div[size - 1];
sys_put_be32(num, &link.auth[12]);
memset(link.auth, 0, 12);
(void)memset(link.auth, 0, 12);
return prov->output_number(output, num);
}
@ -1540,7 +1542,7 @@ int bt_mesh_pb_gatt_close(struct bt_conn *conn)
bt_conn_unref(link.conn);
pub_key = atomic_test_bit(link.flags, LOCAL_PUB_KEY);
memset(&link, 0, sizeof(link));
(void)memset(&link, 0, sizeof(link));
if (pub_key) {
atomic_set_bit(link.flags, LOCAL_PUB_KEY);

View file

@ -141,11 +141,11 @@ static int filter_set(struct bt_mesh_proxy_client *client,
switch (type) {
case 0x00:
memset(client->filter, 0, sizeof(client->filter));
(void)memset(client->filter, 0, sizeof(client->filter));
client->filter_type = WHITELIST;
break;
case 0x01:
memset(client->filter, 0, sizeof(client->filter));
(void)memset(client->filter, 0, sizeof(client->filter));
client->filter_type = BLACKLIST;
break;
default:
@ -544,7 +544,7 @@ static void proxy_connected(struct bt_conn *conn, u8_t err)
client->conn = bt_conn_ref(conn);
client->filter_type = NONE;
memset(client->filter, 0, sizeof(client->filter));
(void)memset(client->filter, 0, sizeof(client->filter));
net_buf_simple_reset(&client->buf);
}
@ -998,7 +998,7 @@ static int node_id_adv(struct bt_mesh_subnet *sub)
return err;
}
memset(tmp, 0, 6);
(void)memset(tmp, 0, 6);
memcpy(tmp + 6, proxy_svc_data + 11, 8);
sys_put_be16(bt_mesh_primary_addr(), tmp + 14);

View file

@ -133,7 +133,7 @@ static int net_set(int argc, char **argv, char *val)
if (!val) {
bt_mesh_comp_unprovision();
memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key));
(void)memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key));
return 0;
}
@ -281,7 +281,7 @@ static int rpl_set(int argc, char **argv, char *val)
if (!val) {
if (entry) {
memset(entry, 0, sizeof(*entry));
(void)memset(entry, 0, sizeof(*entry));
} else {
BT_WARN("Unable to find RPL entry for 0x%04x", src);
}
@ -564,7 +564,7 @@ static int mod_set_sub(struct bt_mesh_model *mod, char *val)
int len, err;
/* Start with empty array regardless of cleared or set value */
memset(mod->groups, 0, sizeof(mod->groups));
(void)memset(mod->groups, 0, sizeof(mod->groups));
if (!val) {
BT_DBG("Cleared subscriptions for model");
@ -738,7 +738,7 @@ static int subnet_init(struct bt_mesh_subnet *sub)
err = bt_mesh_net_keys_create(&sub->keys[1], sub->keys[1].net);
if (err) {
BT_ERR("Unable to generate keys for subnet");
memset(&sub->keys[0], 0, sizeof(sub->keys[0]));
(void)memset(&sub->keys[0], 0, sizeof(sub->keys[0]));
return -EIO;
}
}
@ -996,7 +996,7 @@ static void clear_rpl(void)
snprintk(path, sizeof(path), "bt/mesh/RPL/%x", rpl->src);
settings_save_one(path, NULL);
memset(rpl, 0, sizeof(*rpl));
(void)memset(rpl, 0, sizeof(*rpl));
}
}

Some files were not shown because too many files have changed in this diff Show more