staging: lustre: fix sparse warnings "Using plain integer as NULL pointer"
authorRadek Dostal <rd@radekdostal.com>
Sun, 27 Jul 2014 21:22:57 +0000 (23:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jul 2014 00:03:30 +0000 (17:03 -0700)
fixes all sparse warnings "Using plain integer as NULL pointer"
in drivers/staging/lustre

drivers/staging/lustre/lnet/lnet/api-ni.c:1665:32: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lnet/lnet/api-ni.c:1773:35: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/fld/fld_request.c:171:17: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/llite/llite_lib.c:155:30: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/llite/lproc_llite.c:846:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:902:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:946:54: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:2819:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_dev.c:456:66: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/mdc_request.c:2426:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/mdc_request.c:2569:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/mdc_request.c:2740:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:175:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:176:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:177:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:178:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:179:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:180:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:181:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:182:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:183:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:185:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:186:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:193:66: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:194:63: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:195:56: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:196:51: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:197:50: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:198:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:199:57: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:200:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:206:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mdc/lproc_mdc.c:207:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/mgc/mgc_request.c:199:9: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:331:11: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/obd_config.c:1164:53: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/obd_config.c:1306:71: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/llog_test.c:943:62: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdclass/llog_test.c:944:65: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/obdecho/echo_client.c:3116:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/osc/osc_request.c:3424:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/osc/osc_request.c:3548:46: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/osc/osc_request.c:3615:46: warning: Using plain integer as NULL pointer

Signed-off-by: Radek Dostal <rd@radekdostal.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 files changed:
drivers/staging/lustre/lnet/lnet/api-ni.c
drivers/staging/lustre/lustre/fld/fld_request.c
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/llite/lproc_llite.c
drivers/staging/lustre/lustre/lov/lov_dev.c
drivers/staging/lustre/lustre/mdc/lproc_mdc.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
drivers/staging/lustre/lustre/mgc/mgc_request.c
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
drivers/staging/lustre/lustre/obdclass/llog_test.c
drivers/staging/lustre/lustre/obdclass/obd_config.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/osc/osc_request.c

index f4a2c65..b28734a 100644 (file)
@@ -1662,7 +1662,7 @@ lnet_destroy_ping_info(void)
 int
 lnet_ping_target_init(void)
 {
-       lnet_md_t        md = {0};
+       lnet_md_t        md = { NULL };
        lnet_handle_me_t  meh;
        lnet_process_id_t id;
        int            rc;
@@ -1770,7 +1770,7 @@ lnet_ping (lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_i
        lnet_handle_eq_t     eqh;
        lnet_handle_md_t     mdh;
        lnet_event_t     event;
-       lnet_md_t           md = {0};
+       lnet_md_t           md = { NULL };
        int               which;
        int               unlinked = 0;
        int               replied = 0;
index 4efded9..8e512f9 100644 (file)
@@ -168,7 +168,7 @@ struct lu_fld_hash fld_hash[] = {
                .fh_scan_func = fld_rrb_scan
        },
        {
-               0,
+               NULL,
        }
 };
 
index e0d8f15..0367f5a 100644 (file)
@@ -152,7 +152,7 @@ static void ll_free_sbi(struct super_block *sb)
 static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                                    struct vfsmount *mnt)
 {
-       struct inode *root = 0;
+       struct inode *root = NULL;
        struct ll_sb_info *sbi = ll_s2sbi(sb);
        struct obd_device *obd;
        struct obd_capa *oc = NULL;
index 13586c5..77f68b5 100644 (file)
@@ -843,7 +843,7 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
        { "default_cookiesize", &ll_defult_cookiesize_fops, NULL, 0 },
        { "sbi_flags",        &ll_sbi_flags_fops, NULL, 0 },
        { "xattr_cache",      &ll_xattr_cache_fops, NULL, 0 },
-       { 0 }
+       { NULL }
 };
 
 #define MAX_STRING_SIZE 128
index e6d1413..796a015 100644 (file)
@@ -453,7 +453,7 @@ static int lov_process_config(const struct lu_env *env,
                case LCFG_LOV_ADD_INA:
                        rc = lov_cl_add_target(env, d, index);
                        if (rc != 0)
-                               lov_del_target(d->ld_obd, index, 0, 0);
+                               lov_del_target(d->ld_obd, index, NULL, 0);
                        break;
                case LCFG_LOV_DEL_OBD:
                        lov_cl_del_target(env, d, index);
index e6af825..d1d891b 100644 (file)
@@ -172,39 +172,39 @@ LPROC_SEQ_FOPS_RW_TYPE(mdc, import);
 LPROC_SEQ_FOPS_RW_TYPE(mdc, pinger_recov);
 
 static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
-       { "uuid",           &mdc_uuid_fops,             0, 0 },
-       { "ping",           &mdc_ping_fops,             0, 0222 },
-       { "connect_flags",  &mdc_connect_flags_fops,    0, 0 },
-       { "blocksize",      &mdc_blksize_fops,          0, 0 },
-       { "kbytestotal",    &mdc_kbytestotal_fops,      0, 0 },
-       { "kbytesfree",     &mdc_kbytesfree_fops,       0, 0 },
-       { "kbytesavail",    &mdc_kbytesavail_fops,      0, 0 },
-       { "filestotal",     &mdc_filestotal_fops,       0, 0 },
-       { "filesfree",      &mdc_filesfree_fops,        0, 0 },
-       /*{ "filegroups",      lprocfs_rd_filegroups,  0, 0 },*/
-       { "mds_server_uuid", &mdc_server_uuid_fops,     0, 0 },
-       { "mds_conn_uuid",  &mdc_conn_uuid_fops,        0, 0 },
+       { "uuid",               &mdc_uuid_fops,                 NULL, 0 },
+       { "ping",               &mdc_ping_fops,                 NULL, 0222 },
+       { "connect_flags",      &mdc_connect_flags_fops,        NULL, 0 },
+       { "blocksize",          &mdc_blksize_fops,              NULL, 0 },
+       { "kbytestotal",        &mdc_kbytestotal_fops,          NULL, 0 },
+       { "kbytesfree",         &mdc_kbytesfree_fops,           NULL, 0 },
+       { "kbytesavail",        &mdc_kbytesavail_fops,          NULL, 0 },
+       { "filestotal",         &mdc_filestotal_fops,           NULL, 0 },
+       { "filesfree",          &mdc_filesfree_fops,            NULL, 0 },
+       /*{ "filegroups",       lprocfs_rd_filegroups,          NULL, 0 },*/
+       { "mds_server_uuid",    &mdc_server_uuid_fops,          NULL, 0 },
+       { "mds_conn_uuid",      &mdc_conn_uuid_fops,            NULL, 0 },
        /*
         * FIXME: below proc entry is provided, but not in used, instead
         * sbi->sb_md_brw_size is used, the per obd variable should be used
         * when CMD is enabled, and dir pages are managed in MDC layer.
         * Remember to enable proc write function.
         */
-       { "max_pages_per_rpc",  &mdc_obd_max_pages_per_rpc_fops, 0, 0 },
-       { "max_rpcs_in_flight", &mdc_max_rpcs_in_flight_fops, 0, 0 },
-       { "timeouts",           &mdc_timeouts_fops,    0, 0 },
-       { "import",             &mdc_import_fops, 0 },
-       { "state",              &mdc_state_fops, 0, 0 },
-       { "hsm_nl",             &mdc_kuc_fops, 0, 0200 },
-       { "pinger_recov",       &mdc_pinger_recov_fops, 0, 0 },
-       { 0 }
+       { "max_pages_per_rpc",  &mdc_obd_max_pages_per_rpc_fops, NULL, 0 },
+       { "max_rpcs_in_flight", &mdc_max_rpcs_in_flight_fops,   NULL, 0 },
+       { "timeouts",           &mdc_timeouts_fops,             NULL, 0 },
+       { "import",             &mdc_import_fops,               NULL, 0 },
+       { "state",              &mdc_state_fops,                NULL, 0 },
+       { "hsm_nl",             &mdc_kuc_fops,                  NULL, 0200 },
+       { "pinger_recov",       &mdc_pinger_recov_fops,         NULL, 0 },
+       { NULL }
 };
 
 LPROC_SEQ_FOPS_RO_TYPE(mdc, numrefs);
 
 static struct lprocfs_vars lprocfs_mdc_module_vars[] = {
-       { "num_refs",   &mdc_numrefs_fops,     0, 0 },
-       { 0 }
+       { "num_refs",           &mdc_numrefs_fops,              NULL, 0 },
+       { NULL }
 };
 
 void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
index 185fe66..4a1cc4e 100644 (file)
@@ -2423,7 +2423,7 @@ struct ldlm_valblock_ops inode_lvbo = {
 static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 {
        struct client_obd *cli = &obd->u.cli;
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        int rc;
 
        OBD_ALLOC(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
@@ -2566,7 +2566,7 @@ static int mdc_llog_finish(struct obd_device *obd, int count)
 static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf)
 {
        struct lustre_cfg *lcfg = buf;
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        int rc = 0;
 
        lprocfs_mdc_init_vars(&lvars);
@@ -2737,7 +2737,7 @@ struct md_ops mdc_md_ops = {
 int __init mdc_init(void)
 {
        int rc;
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        lprocfs_mdc_init_vars(&lvars);
 
        rc = class_register_type(&mdc_obd_ops, &mdc_md_ops, lvars.module_vars,
index 46a7d76..f520591 100644 (file)
@@ -197,7 +197,7 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
        int                   rc;
 
        CDEBUG(D_MGC, "do adding config log %s:%p\n", logname,
-              cfg ? cfg->cfg_instance : 0);
+              cfg ? cfg->cfg_instance : NULL);
 
        OBD_ALLOC(cld, sizeof(*cld) + strlen(logname) + 1);
        if (!cld)
index 1de1c65..9ce3d36 100644 (file)
@@ -328,7 +328,7 @@ struct lprocfs_vars lprocfs_base[] = {
        { "jobid_var", &obd_proc_jobid_var_fops },
        { .name =       "jobid_name",
          .fops =       &obd_proc_jobid_name_fops},
-       { 0 }
+       { NULL }
 };
 
 static void *obd_device_list_seq_start(struct seq_file *p, loff_t *pos)
index 6791d02..ef008ab 100644 (file)
@@ -940,8 +940,8 @@ cleanup_ctxt:
 }
 
 #if defined (CONFIG_PROC_FS)
-static struct lprocfs_vars lprocfs_llog_test_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_llog_test_module_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_llog_test_obd_vars[] = { { NULL } };
+static struct lprocfs_vars lprocfs_llog_test_module_vars[] = { { NULL } };
 static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars)
 {
     lvars->module_vars  = lprocfs_llog_test_module_vars;
index 3acb1a8..0d81d32 100644 (file)
@@ -1161,7 +1161,7 @@ int class_process_config(struct lustre_cfg *lcfg)
                char *tmp;
                /* llite has no obd */
                if ((class_match_param(lustre_cfg_string(lcfg, 1),
-                                      PARAM_LLITE, 0) == 0) &&
+                                      PARAM_LLITE, NULL) == 0) &&
                    client_process_config) {
                        err = (*client_process_config)(lcfg);
                        GOTO(out, err);
@@ -1303,8 +1303,8 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                /* Search proc entries */
                while (lvars[j].name) {
                        var = &lvars[j];
-                       if (class_match_param(key, (char *)var->name, 0) == 0 &&
-                           keylen == strlen(var->name)) {
+                       if (class_match_param(key, (char *)var->name, NULL) == 0
+                           && keylen == strlen(var->name)) {
                                matched++;
                                rc = -EROFS;
                                if (var->fops && var->fops->write) {
index b3428d9..f1847f3 100644 (file)
@@ -3113,7 +3113,7 @@ static struct obd_ops echo_client_obd_ops = {
 
 int echo_client_init(void)
 {
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        int rc;
 
        lprocfs_echo_init_vars(&lvars);
index 5028e77..fb0d9fb 100644 (file)
@@ -3421,7 +3421,7 @@ static int brw_queue_work(const struct lu_env *env, void *data)
 
 int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        struct client_obd         *cli = &obd->u.cli;
        void                   *handler;
        int                     rc;
@@ -3545,7 +3545,7 @@ int osc_cleanup(struct obd_device *obd)
 
 int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        int rc = 0;
 
        lprocfs_osc_init_vars(&lvars);
@@ -3612,7 +3612,7 @@ extern struct lock_class_key osc_ast_guard_class;
 
 int __init osc_init(void)
 {
-       struct lprocfs_static_vars lvars = { 0 };
+       struct lprocfs_static_vars lvars = { NULL };
        int rc;
 
        /* print an address of _any_ initialized kernel symbol from this