Anastasia Klimchuk submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved Thomas Heijligen: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved
tests: Mark all static functions as static

Part 1 of fixing -Wmissing-prototypes warnings. This patch is
adding static to all functions which are actually static.
This fixes the warnings like this:

warning: no previous prototype for ‘function_name’
[-Wmissing-prototypes]

This patch is needed to sync compiler warning options between meson
and makefile.

TEST=running the following produces no warnings:
meson setup --wipe (to clean build directory)
ninja test

Change-Id: Ic54da5ac1b2a46f55e3e3bee4ed952bdf59e8444
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/63571
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
---
M tests/chip.c
M tests/lifecycle.c
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/tests/chip.c b/tests/chip.c
index 03d604f..444d411 100644
--- a/tests/chip.c
+++ b/tests/chip.c
@@ -46,7 +46,7 @@
.buf = { 0 },
};

-int read_chip(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len)
+static int read_chip(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len)
{
printf("Read chip called with start=0x%x, len=0x%x\n", start, len);
if (!g_chip_state.unlock_calls) {
@@ -60,7 +60,7 @@
return 0;
}

-int write_chip(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
+static int write_chip(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
{
printf("Write chip called with start=0x%x, len=0x%x\n", start, len);
if (!g_chip_state.unlock_calls) {
@@ -74,7 +74,7 @@
return 0;
}

-int unlock_chip(struct flashctx *flash)
+static int unlock_chip(struct flashctx *flash)
{
printf("Unlock chip called\n");
g_chip_state.unlock_calls++;
@@ -87,7 +87,7 @@
return 0;
}

-int block_erase_chip(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen)
+static int block_erase_chip(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen)
{
printf("Block erase called with blockaddr=0x%x, blocklen=0x%x\n", blockaddr, blocklen);
if (!g_chip_state.unlock_calls) {
@@ -404,7 +404,7 @@
free(newcontents);
}

-size_t verify_chip_fread(void *state, void *buf, size_t size, size_t len, FILE *fp)
+static size_t verify_chip_fread(void *state, void *buf, size_t size, size_t len, FILE *fp)
{
/*
* Verify operation compares contents of the file vs contents on the chip.
diff --git a/tests/lifecycle.c b/tests/lifecycle.c
index 825654f..236d1d7 100644
--- a/tests/lifecycle.c
+++ b/tests/lifecycle.c
@@ -228,13 +228,13 @@
#endif
}

-int dediprog_libusb_init(void *state, libusb_context **ctx)
+static int dediprog_libusb_init(void *state, libusb_context **ctx)
{
*ctx = not_null();
return 0;
}

-int dediprog_libusb_control_transfer(void *state,
+static int dediprog_libusb_control_transfer(void *state,
libusb_device_handle *devh,
uint8_t bmRequestType,
uint8_t bRequest,
@@ -274,7 +274,7 @@
char *fopen_path;
};

-FILE *linux_mtd_fopen(void *state, const char *pathname, const char *mode)
+static FILE *linux_mtd_fopen(void *state, const char *pathname, const char *mode)
{
struct linux_mtd_io_state *io_state = state;

@@ -283,7 +283,7 @@
return not_null();
}

-size_t linux_mtd_fread(void *state, void *buf, size_t size, size_t len, FILE *fp)
+static size_t linux_mtd_fread(void *state, void *buf, size_t size, size_t len, FILE *fp)
{
struct linux_mtd_fread_mock_entry {
const char *path;
@@ -317,7 +317,7 @@
return 0;
}

-int linux_mtd_fclose(void *state, FILE *fp)
+static int linux_mtd_fclose(void *state, FILE *fp)
{
struct linux_mtd_io_state *io_state = state;

@@ -372,7 +372,7 @@
return 0;
}

-char *linux_spi_fgets(void *state, char *buf, int len, FILE *fp)
+static char *linux_spi_fgets(void *state, char *buf, int len, FILE *fp)
{
/* Emulate reading max buffer size from sysfs. */
const char *max_buf_size = "1048576";

2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.

To view, visit change 63571. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic54da5ac1b2a46f55e3e3bee4ed952bdf59e8444
Gerrit-Change-Number: 63571
Gerrit-PatchSet: 6
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Nico Huber <nico.h@gmx.de>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-CC: Peter Marheine <pmarheine@chromium.org>
Gerrit-MessageType: merged