From: SF Markus Elfring Date: Sat, 01 Oct 2016 14:47:16 +0000 Subject: [PATCH 02/15] md-cluster: Improve another size determination in resync_info_update() Message-Id: List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <3a03df66-92ce-20fb-17f3-fb79b9d43c8e@users.sourceforge.net> In-Reply-To: <3a03df66-92ce-20fb-17f3-fb79b9d43c8e@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-raid@vger.kernel.org, Guoqing Jiang , Shaohua Li Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: Markus Elfring Date: Sat, 1 Oct 2016 11:37:24 +0200 Replace the specification of a data structure by a variable name as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring --- drivers/md/md-cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index 0000e3a..c28f596 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -1057,7 +1057,7 @@ static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi) /* do not send zero again, if we have sent before */ if (hi = 0) { - memcpy(&ri, cinfo->bitmap_lockres->lksb.sb_lvbptr, sizeof(struct resync_info)); + memcpy(&ri, cinfo->bitmap_lockres->lksb.sb_lvbptr, sizeof(ri)); if (le64_to_cpu(ri.hi) = 0) return 0; } -- 2.10.0