From b428979a1da99e4dac42688f6d3e61f7218176ed Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 27 Sep 2016 23:38:41 +0200 Subject: [PATCH] debug: add missing line breaks --- cpu/lpc2387/lpc2387-lpm.c | 2 +- cpu/native/netdev2_tap/netdev2_tap.c | 2 +- drivers/ethos/ethos.c | 4 ++-- drivers/lsm303dlhc/lsm303dlhc.c | 4 ++-- drivers/pir/pir.c | 1 + drivers/srf08/srf08.c | 6 +++--- pkg/nordic_softdevice_ble/src/ble-core.c | 14 ++++++++------ pkg/nordic_softdevice_ble/src/ble-mac.c | 4 ++-- .../patches/0002-Add-RIOT-adaption.patch | Bin 43757 -> 43759 bytes sys/auto_init/netif/auto_init_cc110x.c | 4 ++-- sys/auto_init/netif/auto_init_kw2xrf.c | 2 +- sys/auto_init/netif/auto_init_xbee.c | 2 +- sys/cbor/cbor.c | 5 +++-- sys/crypto/modes/ccm.c | 2 +- .../gnrc/application_layer/tftp/gnrc_tftp.c | 18 +++++++++--------- .../link_layer/netdev2/gnrc_netdev2_eth.c | 2 +- sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c | 2 +- .../ipv6/netif/gnrc_ipv6_netif.c | 2 +- sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c | 6 +++--- 19 files changed, 43 insertions(+), 39 deletions(-) diff --git a/cpu/lpc2387/lpc2387-lpm.c b/cpu/lpc2387/lpc2387-lpm.c index ba358171c..d1cc9f258 100644 --- a/cpu/lpc2387/lpc2387-lpm.c +++ b/cpu/lpc2387/lpc2387-lpm.c @@ -103,7 +103,7 @@ enum lpm_mode lpm_set(enum lpm_mode target) lpm = target; - DEBUG("# LPM power down %u -> %u", lpm, target); + DEBUG("# LPM power down %u -> %u\n", lpm, target); PCON |= target_flags; // set target power mode return last_lpm; diff --git a/cpu/native/netdev2_tap/netdev2_tap.c b/cpu/native/netdev2_tap/netdev2_tap.c index 7dc21ab8c..ec56cce4e 100644 --- a/cpu/native/netdev2_tap/netdev2_tap.c +++ b/cpu/native/netdev2_tap/netdev2_tap.c @@ -275,7 +275,7 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info) } } else if (nread == 0) { - DEBUG("_native_handle_tap_input: ignoring null-event"); + DEBUG("_native_handle_tap_input: ignoring null-event\n"); } else { errx(EXIT_FAILURE, "internal error _rx_event"); diff --git a/drivers/ethos/ethos.c b/drivers/ethos/ethos.c index 5703b5b65..698a365d7 100644 --- a/drivers/ethos/ethos.c +++ b/drivers/ethos/ethos.c @@ -299,7 +299,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void* info) if (buf) { if (len < (int)dev->last_framesize) { - DEBUG("ethos _recv(): receive buffer too small."); + DEBUG("ethos _recv(): receive buffer too small.\n"); return -1; } @@ -307,7 +307,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void* info) dev->last_framesize = 0; if ((tsrb_get(&dev->inbuf, buf, len) != len)) { - DEBUG("ethos _recv(): inbuf doesn't contain enough bytes."); + DEBUG("ethos _recv(): inbuf doesn't contain enough bytes.\n"); return -1; } diff --git a/drivers/lsm303dlhc/lsm303dlhc.c b/drivers/lsm303dlhc/lsm303dlhc.c index e8d9f9cf7..f55e0ea9a 100644 --- a/drivers/lsm303dlhc/lsm303dlhc.c +++ b/drivers/lsm303dlhc/lsm303dlhc.c @@ -48,12 +48,12 @@ int lsm303dlhc_init(lsm303dlhc_t *dev, i2c_t i2c, gpio_t acc_pin, gpio_t mag_pin i2c_acquire(dev->i2c); i2c_init_master(i2c, I2C_SPEED_NORMAL); - DEBUG("lsm303dlhc reboot "); + DEBUG("lsm303dlhc reboot..."); res = i2c_write_reg(dev->i2c, dev->acc_address, LSM303DLHC_REG_CTRL5_A, LSM303DLHC_REG_CTRL5_A_BOOT); /* Release the bus for other threads. */ i2c_release(dev->i2c); - DEBUG("[OK]"); + DEBUG("[OK]\n"); /* configure accelerometer */ /* enable all three axis and set sample rate */ diff --git a/drivers/pir/pir.c b/drivers/pir/pir.c index 2bc6ccb7d..c4b0815d1 100644 --- a/drivers/pir/pir.c +++ b/drivers/pir/pir.c @@ -93,6 +93,7 @@ static void pir_send_msg(pir_t *dev, pir_event_t event) dev->msg_thread_pid = KERNEL_PID_UNDEF; break; } + DEBUG("\n"); } static void pir_callback(void *arg) diff --git a/drivers/srf08/srf08.c b/drivers/srf08/srf08.c index 6fa82c088..2af39e217 100644 --- a/drivers/srf08/srf08.c +++ b/drivers/srf08/srf08.c @@ -107,12 +107,12 @@ int srf08_get_distances(srf08_t *dev, uint16_t *range_array, int num_echos, srf0 i2c_release(dev->i2c); if (!status) { - DEBUG("Write the ranging command to the i2c-interface is failed"); + DEBUG("Write the ranging command to the i2c-interface is failed\n"); return -1; } if(max_reg_no_read > SRF08_MAX_REGISTER_NUMBER) { - DEBUG("Too many echos requested. Max. is 17"); + DEBUG("Too many echos requested. Max. is 17\n"); return -2; } @@ -130,7 +130,7 @@ int srf08_get_distances(srf08_t *dev, uint16_t *range_array, int num_echos, srf0 i2c_release(dev->i2c); if (!status) { - DEBUG("Read the echo bytes from the i2c-interface is failed"); + DEBUG("Read the echo bytes from the i2c-interface is failed\n"); return -3; } diff --git a/pkg/nordic_softdevice_ble/src/ble-core.c b/pkg/nordic_softdevice_ble/src/ble-core.c index 7c02da95e..b076cab1a 100644 --- a/pkg/nordic_softdevice_ble/src/ble-core.c +++ b/pkg/nordic_softdevice_ble/src/ble-core.c @@ -183,12 +183,14 @@ ble_advertising_start(void) void ble_gap_addr_print(const ble_gap_addr_t *addr) { - unsigned int i; - for(i = 0; i < sizeof(addr->addr); i++) { - if(i > 0) { - DEBUG(":"); - }DEBUG("%02x", addr->addr[i]); - }DEBUG(" (%d)", addr->addr_type); + unsigned int i; + for(i = 0; i < sizeof(addr->addr); i++) { + if (i > 0) { + DEBUG(":"); + } + DEBUG("%02x", addr->addr[i]); + } + DEBUG(" (%d)\n", addr->addr_type); } /*---------------------------------------------------------------------------*/ /** diff --git a/pkg/nordic_softdevice_ble/src/ble-mac.c b/pkg/nordic_softdevice_ble/src/ble-mac.c index e77d564ec..bd8f0942b 100644 --- a/pkg/nordic_softdevice_ble/src/ble-mac.c +++ b/pkg/nordic_softdevice_ble/src/ble-mac.c @@ -96,7 +96,7 @@ static ble_mac_interface_t *ble_mac_interface_lookup(ble_ipsp_handle_t *handle) static ble_mac_interface_t *ble_mac_interface_add(uint8_t peer[8], ble_ipsp_handle_t *handle) { - DEBUG("ble_mac_interface_add()"); + DEBUG("ble_mac_interface_add()\n"); for (int i = 0; i < BLE_MAC_MAX_INTERFACE_NUM; i++) { if (interfaces[i].handle.conn_handle == 0 && interfaces[i].handle.cid == 0) { memcpy(&interfaces[i].handle, handle, sizeof(ble_ipsp_handle_t)); @@ -118,7 +118,7 @@ static ble_mac_interface_t *ble_mac_interface_add(uint8_t peer[8], */ static void ble_mac_interface_delete(ble_mac_interface_t *interface) { - DEBUG("ble_mac_interface_delete()"); + DEBUG("ble_mac_interface_delete()\n"); memset(interface, 0, sizeof(ble_mac_interface_t)); } diff --git a/pkg/openwsn/patches/0002-Add-RIOT-adaption.patch b/pkg/openwsn/patches/0002-Add-RIOT-adaption.patch index 1269fae94f7664bfefaf8756403724f6f309c2c6..943e99e3ba44e2aaf301d29ce7642eb86ebd754e 100644 GIT binary patch delta 17 YcmaERmFfLerVT}IOfh+zi`=SH08mT_2><{9 delta 14 VcmaEVmFewOrVT}In@ilPQvf_!2R{G+ diff --git a/sys/auto_init/netif/auto_init_cc110x.c b/sys/auto_init/netif/auto_init_cc110x.c index 85fa847a8..cde266beb 100644 --- a/sys/auto_init/netif/auto_init_cc110x.c +++ b/sys/auto_init/netif/auto_init_cc110x.c @@ -53,14 +53,14 @@ void auto_init_cc110x(void) DEBUG("Initializing CC110X radio at SPI_%i\n", p->spi); int res = netdev2_cc110x_setup(&cc110x_devs[i], p); if (res < 0) { - DEBUG("Error initializing CC110X radio device!"); + DEBUG("Error initializing CC110X radio device!\n"); } else { gnrc_netdev2_cc110x_init(&_gnrc_netdev2_devs[i], &cc110x_devs[i]); res = gnrc_netdev2_init(_stacks[i], CC110X_MAC_STACKSIZE, CC110X_MAC_PRIO, "cc110x", &_gnrc_netdev2_devs[i]); if (res < 0) { - DEBUG("Error starting gnrc_cc110x thread for CC110X!"); + DEBUG("Error starting gnrc_cc110x thread for CC110X!\n"); } } } diff --git a/sys/auto_init/netif/auto_init_kw2xrf.c b/sys/auto_init/netif/auto_init_kw2xrf.c index 71def82c5..cc8076488 100644 --- a/sys/auto_init/netif/auto_init_kw2xrf.c +++ b/sys/auto_init/netif/auto_init_kw2xrf.c @@ -59,7 +59,7 @@ void auto_init_kw2xrf(void) p->int_pin); if (res < 0) { - DEBUG("Error initializing KW2xrf radio device!"); + DEBUG("Error initializing KW2xrf radio device!\n"); } else { gnrc_nomac_init(_nomac_stacks[i], diff --git a/sys/auto_init/netif/auto_init_xbee.c b/sys/auto_init/netif/auto_init_xbee.c index a50adc1d8..adff72629 100644 --- a/sys/auto_init/netif/auto_init_xbee.c +++ b/sys/auto_init/netif/auto_init_xbee.c @@ -56,7 +56,7 @@ void auto_init_xbee(void) int res = xbee_init(&xbee_devs[i], (xbee_params_t*) p); if (res < 0) { - DEBUG("Error initializing XBee radio device!"); + DEBUG("Error initializing XBee radio device!\n"); } else { gnrc_nomac_init(_nomac_stacks[i], diff --git a/sys/cbor/cbor.c b/sys/cbor/cbor.c index ed6bd331b..532447884 100644 --- a/sys/cbor/cbor.c +++ b/sys/cbor/cbor.c @@ -224,6 +224,7 @@ void dump_memory(const unsigned char *data, size_t size) for (size_t i = 0; i < size; ++i) { DEBUG("%02X", data[i]); } + DEBUG("\n"); } #endif /* CBOR_NO_PRINT */ @@ -874,7 +875,7 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in offset += inner_read_bytes = cbor_stream_decode_at(stream, offset, indent + 2); if (inner_read_bytes == 0) { - DEBUG("Failed to read array item at position %d", i); + DEBUG("Failed to read array item at position %d\n", i); break; } @@ -908,7 +909,7 @@ static size_t cbor_stream_decode_at(cbor_stream_t *stream, size_t offset, int in offset += value_read_bytes = cbor_stream_decode_at(stream, offset, indent + 2); /* value */ if (key_read_bytes == 0 || value_read_bytes == 0) { - DEBUG("Failed to read key-value pair at position %d", i); + DEBUG("Failed to read key-value pair at position %d\n", i); break; } diff --git a/sys/crypto/modes/ccm.c b/sys/crypto/modes/ccm.c index a9ccc9a40..9306d67e7 100644 --- a/sys/crypto/modes/ccm.c +++ b/sys/crypto/modes/ccm.c @@ -114,7 +114,7 @@ int ccm_compute_adata_mac(cipher_t* cipher, uint8_t* auth_data, auth_data_encoded[1] = auth_data_len & 0xFF; auth_data_encoded[0] = (auth_data_len >> 8) & 0xFF; } else { - DEBUG("UNSUPPORTED Adata length"); + DEBUG("UNSUPPORTED Adata length\n"); return -1; } diff --git a/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c b/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c index f7d62acf5..c089838a7 100644 --- a/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c +++ b/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c @@ -463,7 +463,7 @@ int _tftp_server(tftp_context_t *ctxt) /* register the servers main listening port */ if (gnrc_netreg_register(GNRC_NETTYPE_UDP, &entry)) { - DEBUG("tftp: error starting server."); + DEBUG("tftp: error starting server.\n"); return TS_FAILED; } @@ -523,7 +523,7 @@ int _tftp_do_client_transfer(tftp_context_t *ctxt) gnrc_netreg_entry_t entry = { NULL, ctxt->src_port, thread_getpid() }; if (gnrc_netreg_register(GNRC_NETTYPE_UDP, &entry)) { - DEBUG("tftp: error starting server."); + DEBUG("tftp: error starting server.\n"); return TS_FAILED; } @@ -590,7 +590,7 @@ tftp_state _tftp_state_processes(tftp_context_t *ctxt, msg_t *m) } } else if (m->type != GNRC_NETAPI_MSG_TYPE_RCV) { - DEBUG("tftp: unknown message"); + DEBUG("tftp: unknown message\n"); gnrc_pktbuf_release(outbuf); return TS_BUSY; } @@ -680,7 +680,7 @@ tftp_state _tftp_state_processes(tftp_context_t *ctxt, msg_t *m) /* check if the client negotiation was successful */ if (state != TS_BUSY) { - DEBUG("tftp: not able to send ACK"); + DEBUG("tftp: not able to send ACK\n"); } return state; } break; @@ -932,7 +932,7 @@ tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len) /* down-size the packet to it's used size */ if (len > TFTP_DEFAULT_DATA_SIZE) { - DEBUG("tftp: can't reallocate to bigger packet, buffer overflowed"); + DEBUG("tftp: can't reallocate to bigger packet, buffer overflowed\n"); gnrc_pktbuf_release(buf); if (ctxt->stop_cb) { @@ -944,7 +944,7 @@ tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len) else if (gnrc_pktbuf_realloc_data(buf, len) != 0) { assert(false); - DEBUG("tftp: failed to reallocate data snippet"); + DEBUG("tftp: failed to reallocate data snippet\n"); gnrc_pktbuf_release(buf); /* inform the user that we can't reallocate */ @@ -960,7 +960,7 @@ tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len) dst_port.u16 = ctxt->dst_port; udp = gnrc_udp_hdr_build(buf, src_port.u16, dst_port.u16); if (udp == NULL) { - DEBUG("tftp: error unable to allocate UDP header"); + DEBUG("tftp: error unable to allocate UDP header\n"); gnrc_pktbuf_release(buf); if (ctxt->stop_cb) { @@ -973,7 +973,7 @@ tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len) /* allocate IPv6 header */ ip = gnrc_ipv6_hdr_build(udp, NULL, &(ctxt->peer)); if (ip == NULL) { - DEBUG("tftp: error unable to allocate IPv6 header"); + DEBUG("tftp: error unable to allocate IPv6 header\n"); gnrc_pktbuf_release(udp); if (ctxt->stop_cb) { @@ -987,7 +987,7 @@ tftp_state _tftp_send(gnrc_pktsnip_t *buf, tftp_context_t *ctxt, size_t len) if (gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip) == 0) { /* if send failed inform the user */ - DEBUG("tftp: error unable to locate UDP thread"); + DEBUG("tftp: error unable to locate UDP thread\n"); gnrc_pktbuf_release(ip); if (ctxt->stop_cb) { diff --git a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_eth.c b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_eth.c index bf7b0dd72..7c779c5f3 100644 --- a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_eth.c +++ b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_eth.c @@ -145,7 +145,7 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt) netdev2_t *dev = gnrc_netdev2->dev; if (pkt == NULL) { - DEBUG("gnrc_netdev2_eth: pkt was NULL"); + DEBUG("gnrc_netdev2_eth: pkt was NULL\n"); return -EINVAL; } diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index 7a76c74c4..ebb285c81 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -391,7 +391,7 @@ static void _send_to_iface(kernel_pid_t iface, gnrc_pktsnip_t *pkt) if (if_entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) { DEBUG("ipv6: send to 6LoWPAN instead\n"); if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_SIXLOWPAN, GNRC_NETREG_DEMUX_CTX_ALL, pkt)) { - DEBUG("ipv6: no 6LoWPAN thread found"); + DEBUG("ipv6: no 6LoWPAN thread found\n"); gnrc_pktbuf_release(pkt); } return; diff --git a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c index 4e55779ae..154fe4cc4 100644 --- a/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c +++ b/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c @@ -73,7 +73,7 @@ static ipv6_addr_t *_add_addr_to_entry(gnrc_ipv6_netif_t *entry, const ipv6_addr } if (!tmp_addr) { - DEBUG("ipv6 netif: couldn't add %s/%" PRIu8 " to interface %" PRIkernel_pid "\n: No space left.", + DEBUG("ipv6 netif: couldn't add %s/%" PRIu8 " to interface %" PRIkernel_pid "\n: No space left.\n", ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)), prefix_len, entry->pid); return NULL; diff --git a/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c b/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c index b1b5cc468..179345118 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c @@ -401,16 +401,16 @@ gnrc_rpl_instance_t *gnrc_rpl_root_instance_init(uint8_t instance_id, ipv6_addr_ inst->max_rank_inc = GNRC_RPL_DEFAULT_MAX_RANK_INCREASE; } else if (inst == NULL) { - DEBUG("RPL: could not allocate memory for a new instance with id %d", instance_id); + DEBUG("RPL: could not allocate memory for a new instance with id %d\n", instance_id); return NULL; } else { - DEBUG("RPL: instance (%d) exists", instance_id); + DEBUG("RPL: instance (%d) exists\n", instance_id); return NULL; } if (!gnrc_rpl_dodag_init(inst, dodag_id, iface, netif_addr)) { - DEBUG("RPL: could not initialize DODAG"); + DEBUG("RPL: could not initialize DODAG\n"); gnrc_rpl_instance_remove(inst); return NULL; }