Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp868782pxj; Wed, 16 Jun 2021 15:51:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdvntm4ONH0l1dBPepdTgXihSZdRsl/SGWNATDrarZg9TqHLd1Xrf/K4KPP6Vjrqd9AnQ2 X-Received: by 2002:a05:6602:581:: with SMTP id v1mr1312097iox.192.1623883876322; Wed, 16 Jun 2021 15:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623883876; cv=none; d=google.com; s=arc-20160816; b=iTA/6PLP0GwbRz2z+GGNQNGTQQHuxFglKo9BNZ5fJ80O7/jFgAizJbvhsMklsLZUyz qJWLYM3DAL+AO5sfaGBnxmtKbU8JOF9m/U7g2T+m2Lt+Zn0QaHeJHkfexG1SaA4T5WLC C00+qj29vwLfx6rN0EXqAfPkVpgdouGh6RMLk9wpXljNPFbG+PXgeMBvBsK3bO3+1Z0e N4XaAVHcqC2EpTZoKF2KFkynpnGEvLwT2g7ZgMXf0G1q8cxKgWPFnotsKw1lkLFkgZOO g8zEoR7Edjvh1GjqM+pgYULXmYR8wXtbcInXFjHpJ3J+ppoi+YhUATShDOvu4mT8dXIe 54aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YkHWZdOJ4eKpmiNbLDcjXIKJtKDecWvikhN4M+R2kvo=; b=DcQRNLWyhWMpVzOSxpEelDECjZRyrvtSIN/k2F+epC3CUmZb1qOZPpXLCrBxz8GJro 3AEVpsnQefxBQdQNyiJ29w6Zxfo16MmK2iFZgTwmaQCJ9Nd1LuqW/0EVDtbbVT9rIVdj 9hlGhxtCvRGMSkmOIGKFfGuJQyJOtsrkPEclpdeWTYrZFqebxUBz+QGEUwC4CYFwVLML SjhU6omnTij8Y9HqzxnQ83U+481raj8g75ZLare8WXEyJyUIwSqef4pL5bZ6/tluIBr7 ByvaBIC8phBUMOeW8BRW+muzMAGD3IIskAlZ9VkeqHIym0u1N/L4JxkOoK+hExElL2vy MZ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=JxnWVbuR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si3873716ilc.20.2021.06.16.15.51.04; Wed, 16 Jun 2021 15:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=JxnWVbuR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233625AbhFPQb1 (ORCPT + 99 others); Wed, 16 Jun 2021 12:31:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234654AbhFPQb1 (ORCPT ); Wed, 16 Jun 2021 12:31:27 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70F26C06175F for ; Wed, 16 Jun 2021 09:29:20 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id q20so5330560lfo.2 for ; Wed, 16 Jun 2021 09:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YkHWZdOJ4eKpmiNbLDcjXIKJtKDecWvikhN4M+R2kvo=; b=JxnWVbuRB3VsapeDk3cTF4LBx8E/4o12zS7evfMX4Kjsjqv6fW9fXUvXtldc9Lbwa4 OWLKBb5Np3i2eJ36CLJnfbv0dpmQWa8gV1CcMLB9OnpV5nSckpeBhULvyumtP3sHddpT HAGJnep5fG2GyVLcp6TbXSqVZh4OHkU/5TP9I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YkHWZdOJ4eKpmiNbLDcjXIKJtKDecWvikhN4M+R2kvo=; b=TvVfXtKPBJ1ptnNwn36bMqCLlRR8ScoVCH1+vE/hdNuwPz/X8tOdClDZMJv4AJYfLN 00ZnjE9+qA1L7Ij7K3gVdUKZOgQj9a28M65aG9uD8z3H/LOEvEWI2kOemn4O2L+7LzMf 5bmKQW3YFds2b6IPvaBIHJbZdtAD5pSSWnueUxTEDr6pzgrQQCvUOUbER2Y9kleaWHyP Vi+QhhWOMf4kfgpI4RZmBwAKkIV95tn87zMkWAr6aUZZLUFB4KtLVfm3uwl2UgfTbLib csGTegNweeIA9d30yBLHERIlQKmVjL+OJ5KGjAl6BlWyqOLUCw9i6qM1Ipa6Pe8KO/Nk Nb0g== X-Gm-Message-State: AOAM531Py01PE/wViI7jiBlNTPIf1eS4HLS0qqBaKOikPaMmC3GfTvTV oZpfOQyJde82J50aKIHJItLxCPXJ1SHPqkXlbT0= X-Received: by 2002:a05:6512:3a4:: with SMTP id v4mr383261lfp.127.1623860958600; Wed, 16 Jun 2021 09:29:18 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id w17sm292656lfd.126.2021.06.16.09.29.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Jun 2021 09:29:17 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id l4so4784308ljg.0 for ; Wed, 16 Jun 2021 09:29:17 -0700 (PDT) X-Received: by 2002:a2e:2ac6:: with SMTP id q189mr589148ljq.61.1623860957409; Wed, 16 Jun 2021 09:29:17 -0700 (PDT) MIME-Version: 1.0 References: <162375813191.653958.11993495571264748407.stgit@warthog.procyon.org.uk> <051421e0-afe8-c6ca-95cd-4dc8cd20a43e@huawei.com> <200ea6f7-0182-9da1-734c-c49102663ccc@redhat.com> <9d7873b6-e35c-ae38-9952-a1df443b2aea@redhat.com> In-Reply-To: <9d7873b6-e35c-ae38-9952-a1df443b2aea@redhat.com> From: Linus Torvalds Date: Wed, 16 Jun 2021 09:29:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] afs: fix no return statement in function returning non-void To: Tom Rix Cc: Zheng Zengkai , Randy Dunlap , David Howells , Hulk Robot , linux-afs@lists.infradead.org, Marc Dionne , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 9:22 AM Tom Rix wrote: > > to fix, add an unreachable() to the generic BUG() > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > index f152b9bb916f..b250e06d7de2 100644 > --- a/include/asm-generic/bug.h > +++ b/include/asm-generic/bug.h > @@ -177,7 +177,10 @@ void __warn(const char *file, int line, void > *caller, unsigned taint, > > #else /* !CONFIG_BUG */ > #ifndef HAVE_ARCH_BUG > -#define BUG() do {} while (1) > +#define BUG() do { \ > + do {} while (1); \ > + unreachable(); \ > + } while (0) > #endif I'm a bit surprised that the compiler doesn't make that code after an infinite loop automatically be marked "unreachable". But at the same I can imagine the compiler doing some checks without doing real flow analysis, and doing "oh, that conditional branch is unconditional". So this patch at least makes sense to me and I have no objections to it, even if it makes me go "silly compiler, we shouldn't have to tell you this". So Ack from me on this. Linus