Compare commits

...

2 Commits

Author SHA1 Message Date
Leah Rowe
3148d31798 util/clarity: name the gbe file half size
we need only declare it in the centralised gbe_file_offset
function, which determines whether a write to the gbe file
falls specifically within the 4KB range that is the gbe
part.

it is always half of the gbe file size, and then the first
4KB of each half stores the gbe part.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-07 13:36:46 +00:00
Leah Rowe
96cb52f21a util/nvmutil: only have newrandom on linux/oldunix
these variables newrandom and oldrandom are unused on
BSD systems, and their unused status may trigger
warnings on some compilers.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2026-03-07 13:18:54 +00:00

View File

@@ -113,9 +113,9 @@ static void set_err(int errval);
*/
#define items(x) (sizeof((x)) / sizeof((x)[0]))
#ifndef HAVE_ARC4RANDOM_BUF
static const char newrandom[] = "/dev/urandom";
static const char oldrandom[] = "/dev/random"; /* fallback on OLD unix */
#ifndef HAVE_ARC4RANDOM_BUF
static const char *rname = NULL;
#endif
@@ -875,8 +875,10 @@ write_gbe_file_part(size_t p)
static off_t
gbe_file_offset(size_t p, const char *f_op)
{
off_t gbe_file_half_size = gbe_file_size >> 1;
return gbe_x_offset(p, f_op, "file",
gbe_file_size >> 1, gbe_file_size);
gbe_file_half_size, gbe_file_size);
}
/*