Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751414AbcJAOuX (ORCPT ); Sat, 1 Oct 2016 10:50:23 -0400 Received: from mout.web.de ([217.72.192.78]:49946 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbcJAOuO (ORCPT ); Sat, 1 Oct 2016 10:50:14 -0400 Subject: [PATCH 05/15] md-cluster: Improve another size determination in recv_daemon() To: linux-raid@vger.kernel.org, Guoqing Jiang , Shaohua Li References: <566ABCD9.1060404@users.sourceforge.net> <3a03df66-92ce-20fb-17f3-fb79b9d43c8e@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <2eb2819e-9477-12ec-b4a2-91207cf16fd7@users.sourceforge.net> Date: Sat, 1 Oct 2016 16:50:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <3a03df66-92ce-20fb-17f3-fb79b9d43c8e@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:dZ20U9xBT1sU89w9JVN/+aWZd6wLG1QSmTBKSS6sD+Zu/BFug11 XUs1LFXWm9KxgHXen1r8Gb1xsc0ieIrQ3vUxlxYWOSSQO+mBT9Wj5OTIYTm7xcd48DyomwW Yrf+NoL1BeqbCT2cxMEjMk+MXxfHQA1nlQfwJI7XdYCK/9Y4zdShX7C/AJcjo932oN+AIl1 RMDl/fLG4bjIcwFUWEl8g== X-UI-Out-Filterresults: notjunk:1;V01:K0:Xt2bBdZ5MZo=:MbSomKkdpAbZVUUuRhaNoG OKBlLcnxngB/RXex5URmwnQSk3Yxsuibokg1ZdLbru9cz1wsLBJ7c/1/KXl/HgUFmf0+upFyA 8uNdPo/xHEK2PyTXgArPFriy+BnQoS7Knfv+Ov9AXfYidpr2B66GJqzKfaiWbta1Kcwuw/1/g FLUttQLb5WLxyVtA52iaG3pUnYkfvt+FGjD4lLm7ieyr+3N594D/9N3mjfl+R1atx93ps9W9F yX4UigdKprpJGGpuMGvIb4cYhXSrPYYP8P/h8QZDYocaCdIaX68gn1SRHkkKklHXqdMuNZ4YS 76zItnJhwFhKcYLeAQpPZ2evV6g99Z2A400K/NQxAgwrNG8WcsetsgptWM92ogfMDlExaTRi/ ljD5sk/2AT8vlLnkmacz06RWjTpvtiPnwMv/hwHvuY6RlwtIpRFzfxqVnPQxOmrNpL+WN9iAF EfxpeXf2C4ldlC19udkcwnU0VEG7rHLqtUixZyamN2SoofbuJqnk4I1glKOELhyNaVsxm6Gqp 48flysrSCLQIvxIHECsDlzcPLU63mNAQtfOqyCEY+xausPSdw85nup8HV2XhmwfPyeKOuKdhv osLPC9XU6eYyhEchKnwQqV4BltzOoloKE6ULYpJcaPKgZIneu5uWnK58ZpOjHeQlIre59jwUd my6MsJrB4Asx8YItFmJaBTRbWphigdFEZTPpVpFnamBQEkQW3iTjX5Gv0/dearI58c4RsS+Sz CQVUl5jo3lmOqFwr1j8gmPEPCu8I2KTBIS3esD21Lnq2X/rwxbm9G132h1cNqd9K1Lda9y6sx 5V+Dyt2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 923 Lines: 27 From: Markus Elfring Date: Sat, 1 Oct 2016 12:28:19 +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 c81eed4..adf9555 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -617,7 +617,7 @@ static void recv_daemon(struct md_thread *thread) } /* read lvb and wake up thread to process this message_lockres */ - memcpy(&msg, message_lockres->lksb.sb_lvbptr, sizeof(struct cluster_msg)); + memcpy(&msg, message_lockres->lksb.sb_lvbptr, sizeof(msg)); ret = process_recvd_msg(thread->mddev, &msg); if (ret) goto out; -- 2.10.0