From: santosh nayak <santoshprasadnayak@gmail.com>
To: bpm@sgi.com
Cc: elder@kernel.org, xfs-masters@oss.sgi.com, xfs@oss.sgi.com,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Santosh Nayak <santoshprasadnayak@gmail.com>
Subject: [PATCH] xfs: Use memset to initialize structure member.
Date: Fri, 24 Feb 2012 12:38:42 +0530 [thread overview]
Message-ID: <1330067322-17011-1-git-send-email-santoshprasadnayak@gmail.com> (raw)
From: Santosh Nayak <santoshprasadnayak@gmail.com>
Sparse is giving following warning:
fs/xfs/xfs_bmap.c:4826:41: warning: Using plain integer as NULL pointer.
To avoid this warning, use memset to initialize the structure member.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
---
fs/xfs/xfs_bmap.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 188ef2f..030e93f 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -4823,7 +4823,7 @@ xfs_bmapi_write(
{
struct xfs_mount *mp = ip->i_mount;
struct xfs_ifork *ifp;
- struct xfs_bmalloca bma = { 0 }; /* args for xfs_bmap_alloc */
+ struct xfs_bmalloca bma; /* args for xfs_bmap_alloc */
xfs_fileoff_t end; /* end of mapped file region */
int eof; /* after the end of extents */
int error; /* error return */
@@ -4852,6 +4852,8 @@ xfs_bmapi_write(
ASSERT(!(flags & XFS_BMAPI_IGSTATE));
ASSERT(tp != NULL);
ASSERT(len > 0);
+
+ memset(&bma, 0, sizeof(bma));
whichfork = (flags & XFS_BMAPI_ATTRFORK) ?
XFS_ATTR_FORK : XFS_DATA_FORK;
--
1.7.4.4
next reply other threads:[~2012-02-24 7:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 7:08 santosh nayak [this message]
2012-02-24 7:53 ` [PATCH] xfs: Use memset to initialize structure member Dan Carpenter
2012-02-24 16:05 ` Ben Myers
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=1330067322-17011-1-git-send-email-santoshprasadnayak@gmail.com \
--to=santoshprasadnayak@gmail.com \
--cc=bpm@sgi.com \
--cc=elder@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xfs-masters@oss.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;
as well as URLs for NNTP newsgroup(s).