From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cmTGF-000248-9f for mharc-qemu-trivial@gnu.org; Fri, 10 Mar 2017 17:43:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmQnm-00089o-8V for qemu-trivial@nongnu.org; Fri, 10 Mar 2017 15:06:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmQnl-0002SY-DS for qemu-trivial@nongnu.org; Fri, 10 Mar 2017 15:06:14 -0500 Received: from mail.kernel.org ([198.145.29.136]:32824) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmQnj-0002RN-A7; Fri, 10 Mar 2017 15:06:11 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7984B20595; Fri, 10 Mar 2017 20:06:09 +0000 (UTC) Received: from localhost.localdomain (bzq-109-67-52-244.red.bezeqint.net [109.67.52.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E025F204D2; Fri, 10 Mar 2017 20:06:06 +0000 (UTC) From: Krzysztof Kozlowski To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-trivial@nongnu.org, Krzysztof Kozlowski Date: Fri, 10 Mar 2017 22:05:50 +0200 Message-Id: <20170310200550.13313-3-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170310200550.13313-1-krzk@kernel.org> References: <20170310200550.13313-1-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 X-Mailman-Approved-At: Fri, 10 Mar 2017 17:43:44 -0500 Subject: [Qemu-trivial] [PATCH v2 2/2] qdev: Constify local variable returned by blk_bs X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2017 20:06:15 -0000 Inside qdev_prop_set_drive() the value returned by blk_bs() is passed only as pointer to const to bdrv_get_node_name() and pointed values is not modified in other places so this can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski --- hw/core/qdev-properties-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index c34be1c1bace..0d40ce682d05 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -405,7 +405,7 @@ void qdev_prop_set_drive(DeviceState *dev, const char *name, if (value) { ref = blk_name(value); if (!*ref) { - BlockDriverState *bs = blk_bs(value); + const BlockDriverState *bs = blk_bs(value); if (bs) { ref = bdrv_get_node_name(bs); } -- 2.9.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmQnk-00088Z-F0 for qemu-devel@nongnu.org; Fri, 10 Mar 2017 15:06:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmQnj-0002Ro-Gi for qemu-devel@nongnu.org; Fri, 10 Mar 2017 15:06:12 -0500 From: Krzysztof Kozlowski Date: Fri, 10 Mar 2017 22:05:50 +0200 Message-Id: <20170310200550.13313-3-krzk@kernel.org> In-Reply-To: <20170310200550.13313-1-krzk@kernel.org> References: <20170310200550.13313-1-krzk@kernel.org> Subject: [Qemu-devel] [PATCH v2 2/2] qdev: Constify local variable returned by blk_bs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-trivial@nongnu.org, Krzysztof Kozlowski Inside qdev_prop_set_drive() the value returned by blk_bs() is passed only as pointer to const to bdrv_get_node_name() and pointed values is not modified in other places so this can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski --- hw/core/qdev-properties-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index c34be1c1bace..0d40ce682d05 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -405,7 +405,7 @@ void qdev_prop_set_drive(DeviceState *dev, const char *name, if (value) { ref = blk_name(value); if (!*ref) { - BlockDriverState *bs = blk_bs(value); + const BlockDriverState *bs = blk_bs(value); if (bs) { ref = bdrv_get_node_name(bs); } -- 2.9.3