Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp768252ybl; Wed, 11 Dec 2019 07:14:26 -0800 (PST) X-Google-Smtp-Source: APXvYqz3GBduDnsNN71L7TnMl/TtYeSzqi25zEDCi+ZBD2JXByjxZ7qC5S82UlrR4o66nN7xgv1k X-Received: by 2002:a9d:7d9a:: with SMTP id j26mr2743384otn.283.1576077266729; Wed, 11 Dec 2019 07:14:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077266; cv=none; d=google.com; s=arc-20160816; b=MpD+tEKGVQKS0W5DtlaxDjo1ME2YthximbZ3LoyPTnfHZLJ2vMXjw71StTe31zfUnv i0T/imu7gOn7OvUSptC5KPVc33RjOEYtyM+HIvXymKLZ2TSkARf9fbAMcRFb1jb0uFm7 0VA4l7Kk74zMVCkRsByXLemnbl+BJ6OIVomxPvrKGlvMPMzNYjlQESJ84+PEEq3LDonQ afUsnPgOQ6ye5SMBMk8hofM4e8/78CH2XXqIqPHFCx5DQ1bVAMskccEbgebtJy2KmQE3 jl2k6ab+d7DPQVRG73+5CWThZG1Yj0wymOjWEYQbDtUcwNYu0NvZzDPNz+HHrso/RnqY 0IEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MBhOiT5ICdLjLtMgNsvSTBhKD/LnC9MViD4pjlc7s3w=; b=HMpjCx9rV5FWlH0UZxad/rlaCt0nqc2cssZnLn+wmtAxksEXyg+mlMcbNFF9q3rrMe 2Dhkok2FBldcQqPHlrwf1MpEctIJF5Ejuey9uOFqMC3G8nD7IEhkRI5sUSePFmhj0JAV vC5PHfcUXX5Bg02MLs5CI32AO3VlzqGtdLG3bDfsFTCugRYUd0gB5mPDP6jX0jMtntJD bAPcy6INqk8RY7bbs3VfXl0qPMyxmH1MFfU7wPQ5yL59Y6TCPr9yLPSeBocIRHpucKXN 19Ou6FQLiYLO93Pfl6IxMfXKYW8Vpte42d8SVEHE4yyQ9xLXyROqSPRKWqTViNMMVz4U hCwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MrTYt0YB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si1329502oib.70.2019.12.11.07.14.14; Wed, 11 Dec 2019 07:14:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MrTYt0YB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731260AbfLKPMy (ORCPT + 99 others); Wed, 11 Dec 2019 10:12:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:34396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731184AbfLKPMg (ORCPT ); Wed, 11 Dec 2019 10:12:36 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E4F8208C3; Wed, 11 Dec 2019 15:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077155; bh=i6bwU4k5km/tQMwuOoi84zsapnp/3wetQ4uiUCbzzic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MrTYt0YBJEjq32nw0oatJyGlzimt58qyJWDfQkeDbv0ZdWS7ANbq+x61CIOOyV4rb Jo0btyV5/mvzvO5/toIt2R59sdAogoXI+MOXEic83+ZhrpYvneQQxMa7B/VE5i7pX/ H+03RRqxA3j2Tl6yIpcZcQsjKAbNd3nHkpzZnoco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Ilya Dryomov , Dongsheng Yang , Sasha Levin Subject: [PATCH 5.3 036/105] rbd: silence bogus uninitialized warning in rbd_object_map_update_finish() Date: Wed, 11 Dec 2019 16:05:25 +0100 Message-Id: <20191211150234.019427732@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilya Dryomov [ Upstream commit 633739b2fedb6617d782ca252797b7a8ad754347 ] Some versions of gcc (so far 6.3 and 7.4) throw a warning: drivers/block/rbd.c: In function 'rbd_object_map_callback': drivers/block/rbd.c:2124:21: warning: 'current_state' may be used uninitialized in this function [-Wmaybe-uninitialized] (current_state == OBJECT_EXISTS && state == OBJECT_EXISTS_CLEAN)) drivers/block/rbd.c:2092:23: note: 'current_state' was declared here u8 state, new_state, current_state; ^~~~~~~~~~~~~ It's bogus because all current_state accesses are guarded by has_current_state. Reported-by: kbuild test robot Signed-off-by: Ilya Dryomov Reviewed-by: Dongsheng Yang Signed-off-by: Sasha Levin --- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c8fb886aebd4e..64e364c4a0fb8 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2089,7 +2089,7 @@ static int rbd_object_map_update_finish(struct rbd_obj_request *obj_req, struct rbd_device *rbd_dev = obj_req->img_request->rbd_dev; struct ceph_osd_data *osd_data; u64 objno; - u8 state, new_state, current_state; + u8 state, new_state, uninitialized_var(current_state); bool has_current_state; void *p; -- 2.20.1