From patchwork Wed Apr 4 09:49:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 132803 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4841460ljb; Wed, 4 Apr 2018 02:49:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/BTVxF800eMSOW7nouU/ny0NUSYMfi+Wz0prvJVVPREt63yPh7xnB018JA9N6nW2xeCW+M X-Received: by 2002:a17:902:581e:: with SMTP id m30-v6mr16917134pli.406.1522835387126; Wed, 04 Apr 2018 02:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522835387; cv=none; d=google.com; s=arc-20160816; b=WkOznbnvhriQ1/QkCG/m/6RuVACoidUuEnsD9jAn5kn9pmqxB5beaUHoE4tbIHIBKn pzoJiMKFJnewjfvqg1Rk3NamcrweFVZdW3wr6ZHvASGje3sja+RWZg/KaR03tz1YnJTi HBW7wk3fbWwcPsd+l3f8iyI9ULISk5EXp30t16S3IEkPpNUZgbAU5KGn0ZixVyb8xW3U dBIJwlqXo1jY4Z+H/DgviwR5/5fsvtUzRSdCGCdldt4zPiQGoZznaCyewKxBbfLcuOYs 221zU+nWmgZlc4GbVovIxd4IGBG+c/beR8bFqrPYmf2cgGZ59qJ7yAxO0CJOge+vuLWG CTTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3COnzse2s9iHs2067oPK9EistN2mboceVNynsZlrTS8=; b=ZMfeYLev9gRiSJ/POWMdQMOMwEPFINTHhr5tY7uFp1hBqIQmFr/iDNzb/zkAoP9Onq FUCluFmG429tjWLxph5QkFxgXtdAgYyiKH3wkrydk7ahzEAeokXT/eMMWdAuWVNEn4yi Mu/jfnoCbQZT6tLZUJBXVoYs6j3f7WXCII59W5qwNqiO0Ynk452vpyBWO1q7I8xLW0EG P6ikWoBi6Vj8UTJsbjfa5p7RMIxT7Mu9PpnmfktomazJTg9X5nIun24N4zZvBwzYG9fA WU3pxpWFWR3vse0EhuPaaSFzd/i/wu0t9hCnf5LJLUCbFBMo1krozO91KuF/zIg0fISs LW6w== ARC-Authentication-Results: i=1; mx.google.com; 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 m11si3429800pgd.683.2018.04.04.02.49.46; Wed, 04 Apr 2018 02:49:47 -0700 (PDT) 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; 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 S1751213AbeDDJto (ORCPT + 29 others); Wed, 4 Apr 2018 05:49:44 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:39525 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbeDDJtm (ORCPT ); Wed, 4 Apr 2018 05:49:42 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0McPxo-1em8C43JKq-00HfVm; Wed, 04 Apr 2018 11:49:32 +0200 From: Arnd Bergmann To: Ilya Dryomov , Sage Weil , Alex Elder , Jens Axboe Cc: Arnd Bergmann , Jason Dillaman , ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rbd: add missing return statements Date: Wed, 4 Apr 2018 11:49:22 +0200 Message-Id: <20180404094931.2345742-1-ar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ClHAEOiVIx3ZI/eVnieBJMWwuSzKA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new set of warnings appeared in next-20180403 in some configurations when gcc cannot see that rbd_assert(0) leads to an unreachable code path: drivers/block/rbd.c: In function 'rbd_img_is_write': drivers/block/rbd.c:1397:1: error: control reaches end of non-void function [-Werror=return-type] drivers/block/rbd.c: In function '__rbd_obj_handle_request': drivers/block/rbd.c:2499:1: error: control reaches end of non-void function [-Werror=return-type] drivers/block/rbd.c: In function 'rbd_obj_handle_write': drivers/block/rbd.c:2471:1: error: control reaches end of non-void function [-Werror=return-type] To work around this, we can add a return statement to each of these cases. An alternative would be to remove the unlikely() annotation in rbd_assert(), or to just use BUG()/BUG_ON() directly. This adds the return statements, guessing what the most reasonable behavior would be. Fixes: 3da691bf4366 ("rbd: new request handling code") Signed-off-by: Arnd Bergmann --- drivers/block/rbd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.9.0 diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 07dc5419bd63..9445a71a9cd6 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1394,6 +1394,7 @@ static bool rbd_img_is_write(struct rbd_img_request *img_req) default: rbd_assert(0); } + return false; } static void rbd_obj_handle_request(struct rbd_obj_request *obj_req); @@ -2468,6 +2469,7 @@ static bool rbd_obj_handle_write(struct rbd_obj_request *obj_req) default: rbd_assert(0); } + return true; } /* @@ -2496,6 +2498,7 @@ static bool __rbd_obj_handle_request(struct rbd_obj_request *obj_req) default: rbd_assert(0); } + return true; } static void rbd_obj_end_request(struct rbd_obj_request *obj_req)