Skip to content

Commit

Permalink
libplatsupport: fix style issues
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
Axel Heider committed May 23, 2023
1 parent 2dc6839 commit bff3298
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions libplatsupport/src/plat/fvp/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int uart_getchar(ps_chardevice_t *d)
return ch;
}

int uart_putchar(ps_chardevice_t* d, int c)
int uart_putchar(ps_chardevice_t *d, int c)
{
while ((*REG_PTR(d->vaddr, UARTFR) & PL011_UARTFR_TXFF) != 0);

Expand All @@ -44,25 +44,24 @@ int uart_putchar(ps_chardevice_t* d, int c)
return c;
}

static void
uart_handle_irq(ps_chardevice_t* dev)
static void uart_handle_irq(ps_chardevice_t *dev)
{
*REG_PTR(dev->vaddr, UARTICR) = 0x7f0;
}

int uart_init(const struct dev_defn* defn,
const ps_io_ops_t* ops,
ps_chardevice_t* dev)
int uart_init(const struct dev_defn *defn,
const ps_io_ops_t *ops,
ps_chardevice_t *dev)
{
memset(dev, 0, sizeof(*dev));
void* vaddr = chardev_map(defn, ops);
void *vaddr = chardev_map(defn, ops);
if (vaddr == NULL) {
return -1;
}

/* Set up all the device properties. */
dev->id = defn->id;
dev->vaddr = (void*)vaddr;
dev->vaddr = (void *)vaddr;
dev->read = &uart_read;
dev->write = &uart_write;
dev->handle_irq = &uart_handle_irq;
Expand Down
15 changes: 7 additions & 8 deletions libplatsupport/src/plat/hikey/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int uart_getchar(ps_chardevice_t *d)
return ch;
}

int uart_putchar(ps_chardevice_t* d, int c)
int uart_putchar(ps_chardevice_t *d, int c)
{
while ((*REG_PTR(d->vaddr, UARTFR) & PL011_UARTFR_TXFF) != 0);

Expand All @@ -41,25 +41,24 @@ int uart_putchar(ps_chardevice_t* d, int c)
return c;
}

static void
uart_handle_irq(ps_chardevice_t* dev)
static void uart_handle_irq(ps_chardevice_t *dev)
{
*REG_PTR(dev->vaddr, UARTICR) = 0x7f0;
}

int uart_init(const struct dev_defn* defn,
const ps_io_ops_t* ops,
ps_chardevice_t* dev)
int uart_init(const struct dev_defn *defn,
const ps_io_ops_t *ops,
ps_chardevice_t *dev)
{
memset(dev, 0, sizeof(*dev));
void* vaddr = chardev_map(defn, ops);
void *vaddr = chardev_map(defn, ops);
if (vaddr == NULL) {
return -1;
}

/* Set up all the device properties. */
dev->id = defn->id;
dev->vaddr = (void*)vaddr;
dev->vaddr = (void *)vaddr;
dev->read = &uart_read;
dev->write = &uart_write;
dev->handle_irq = &uart_handle_irq;
Expand Down

0 comments on commit bff3298

Please sign in to comment.