Add void to function signatures meant to be used without args

This commit is contained in:
Michael Cardell Widerkrantz 2024-03-04 15:53:12 +01:00 committed by dehanj
parent 046343e525
commit e085d0ebd0
No known key found for this signature in database
GPG Key ID: 3707A9DBF4BB8F1A
4 changed files with 11 additions and 11 deletions

View File

@ -106,7 +106,7 @@ uint32_t wait_timer_tick(uint32_t last_timer)
}
}
void zero_fwram()
void zero_fwram(void)
{
for (int i = 0; i < TK1_MMIO_FW_RAM_SIZE; i++) {
fw_ram[i] = 0x00;
@ -149,7 +149,7 @@ void failmsg(char *s)
puts("\r\n");
}
int main()
int main(void)
{
// Function pointer to blake2s()
volatile int (*fw_blake2s)(void *, unsigned long, const void *,

View File

@ -42,9 +42,9 @@ struct context {
uint8_t uss[32]; // User Supplied Secret, if any
};
static void print_hw_version();
static void print_hw_version(void);
static void print_digest(uint8_t *md);
static uint32_t rnd_word();
static uint32_t rnd_word(void);
static void compute_cdi(const uint8_t *digest, const uint8_t use_uss,
const uint8_t *uss);
static void copy_name(uint8_t *buf, const size_t bufsiz, const uint32_t word);
@ -55,9 +55,9 @@ static enum state loading_commands(const struct frame_header *hdr,
const uint8_t *cmd, enum state state,
struct context *ctx);
static void run(const struct context *ctx);
static void scramble_ram();
static void scramble_ram(void);
static void print_hw_version()
static void print_hw_version(void)
{
htif_puts("Hello, I'm firmware with");
htif_puts(" tk1_name0:");
@ -81,7 +81,7 @@ static void print_digest(uint8_t *md)
htif_lf();
}
static uint32_t rnd_word()
static uint32_t rnd_word(void)
{
while ((*trng_status & (1 << TK1_MMIO_TRNG_STATUS_READY_BIT)) == 0) {
}
@ -362,7 +362,7 @@ static void run(const struct context *ctx)
__builtin_unreachable();
}
static void scramble_ram()
static void scramble_ram(void)
{
uint32_t *ram = (uint32_t *)(TK1_RAM_BASE);
uint32_t rnd = rnd_word();
@ -384,7 +384,7 @@ static void scramble_ram()
*ram_scramble = rnd_word();
}
int main()
int main(void)
{
struct context ctx = {0};
struct frame_header hdr = {0};

View File

@ -142,7 +142,7 @@ static void write(uint8_t *buf, size_t nbytes)
}
}
uint8_t readbyte()
uint8_t readbyte(void)
{
for (;;) {
if (*can_rx) {

View File

@ -51,7 +51,7 @@ struct frame_header {
};
void writebyte(uint8_t b);
uint8_t readbyte();
uint8_t readbyte(void);
void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf);
int readcommand(struct frame_header *hdr, uint8_t *cmd, int state);
#endif