Skip to content

Commit f8ab455

Browse files
committed
Trivial: style
Signed-off-by: Lucy <[email protected]>
1 parent 555485b commit f8ab455

File tree

12 files changed

+50
-205
lines changed

12 files changed

+50
-205
lines changed

.github/workflows/push.yml

-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: seL4/ci-actions/style@master
34-
with:
35-
diff_only: true

.github/workflows/trigger.yml

-19
This file was deleted.

CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ add_subdirectory(libvswitch)
1717
add_subdirectory(libfdtgen)
1818
add_subdirectory(libtx2bpmp)
1919
add_subdirectory(libplatsupportports)
20-
add_subdirectory(libsharedringbuffer)

libsharedringbuffer/CMakeLists.txt

-26
This file was deleted.

libsharedringbuffer/README.md

-66
This file was deleted.

libsharedringbuffer/include/shared_ringbuffer/shared_ringbuffer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static inline int dequeue_used(ring_handle_t *ring, uintptr_t *addr, size_t *len
211211
/**
212212
* Dequeue an element from a ring buffer.
213213
* This function is intended for use by the driver, to collect a pointer
214-
* into this structure to be passed around as a cookie.
214+
* into this structure to be passed around as a cookie.
215215
*
216216
* @param ring Ring buffer to dequeue from.
217217
* @param addr pointer to the address of where to store buffer address.

libsharedringbuffer/src/shared_ringbuffer.c

-20
This file was deleted.

libusbdrivers/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,4 @@ if(LibUSB)
2828
add_library(usbdrivers STATIC EXCLUDE_FROM_ALL ${deps})
2929
target_include_directories(usbdrivers PUBLIC include plat_include/${KernelPlatform})
3030
target_link_libraries(usbdrivers sel4 muslc platsupport usbdrivers_Config lwip_Config)
31-
if(LibLwip)
32-
target_link_libraries(usbdrivers lwip)
33-
endif()
3431
endif()

libusbdrivers/src/drivers/lan9730.c

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include <netif/etharp.h>
2424
#include <lwip/stats.h>
25-
#include <lwip/snmp.h>
2625

2726
#include "../services.h"
2827

libusbdrivers/src/services.h

+45-44
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
*/
66
#pragma once
77

8-
#include <platsupport/delay.h>
9-
#include <platsupport/io.h>
108
#include <stdlib.h>
11-
#include <usb/usb_host.h>
9+
#include <platsupport/io.h>
10+
#include <platsupport/delay.h>
1211
#include <utils/ansi.h>
1312
#include <utils/util.h>
1413
#include <utils/zf_log.h>
14+
#include <usb/usb_host.h>
1515

1616
void otg_irq(void);
1717

@@ -21,64 +21,65 @@ void otg_irq(void);
2121
extern ps_malloc_ops_t *ps_malloc_ops;
2222
static inline void *usb_malloc(size_t size)
2323
{
24-
int ret;
24+
int ret;
2525

26-
if (ps_malloc_ops && ps_malloc_ops->calloc) {
27-
void *ptr;
28-
ret = ps_calloc(ps_malloc_ops, 1, size, &ptr);
29-
if (0 != ret) {
30-
ZF_LOGF("Malloc error %d\n", ret);
31-
}
32-
return ptr;
33-
} else {
34-
return calloc(1, size);
35-
}
26+
if (ps_malloc_ops && ps_malloc_ops->calloc) {
27+
void *ptr;
28+
ret = ps_calloc(ps_malloc_ops, 1, size, &ptr);
29+
if (!ret) {
30+
ZF_LOGF("Malloc error\n");
31+
}
32+
return ptr;
33+
} else {
34+
return calloc(1, size);
35+
}
3636
}
3737

3838
static inline void usb_free(void *ptr)
3939
{
40-
int ret;
40+
int ret;
4141

42-
if (ps_malloc_ops && ps_malloc_ops->free) {
43-
ret = ps_free(ps_malloc_ops, 1, ptr);
44-
if (!ret) {
45-
ZF_LOGF("Free error\n");
46-
}
47-
} else {
48-
free(ptr);
49-
}
42+
if (ps_malloc_ops && ps_malloc_ops->free) {
43+
ret = ps_free(ps_malloc_ops, 1, ptr);
44+
if (!ret) {
45+
ZF_LOGF("Free error\n");
46+
}
47+
} else {
48+
free(ptr);
49+
}
5050
}
5151

5252
static inline void dsb()
5353
{
5454
#ifdef ARCH_ARM
55-
asm volatile("dsb");
55+
asm volatile("dsb");
5656
#else
57-
asm volatile("" ::
58-
: "memory");
57+
asm volatile ("" ::: "memory");
5958
#endif
6059
}
6160

62-
static inline void *ps_dma_alloc_pinned(ps_dma_man_t *dma_man, size_t size,
63-
int align, int cache,
64-
ps_mem_flags_t flags, uintptr_t *paddr)
61+
static inline void *ps_dma_alloc_pinned(ps_dma_man_t * dma_man, size_t size,
62+
int align, int cache,
63+
ps_mem_flags_t flags, uintptr_t * paddr)
6564
{
66-
void *addr;
67-
if (!dma_man) {
68-
ZF_LOGF("Invalid arguments\n");
69-
}
70-
addr = ps_dma_alloc(dma_man, size, align, cache, flags);
71-
if (addr != NULL) {
72-
*paddr = ps_dma_pin(dma_man, addr, size);
73-
}
74-
return addr;
65+
void *addr;
66+
if (!dma_man) {
67+
ZF_LOGF("Invalid arguments\n");
68+
}
69+
addr = ps_dma_alloc(dma_man, size, align, cache, flags);
70+
if (addr != NULL) {
71+
*paddr = ps_dma_pin(dma_man, addr, size);
72+
}
73+
return addr;
7574
}
7675

77-
static inline void ps_dma_free_pinned(ps_dma_man_t *dma_man, void *addr, size_t size)
76+
static inline void
77+
ps_dma_free_pinned(ps_dma_man_t * dma_man, void *addr, size_t size)
7878
{
79-
if (!dma_man) {
80-
ZF_LOGF("Invalid arguments\n");
81-
}
82-
ps_dma_unpin(dma_man, addr, size);
83-
ps_dma_free(dma_man, addr, size);
79+
if (!dma_man) {
80+
ZF_LOGF("Invalid arguments\n");
81+
}
82+
ps_dma_unpin(dma_man, addr, size);
83+
ps_dma_free(dma_man, addr, size);
8484
}
85+

libvswitch/include/vswitch.h

+4-18
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,26 @@ typedef struct vswitch_virtqueues_ {
3838
virtqueue_device_t *recv_queue;
3939
} vswitch_virtqueues_t;
4040

41-
extern struct ether_addr null_macaddr, bcast_macaddr, ipv6_multicast_macaddr;
41+
extern struct ether_addr null_macaddr, bcast_macaddr;
4242

4343
static inline bool
44-
mac802_addr_eq_num(struct ether_addr *addr0,
45-
struct ether_addr *addr1, unsigned int num)
44+
mac802_addr_eq(struct ether_addr *addr0,
45+
struct ether_addr *addr1)
4646
{
47-
assert(num <= ETH_ALEN);
48-
for (int i = 0; i < num; i++) {
47+
for (int i = 0; i < ETH_ALEN; i++) {
4948
if (addr0->ether_addr_octet[i] != addr1->ether_addr_octet[i]) {
5049
return false;
5150
}
5251
}
5352
return true;
5453
}
5554

56-
static inline bool
57-
mac802_addr_eq(struct ether_addr *addr0,
58-
struct ether_addr *addr1)
59-
{
60-
mac802_addr_eq_num(addr0, addr1, ETH_ALEN);
61-
}
62-
6355
static inline bool
6456
mac802_addr_eq_bcast(struct ether_addr *addr)
6557
{
6658
return mac802_addr_eq(addr, &bcast_macaddr);
6759
}
6860

69-
static inline bool
70-
mac802_addr_eq_ipv6_mcast(struct ether_addr *addr)
71-
{
72-
return mac802_addr_eq_num(addr, &ipv6_multicast_macaddr, 2);
73-
}
74-
7561
typedef struct vswitch_node_ {
7662
struct ether_addr addr;
7763
vswitch_virtqueues_t virtqueues;

libvswitch/src/vswitch.c

-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ struct ether_addr bcast_macaddr = { .ether_addr_octet = {
1818
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
1919
}
2020
};
21-
struct ether_addr ipv6_multicast_macaddr = { .ether_addr_octet = {
22-
0x33, 0x33, 0x0, 0x0, 0x0, 0x0
23-
}
24-
};
2521

2622
static int vswitch_find_free_slot(vswitch_t *lib)
2723
{

0 commit comments

Comments
 (0)