Commit 24af3e16 authored by Frank Zago's avatar Frank Zago Committed by Greg Kroah-Hartman

staging: lustre: missed a few cases of using NULL instead of 0

It is preferable to use NULL instead of 0 for pointers. This fixes sparse
warnings such as:

lustre/fld/fld_request.c:126:17: warning: Using plain integer as NULL pointer

The second parameter of class_match_param() was changed to a const, to
be able to remove a cast in one user, to prevent splitting a long
line. No other code change.
Signed-off-by: default avatarFrank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12567Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@gmail.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 505510fd
...@@ -904,7 +904,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle, ...@@ -904,7 +904,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle,
{ {
lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY}; lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY};
lnet_handle_me_t me_handle; lnet_handle_me_t me_handle;
lnet_md_t md = {0}; lnet_md_t md = { NULL };
int rc, rc2; int rc, rc2;
if (set_eq) { if (set_eq) {
......
...@@ -1940,7 +1940,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, ...@@ -1940,7 +1940,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
struct super_block *sb, struct lookup_intent *it) struct super_block *sb, struct lookup_intent *it)
{ {
struct ll_sb_info *sbi = NULL; struct ll_sb_info *sbi = NULL;
struct lustre_md md; struct lustre_md md = { NULL };
int rc; int rc;
LASSERT(*inode || sb); LASSERT(*inode || sb);
......
...@@ -72,7 +72,7 @@ EXPORT_SYMBOL(class_find_param); ...@@ -72,7 +72,7 @@ EXPORT_SYMBOL(class_find_param);
/* returns 0 if this is the first key in the buffer, else 1. /* returns 0 if this is the first key in the buffer, else 1.
valp points to first char after key. */ valp points to first char after key. */
static int class_match_param(char *buf, char *key, char **valp) static int class_match_param(char *buf, const char *key, char **valp)
{ {
if (!buf) if (!buf)
return 1; return 1;
...@@ -1008,7 +1008,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, ...@@ -1008,7 +1008,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
/* Search proc entries */ /* Search proc entries */
while (lvars[j].name) { while (lvars[j].name) {
var = &lvars[j]; var = &lvars[j];
if (class_match_param(key, (char *)var->name, NULL) == 0 if (!class_match_param(key, var->name, NULL)
&& keylen == strlen(var->name)) { && keylen == strlen(var->name)) {
matched++; matched++;
rc = -EROFS; rc = -EROFS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment