Skip to contentSkip to conversation

staging: lustre: use NULL instead of 0 for non-integers

PATCH In review Martin Kepplinger 2 participants 2 messages Aug 3, 2014 – Aug 10, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: use NULL instead of 0 for non-integers

This fixes sparse errors where 0 is used for non-integers.

---
applies to -next20140802

 drivers/staging/lustre/lnet/lnet/api-ni.c          |    4 +-
 drivers/staging/lustre/lustre/fld/fld_request.c    |    2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |    2 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |    2 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c      |   44 ++++++++++----------
 drivers/staging/lustre/lustre/mgc/mgc_request.c    |    2 +-
 .../lustre/lustre/obdclass/linux/linux-module.c    |    2 +-
 drivers/staging/lustre/lustre/obdclass/llog_test.c |    4 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |    4 +-
 .../staging/lustre/lustre/obdecho/echo_client.c    |    2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c    |    6 +--
 11 files changed, 37 insertions(+), 37 deletions(-)
drivers/staging/lustre/lnet/lnet/api-ni.c +2 -2
index f4a2c65..b28734a 100644
@@ -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;
drivers/staging/lustre/lustre/fld/fld_request.c +1 -1
index 4efded9..8e512f9 100644
@@ -168,7 +168,7 @@ struct lu_fld_hash fld_hash[] = {
 		.fh_scan_func = fld_rrb_scan
 	},
 	{
-		0,
+		NULL,
 	}
 };
 
drivers/staging/lustre/lustre/llite/llite_lib.c +1 -1
index e0d8f15..0367f5a 100644
@@ -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;
drivers/staging/lustre/lustre/llite/lproc_llite.c +1 -1
index 13586c5..77f68b5 100644
@@ -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
drivers/staging/lustre/lustre/mdc/lproc_mdc.c +22 -22

61 lines not on this page · raw message

drivers/staging/lustre/lustre/mgc/mgc_request.c +1 -1
index 46a7d76..f520591 100644
@@ -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)
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +1 -1
index 1de1c65..9ce3d36 100644
@@ -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)
drivers/staging/lustre/lustre/obdclass/llog_test.c +2 -2
index 6791d02..1acd867 100644
@@ -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;
drivers/staging/lustre/lustre/obdclass/obd_config.c +2 -2
index 3acb1a8..d4410a2 100644
@@ -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,7 +1303,7 @@ 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 &&
+			if (class_match_param(key, (char *)var->name, NULL) == 0 &&
 			    keylen == strlen(var->name)) {
 				matched++;
 				rc = -EROFS;
drivers/staging/lustre/lustre/obdecho/echo_client.c +1 -1
index b3428d9..f1847f3 100644
@@ -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);
drivers/staging/lustre/lustre/osc/osc_request.c +3 -3
index 5028e77..fb0d9fb 100644
@@ -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
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 5 lines · Martin Kepplinger

This fixes sparse errors where 0 is used for non-integers.

---
applies to -next20140802

Someone else already did this same change, sorry :(

greg k-h