Received: from eggs.gnu.org ([2001:4830:134:3::10]:43944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnUPT-0006nz-PL for qemu-devel@nongnu.org; Mon, 13 Mar 2017 14:09:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnUPQ-0004Dm-Kp for qemu-devel@nongnu.org; Mon, 13 Mar 2017 14:09:31 -0400 Date: Mon, 13 Mar 2017 15:08:07 -0300 From: Eduardo Habkost Message-ID: <20170313180807.GK4694@thinpad.lan.raisama.net> References: <20170310200550.13313-1-krzk@kernel.org> <20170310200550.13313-3-krzk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170310200550.13313-3-krzk@kernel.org> Subject: Re: [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: Krzysztof Kozlowski Cc: qemu-devel@nongnu.org, Paolo Bonzini , qemu-trivial@nongnu.org On Fri, Mar 10, 2017 at 10:05:50PM +0200, Krzysztof Kozlowski wrote: > 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 Reviewed-by: Eduardo Habkost Unless another maintainer wants to take this, I am queueing it for 2.10 on my machine-next branch. > --- > 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 > -- Eduardo