zconf/zcrypt: Fix sparse warnings

A compile with sparse (make C=1) shows a couple of warnings:
like:

  chzcrypt.c:36:3: warning: symbol 'l' was not declared.
  Should it be static?

  lszcrypt.c: In function 'show_device':
  lszcrypt.c:556:9: warning: 'card' may be used uninitialized
  [-Wmaybe-uninitialized]

Fix those warnings.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2021-06-21 11:08:56 +02:00
committed by Jan Höppner
parent 9100d6f40e
commit 3e818c53b2
3 changed files with 16 additions and 22 deletions

View File

@@ -25,12 +25,10 @@
/*
* Private data
*/
struct lszcrypt_l {
static struct lszcrypt_l {
int verbose;
} l;
struct lszcrypt_l *lszcrypt_l = &l;
/*
* Capabilities
*/
@@ -79,7 +77,7 @@ static struct fac_bits_s {
/*
* Program configuration
*/
const struct util_prg prg = {
static const struct util_prg prg = {
.desc = "Display zcrypt device and configuration information.",
.args = "[DEVICE_IDS]",
.copyright_vec = {
@@ -553,8 +551,6 @@ static void show_device(struct util_rec *rec, const char *device)
{
char *grp_dev, card[16];
util_rec_set(rec, "card", card);
strcpy(card, &device[4]);
grp_dev = util_path_sysfs("devices/ap/%s", device);
if (!util_path_is_dir(grp_dev))
@@ -707,7 +703,7 @@ static void show_devices_argv(char *argv[])
/*
* Describe adapter ids
*/
void print_adapter_id_help(void)
static void print_adapter_id_help(void)
{
printf("\n");
printf("DEVICE_IDS\n");