util/nvmutil: remove global variable x

make a singleton function instead

now there are technically no global variables,
so i can more easily start splitting this up
into multiple linked programs

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-18 07:17:40 +00:00
parent 411076b499
commit a7fa5c3bf4
2 changed files with 73 additions and 139 deletions
+2 -3
View File
@@ -289,7 +289,7 @@ struct xfile {
/*
* BE CAREFUL when editing this
* to ensure that you also update
* the tables in new_xstate()
* the tables in xstatus()
*/
struct xstate {
struct commands cmd[7];
@@ -313,7 +313,7 @@ struct xstate {
static struct xstate *new_xstate(void);
static struct xstate *xstatus(void);
/*
* Sanitize command tables.
@@ -437,7 +437,6 @@ off_t gbe_x_offset(unsigned long part, const char *f_op,
const char *d_type, off_t nsize, off_t ncmp);
long rw_gbe_file_exact(int fd, unsigned char *mem, unsigned long nrw,
off_t off, int rw_type);
void check_null_command(const char *c);
long rw_file_exact(int fd, unsigned char *mem, unsigned long len,
off_t off, int rw_type, int loop_eagain, int loop_eintr,
unsigned long max_retries, int off_reset);