mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Frank Zago <fzago@cray.com>
Subject: [PATCH 10/24] staging: lustre: missed a few cases of using NULL instead of 0
Date: Mon, 22 Feb 2016 17:29:11 -0500	[thread overview]
Message-ID: <1456180165-1105-11-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1456180165-1105-1-git-send-email-jsimmons@infradead.org>

From: Frank Zago <fzago@cray.com>

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: Frank Zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/12567
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 drivers/staging/lustre/lnet/lnet/api-ni.c          |    2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |    2 +-
 .../staging/lustre/lustre/obdclass/obd_config.c    |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 3b7bc36..f223d5d 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -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_handle_me_t me_handle;
-	lnet_md_t md = {0};
+	lnet_md_t md = { NULL };
 	int rc, rc2;
 
 	if (set_eq) {
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4de085d..2440b07 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1940,7 +1940,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
 		  struct super_block *sb, struct lookup_intent *it)
 {
 	struct ll_sb_info *sbi = NULL;
-	struct lustre_md md;
+	struct lustre_md md = { NULL };
 	int rc;
 
 	LASSERT(*inode || sb);
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index c4128ac..6417946 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(class_find_param);
 
 /* returns 0 if this is the first key in the buffer, else 1.
    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)
 		return 1;
@@ -1008,7 +1008,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, NULL) == 0
+			if (!class_match_param(key, var->name, NULL)
 			    && keylen == strlen(var->name)) {
 				matched++;
 				rc = -EROFS;
-- 
1.7.1

  parent reply	other threads:[~2016-02-22 22:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 22:29 [PATCH 00/24] Second batch of LNet updates James Simmons
2016-02-22 22:29 ` [PATCH 01/24] staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes James Simmons
2016-02-22 22:29 ` [PATCH 02/24] staging: lustre: Dynamic LNet Configuration (DLC) show command James Simmons
2016-02-22 22:29 ` [PATCH 03/24] staging: lustre: fix crash due to NULL networks string James Simmons
2016-02-22 22:29 ` [PATCH 04/24] staging: lustre: DLC user/kernel space glue code James Simmons
2016-02-22 22:29 ` [PATCH 05/24] staging: lustre: make local functions static for LNet ni James Simmons
2016-02-22 22:29 ` [PATCH 06/24] staging: lustre: remove LUSTRE_{,SRV_}LNET_PID James Simmons
2016-02-22 22:29 ` [PATCH 07/24] staging: lustre: improve LNet clean up code and API James Simmons
2016-02-22 22:29 ` [PATCH 08/24] staging: lustre: return appropriate errno when adding route James Simmons
2016-02-22 22:29 ` [PATCH 09/24] staging: lustre: make some lnet functions static James Simmons
2016-02-22 22:29 ` James Simmons [this message]
2016-02-22 22:29 ` [PATCH 11/24] staging: lustre: startup lnet acceptor thread dynamically James Simmons
2016-02-22 22:29 ` [PATCH 12/24] staging: lustre: reject invalid net configuration for lnet James Simmons
2016-02-22 22:29 ` [PATCH 13/24] staging: lustre: return -EEXIST if NI is not unique James Simmons
2016-02-22 22:29 ` [PATCH 14/24] staging: lustre: handle lnet_check_routes() errors James Simmons
2016-02-22 22:29 ` [PATCH 15/24] staging: lustre: improvement to router checker James Simmons
2016-02-22 22:29 ` [PATCH 16/24] staging: lustre: assume a kernel build James Simmons
2016-02-22 22:29 ` [PATCH 17/24] staging: lustre: prevent assert on LNet module unload James Simmons
2016-02-22 22:29 ` [PATCH 18/24] staging: lustre: remove messages from lazy portal on NI shutdown James Simmons
2016-02-22 22:29 ` [PATCH 19/24] staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer James Simmons
2016-02-22 22:29 ` [PATCH 20/24] staging: lustre: avoid race during lnet acceptor thread termination James Simmons
2016-02-22 22:29 ` [PATCH 21/24] staging: lustre: use sock.h in only acceptor.c James Simmons
2016-02-22 22:29 ` [PATCH 22/24] staging: lustre: Allocate the correct number of rtr buffers James Simmons
2016-02-22 22:29 ` [PATCH 23/24] staging: lustre: Use lnet_is_route_alive for router aliveness James Simmons
2016-02-22 22:29 ` [PATCH 24/24] staging: lustre: Remove LASSERTS from router checker James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456180165-1105-11-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fzago@cray.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®