From: Phil White <pwhite@sgi.com>
To: xfs@oss.sgi.com
Subject: [NOTES] [patch] xfs: remove an unneeded NULL check
Date: Tue, 31 Jan 2012 14:04:56 -0800 [thread overview]
Message-ID: <20120131220456.GG2569@caliban.corp.sgi.com> (raw)
In-Reply-To: <20120128105501.GB25092@elgon.mountain>
#pwhite: We can safely remove this check because the one call to
#xfs_log_commit_cil() comes from xfs_trans_commit() and passes a pointer to a
#local variable.
Smatch complains because we check "commit_lsn" for NULL inconsistently.
fs/xfs/xfs_log_cil.c +705 xfs_log_commit_cil(43) error: we previously
assumed 'commit_lsn' could be null (see line 688)
xfs_log_commit_cil() is only called from one place, and "commit_lsn" is
a valid pointer, so I've removed the NULL check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Phil White <pwhite@sgi.com>
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index d4fadbe..d9c4652 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -685,8 +685,7 @@ xfs_log_commit_cil(
/* lock out background commit */
down_read(&log->l_cilp->xc_ctx_lock);
- if (commit_lsn)
- *commit_lsn = log->l_cilp->xc_ctx->sequence;
+ *commit_lsn = log->l_cilp->xc_ctx->sequence;
xlog_cil_insert_items(log, log_vector, tp->t_ticket);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-01-31 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-28 10:55 [patch] xfs: remove an unneeded NULL check Dan Carpenter
2012-01-31 22:04 ` Phil White [this message]
2012-01-31 22:56 ` Dave Chinner
2012-01-31 23:08 ` Ben Myers
2012-02-01 10:45 ` Christoph Hellwig
2012-02-01 21:13 ` Dave Chinner
2012-02-01 21:15 ` Christoph Hellwig
2012-02-01 23:16 ` Dave Chinner
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=20120131220456.GG2569@caliban.corp.sgi.com \
--to=pwhite@sgi.com \
--cc=xfs@oss.sgi.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