From: Dan Carpenter <dan.carpenter@ORACLE.COM>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org
Subject: re: md/bitmap: move some fields of 'struct bitmap' into a 'storage' substruct.
Date: Fri, 20 Apr 2012 16:13:36 +0300 [thread overview]
Message-ID: <20120420131336.GA26339@elgon.mountain> (raw)
Hello NeilBrown,
This is a semi-automatic email about new static checker warnings.
The patch 9159d8a35d0a: "md/bitmap: move some fields of 'struct
bitmap' into a 'storage' substruct." from Apr 19, 2012, leads to the
following Smatch complaint:
drivers/md/bitmap.c:1212 bitmap_daemon_work()
error: we previously assumed 'bitmap->storage.filemap' could be
null (see line 1145)
drivers/md/bitmap.c
1144 bitmap->need_sync = 0;
1145 if (bitmap->storage.filemap) {
^^^^^^^^^^^^^^^^^^^^^^^
Renamed check.
1146 sb = kmap_atomic(bitmap->storage.sb_page);
1147 sb->events_cleared =
1148 cpu_to_le64(bitmap->events_cleared);
1149 kunmap_atomic(sb);
1150 set_page_attr(bitmap, 0,
1151 BITMAP_PAGE_NEEDWRITE);
1152 }
1153 }
[snip]
1210 if (test_and_clear_page_attr(bitmap, j,
1211 BITMAP_PAGE_NEEDWRITE)) {
1212 write_page(bitmap, bitmap->storage.filemap[j], 0);
^^^^^^^^^^^^^^^^^^^^^^^^^^
Renamed dereference.
1213 if (!bitmap->storage.filemap)
^^^^^^^^^^^^^^^^^^^^^^^
Another check.
1214 break;
Really, this isn't a new warning, it's just shows up as a new warning
because of the rename. Still, I was curious about the check after the
dereference.
regards,
dan carpenter
next reply other threads:[~2012-04-20 13:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-20 13:13 Dan Carpenter [this message]
2012-04-23 0:10 ` md/bitmap: move some fields of 'struct bitmap' into a 'storage' substruct NeilBrown
2012-04-23 10:17 ` Dan Carpenter
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=20120420131336.GA26339@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.