Skip to content

Commit 59c9d77

Browse files
author
Kimmo Vaisanen
committed
Astyle fix
1 parent 48250c6 commit 59c9d77

File tree

2 files changed

+15
-28
lines changed

2 files changed

+15
-28
lines changed

features/cellular/framework/targets/Samsung/TARGET_S5JS100/SAMSUNG_S5JS100_L3IP_Driver.cpp

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define S5JS100_BUFF_ALIGNMENT 0
2626

2727

28-
SAMSUNG_S5JS100_L3IP_Driver::SAMSUNG_S5JS100_L3IP_Driver(const char* ifname, int mtu)
28+
SAMSUNG_S5JS100_L3IP_Driver::SAMSUNG_S5JS100_L3IP_Driver(const char *ifname, int mtu)
2929
: _io_device(NULL),
3030
_mtu(mtu)
3131
{
@@ -49,31 +49,26 @@ bool SAMSUNG_S5JS100_L3IP_Driver::link_out(net_stack_mem_buf_t *buf)
4949
const int total_len = _memory_manager->get_total_len(buf);
5050
net_stack_mem_buf_t *cont_buf = _memory_manager->alloc_heap(total_len, S5JS100_BUFF_ALIGNMENT);
5151

52-
if (cont_buf)
53-
{
52+
if (cont_buf) {
5453
uint8_t *cont_buf_ptr = (uint8_t *)_memory_manager->get_ptr(cont_buf);
5554

5655
/* copy all frames to continuous buffer */
57-
for (net_stack_mem_buf_t *q = buf; q != NULL; q = _memory_manager->get_next(q))
58-
{
56+
for (net_stack_mem_buf_t *q = buf; q != NULL; q = _memory_manager->get_next(q)) {
5957
const uint8_t *ptr = (const uint8_t *)_memory_manager->get_ptr(q);
6058
const uint16_t len = _memory_manager->get_len(q);
6159

6260
memcpy(cont_buf_ptr, ptr, len);
6361
cont_buf_ptr += len;
6462
}
6563

66-
const int sent = _io_device->write((const char*)_memory_manager->get_ptr(cont_buf), total_len);
64+
const int sent = _io_device->write((const char *)_memory_manager->get_ptr(cont_buf), total_len);
6765
tr_debug("link_out (%s): sent %d/%d bytes", _ifname, sent, total_len);
68-
if (sent != total_len)
69-
{
66+
if (sent != total_len) {
7067
result = false;
7168
}
7269

7370
_memory_manager->free(cont_buf);
74-
}
75-
else
76-
{
71+
} else {
7772
tr_error("Unable to allocate buffer for TX data!");
7873
result = false;
7974
}
@@ -87,14 +82,11 @@ bool SAMSUNG_S5JS100_L3IP_Driver::power_up()
8782
{
8883
_io_device = getModemIoDeviceByName(_ifname);
8984
tr_debug("power_up: io_device = %p", _io_device);
90-
if (_io_device)
91-
{
85+
if (_io_device) {
9286
_io_device->register_ReadCb(read_cb, this);
9387
_l3ip_link_state_cb(true);
9488
return true;
95-
}
96-
else
97-
{
89+
} else {
9890
tr_error("Unable to get modem IO device!");
9991
return false;
10092
}
@@ -150,8 +142,7 @@ void SAMSUNG_S5JS100_L3IP_Driver::set_all_multicast(bool all)
150142
void SAMSUNG_S5JS100_L3IP_Driver::power_down()
151143
{
152144
tr_debug("power_down");
153-
if (_io_device)
154-
{
145+
if (_io_device) {
155146
_io_device->register_ReadCb(NULL, NULL);
156147
_io_device = NULL;
157148
}
@@ -167,22 +158,19 @@ void SAMSUNG_S5JS100_L3IP_Driver::read_cb(mio_buf *buf, void *param)
167158
MBED_ASSERT(buf);
168159
MBED_ASSERT(param);
169160

170-
SAMSUNG_S5JS100_L3IP_Driver *driver = (SAMSUNG_S5JS100_L3IP_Driver*)param;
161+
SAMSUNG_S5JS100_L3IP_Driver *driver = (SAMSUNG_S5JS100_L3IP_Driver *)param;
171162
driver->packet_rx(buf);
172163
}
173164

174-
void SAMSUNG_S5JS100_L3IP_Driver::packet_rx(mio_buf * buf)
165+
void SAMSUNG_S5JS100_L3IP_Driver::packet_rx(mio_buf *buf)
175166
{
176167
tr_debug("packet_rx (%s): buf = %p, len = %d, ch = %d", _ifname, buf->data, buf->len, buf->ch);
177168

178169
net_stack_mem_buf_t *read_buf = _memory_manager->alloc_heap(buf->len, S5JS100_BUFF_ALIGNMENT);
179-
if (read_buf)
180-
{
170+
if (read_buf) {
181171
_memory_manager->copy_to_buf(read_buf, buf->data, buf->len);
182172
_l3ip_link_input_cb(read_buf);
183-
}
184-
else
185-
{
173+
} else {
186174
tr_error("Unable to allocate buffer for RX data!");
187175
}
188176
}

features/cellular/framework/targets/Samsung/TARGET_S5JS100/SAMSUNG_S5JS100_L3IP_Driver.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#include "L3IP.h"
2222
#include "modem_io_device.h"
2323

24-
class SAMSUNG_S5JS100_L3IP_Driver : public L3IP
25-
{
24+
class SAMSUNG_S5JS100_L3IP_Driver : public L3IP {
2625

2726
public:
2827

@@ -151,7 +150,7 @@ class SAMSUNG_S5JS100_L3IP_Driver : public L3IP
151150
l3ip_link_state_change_cb_t _l3ip_link_state_cb; /**< Link state change callback */
152151
NetStackMemoryManager *_memory_manager; /**< Memory manager */
153152

154-
ModemIoDevice* _io_device; /**< Handle to modem */
153+
ModemIoDevice *_io_device; /**< Handle to modem */
155154
char _ifname[32]; /**< Interface name */
156155
int _mtu; /**< MTU */
157156
};

0 commit comments

Comments
 (0)