Fix up warnings generated by building with -Werror under gcc 9.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- arch/sparc32/context.c | 2 +- drivers/cuda.c | 4 ++-- drivers/ide.c | 2 +- drivers/pmu.c | 4 ++-- fs/hfs/hfs_fs.c | 2 +- packages/nvram.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/sparc32/context.c b/arch/sparc32/context.c index 65c421a..b4b0ae3 100644 --- a/arch/sparc32/context.c +++ b/arch/sparc32/context.c @@ -115,7 +115,7 @@ struct context *switch_to(struct context *ctx) __context = ctx; asm __volatile__ ("\n\tcall __switch_context" "\n\tnop" ::: "g1", "g2", "g3", "g4", "g5", "g6", "g7", - "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", + "o0", "o1", "o2", "o3", "o4", "o5", "o7", "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", "i0", "i1", "i2", "i3", "i4", "i5", "i7", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", diff --git a/drivers/cuda.c b/drivers/cuda.c index ff5d22d..d079d1e 100644 --- a/drivers/cuda.c +++ b/drivers/cuda.c @@ -369,7 +369,7 @@ static void rtc_init(char *path) { phandle_t ph, aliases; - char buf[64]; + char buf[128];
snprintf(buf, sizeof(buf), "%s/rtc", path); REGISTER_NAMED_NODE(rtc, buf); @@ -387,7 +387,7 @@ static void powermgt_init(char *path) { phandle_t ph; - char buf[64]; + char buf[128];
snprintf(buf, sizeof(buf), "%s/power-mgt", path); REGISTER_NAMED_NODE(rtc, buf); diff --git a/drivers/ide.c b/drivers/ide.c index edbd287..519ad46 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -987,7 +987,7 @@ ob_ide_identify_drive(struct ide_drive *drive) drive->sect = id.sectors; }
- strncpy(drive->model, (char*)id.model, sizeof(id.model)); + strncpy(drive->model, (char*)id.model, sizeof(drive->model)); drive->model[40] = '\0'; return 0; } diff --git a/drivers/pmu.c b/drivers/pmu.c index 6fc5363..9198846 100644 --- a/drivers/pmu.c +++ b/drivers/pmu.c @@ -523,7 +523,7 @@ NODE_METHODS(rtc) = { static void rtc_init(char *path) { phandle_t ph, aliases; - char buf[64]; + char buf[128];
snprintf(buf, sizeof(buf), "%s/rtc", path); REGISTER_NAMED_NODE(rtc, buf); @@ -540,7 +540,7 @@ static void rtc_init(char *path) static void powermgt_init(char *path) { phandle_t ph; - char buf[64]; + char buf[128];
/* This is a bunch of magic "Feature" bits for which we only have * partial definitions from Darwin. These are taken from a diff --git a/fs/hfs/hfs_fs.c b/fs/hfs/hfs_fs.c index 2e63dbf..ca8a433 100644 --- a/fs/hfs/hfs_fs.c +++ b/fs/hfs/hfs_fs.c @@ -86,7 +86,7 @@ _search( hfsvol *vol, const char *path, const char *sname, hfsfile **ret_fd )
strncpy( buf, path, sizeof(buf) ); if( buf[strlen(buf)-1] != ':' ) - strncat( buf, ":", sizeof(buf) ); + strncat( buf, ":", sizeof(buf) - 1 ); buf[sizeof(buf)-1] = 0; p = buf + strlen( buf );
diff --git a/packages/nvram.c b/packages/nvram.c index 3182edf..e895fed 100644 --- a/packages/nvram.c +++ b/packages/nvram.c @@ -105,7 +105,7 @@ create_free_part( char *ptr, int size ) nvpart_t *nvp = (nvpart_t*)ptr; memset( nvp, 0, size );
- strncpy( nvp->name, "777777777777", sizeof(nvp->name) ); + strncpy( nvp->name, "77777777777", sizeof(nvp->name) ); nvp->signature = NV_SIG_FREE; nvp->len_hi = (size /16) >> 8; nvp->len_lo = size /16;