{mount,umount}.nilfs2: make option format strings static

In the legacy mount/umount implementations (mount.nilfs2.c and
umount.nilfs2.c), the format string constants for garbage collector
options are defined globally but are not declared in any header and
are only used locally.

Mark them as static to limit their scope to the compilation unit.

This resolves the following Sparse warnings:

mount.nilfs2.c:108:12: warning: symbol 'gcpid_opt_fmt' was not declared.
 Should it be static?
mount.nilfs2.c:111:12: warning: symbol 'pp_opt_fmt' was not declared.
 Should it be static?
mount.nilfs2.c:114:12: warning: symbol 'nogc_opt_fmt' was not declared.
 Should it be static?
umount.nilfs2.c:107:12: warning: symbol 'gcpid_opt_fmt' was not declared.
 Should it be static?
umount.nilfs2.c:110:12: warning: symbol 'pp_opt_fmt' was not declared.
 Should it be static?

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
This commit is contained in:
Ryusuke Konishi 2026-01-11 13:50:11 +09:00
parent e26738984f
commit cad3e0c938
2 changed files with 5 additions and 5 deletions

View File

@ -105,13 +105,13 @@ static int fake;
const char fstype[] = NILFS2_FS_NAME;
char *progname = "mount." NILFS2_FS_NAME;
const char gcpid_opt_fmt[] = PIDOPT_NAME "=%d";
static const char gcpid_opt_fmt[] = PIDOPT_NAME "=%d";
typedef int gcpid_opt_t;
const char pp_opt_fmt[] = PPOPT_NAME "=%lu";
static const char pp_opt_fmt[] = PPOPT_NAME "=%lu";
typedef unsigned long pp_opt_t;
const char nogc_opt_fmt[] = NOGCOPT_NAME;
static const char nogc_opt_fmt[] = NOGCOPT_NAME;
typedef int nogc_opt_t;
struct mount_options {

View File

@ -104,10 +104,10 @@ static int nomtab;
const char fstype[] = NILFS2_FS_NAME;
char *progname = "umount." NILFS2_FS_NAME;
const char gcpid_opt_fmt[] = PIDOPT_NAME "=%d";
static const char gcpid_opt_fmt[] = PIDOPT_NAME "=%d";
typedef int gcpid_opt_t;
const char pp_opt_fmt[] = PPOPT_NAME "=%lu";
static const char pp_opt_fmt[] = PPOPT_NAME "=%lu";
typedef unsigned long pp_opt_t;
struct umount_options {