From 983233730c5d99121a50c40341e194c1cb38c152 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 25 Nov 2021 13:24:38 +0100 Subject: [PATCH] zipl: add missing static declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix Sparse findings like: warning: symbol 'hash_table_find' was not declared. Should it be static? Reviewed-by: Stefan Haberland Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- libdasd/dasd_sys.c | 2 +- zipl/boot/stage3.c | 4 ++-- zipl/src/bootmap.c | 4 ++-- zipl/src/disk.c | 6 +++--- zipl/src/envblk.c | 4 ++-- zipl/src/job.c | 2 +- zipl/src/misc.c | 4 ++-- zipl/src/scan.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libdasd/dasd_sys.c b/libdasd/dasd_sys.c index a11a565f..62a572b8 100644 --- a/libdasd/dasd_sys.c +++ b/libdasd/dasd_sys.c @@ -96,7 +96,7 @@ int dasd_sys_ese(char *devnode) return (rc == 1) ? 1 : 0; } -int dasd_get_pm_from_chpid(char *busid, unsigned int chpid, int *mask) +static int dasd_get_pm_from_chpid(char *busid, unsigned int chpid, int *mask) { unsigned int val; int count, i; diff --git a/zipl/boot/stage3.c b/zipl/boot/stage3.c index 428cc28c..c2ae678c 100644 --- a/zipl/boot/stage3.c +++ b/zipl/boot/stage3.c @@ -159,8 +159,8 @@ static void hash_table_add(struct env_hash_entry *items, (*new_idx)++; } -struct env_hash_entry *hash_table_find(struct env_hash_entry **buckets, - char *name) +static struct env_hash_entry *hash_table_find(struct env_hash_entry **buckets, + char *name) { struct env_hash_entry *item; diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index ae42cb67..304afafd 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -34,7 +34,7 @@ #include "misc.h" /* Pointer to dedicated empty block in bootmap. */ -disk_blockptr_t empty_block; +static disk_blockptr_t empty_block; /* Get size of a bootmap block pointer for disk with given INFO. */ static int @@ -142,7 +142,7 @@ check_secure_boot_support(void) * of segment table blocks to the file identified by file descriptor FD. Upon * success, return 0 and set SECTION_POINTER to point to the first block in * the resulting segment table. Return non-zero otherwise. */ -int +static int add_segment_table(int fd, disk_blockptr_t* list, blocknum_t count, disk_blockptr_t* segment_pointer, struct disk_info* info) diff --git a/zipl/src/disk.c b/zipl/src/disk.c index f8df89a7..6d3cfb57 100644 --- a/zipl/src/disk.c +++ b/zipl/src/disk.c @@ -91,7 +91,7 @@ disk_determine_dasd_type(struct disk_info *data, } /* Return non-zero for ECKD type. */ -int +static int disk_is_eckd(disk_type_t type) { return (type == disk_type_eckd_ldl || @@ -114,7 +114,7 @@ read_block_by_offset(int fd, int blksize, uint64_t offset, char *buffer) return 0; } -int +static int determine_virtblk_type(struct disk_info *data, struct stat *stats) { char *device; @@ -559,7 +559,7 @@ disk_free_info(struct disk_info* info) * logical block number. Upon success, return 0 and store the physical * blocknumber in the variable pointed to by PHYSICAL. Return non-zero * otherwise. */ -int +static int disk_get_blocknum(int fd, int fd_is_basedisk, blocknum_t logical, blocknum_t* physical, struct disk_info* info) { diff --git a/zipl/src/envblk.c b/zipl/src/envblk.c index 39a02fc3..141cee88 100644 --- a/zipl/src/envblk.c +++ b/zipl/src/envblk.c @@ -167,8 +167,8 @@ static int hash_table_add(struct line_hash_entry **table, char *line, int len) * LINE: string contailing NAME=VALUE * LEN: length of the NAME with trailing delimiter "=" */ -struct line_hash_entry *hash_table_find(struct line_hash_entry **table, - char *name, size_t len) +static struct line_hash_entry *hash_table_find(struct line_hash_entry **table, + char *name, size_t len) { struct line_hash_entry *item; diff --git a/zipl/src/job.c b/zipl/src/job.c index 10ac0862..ee900efb 100644 --- a/zipl/src/job.c +++ b/zipl/src/job.c @@ -430,7 +430,7 @@ free_menu_data(struct job_menu_data* data) } -void +static void free_mvdump_data(struct job_mvdump_data* data) { int i; diff --git a/zipl/src/misc.c b/zipl/src/misc.c index 8d1a2ee1..a1ecb540 100644 --- a/zipl/src/misc.c +++ b/zipl/src/misc.c @@ -497,7 +497,7 @@ misc_check_writable_device(const char* devno, int blockdev, int chardev) /* ASCII to EBCDIC conversion table. */ -unsigned char ascebc[256] = +static unsigned char ascebc[256] = { 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, @@ -534,7 +534,7 @@ unsigned char ascebc[256] = }; /* EBCDIC to ASCII conversion table. */ -unsigned char ebcasc[256] = +static unsigned char ebcasc[256] = { /* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */ 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F, diff --git a/zipl/src/scan.c b/zipl/src/scan.c index 48260f98..b6b94262 100644 --- a/zipl/src/scan.c +++ b/zipl/src/scan.c @@ -82,7 +82,7 @@ enum scan_key_state scan_key_table[SCAN_SECTION_NUM][SCAN_KEYWORD_NUM] = { }; /* Determines which keyword may be present in a menu section */ -enum scan_key_state scan_menu_key_table[SCAN_KEYWORD_NUM] = { +static enum scan_key_state scan_menu_key_table[SCAN_KEYWORD_NUM] = { /* menu section */ opt, inv, inv, inv, inv, inv, inv, inv, req, opt, opt, inv, inv, inv, opt, opt, opt, opt, opt, inv, inv, opt