Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4178141pxj; Tue, 15 Jun 2021 17:34:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBclfU5XABwHYpzW727FMieIq63lJsDgZOnnPL2HW23pF89BcJDH0eRCgr4UEFz3O2f+r0 X-Received: by 2002:a05:6402:350a:: with SMTP id b10mr868311edd.238.1623803670784; Tue, 15 Jun 2021 17:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623803670; cv=none; d=google.com; s=arc-20160816; b=QgywK/SKpsvQb6pZkj/xo94vN/NvEjHZnCnoLcOOqaSKQgfNnI0bRovsRSc+z1ioYr aQDnxw38/uEsL3YfFJmEYNLvFOudF1pbKP0iDYIOiJoLOcS3Oq8Zxp07mYA6vtGO7OOM HTZBv41IEb22tERyfNRNliqHTIWYZcc0WylN95Lnc5MgIV/XPBxYI3nJRoT7uexAcWQF ziysI9NSN1rwJkNyt7WVoHedyeM2EewicZdwVHTyDX7FLwNyObybIeStxqV3FEQ4XawA E5y3cS5HD7pyt1XNYUnVDlSUFzT+Yvie+a2mVSg+hkqK0fP/5whs6DwmnLDtamm/SP5s iPXQ== 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=CBfvBtPeeZ+txOyCfuRZiBcTJq4klTe+mp15Vdy8/1A=; b=y42cD/LuXmX+cRJLs7gidGR/YRjwo3KJB4eJqh0hsOEdQ6DpIcnVDABKoIQJBRquUP 8IGq4lZdibL/Os+ADkBk0TP4Hfw5N+O0ei1XYpaGZPO8TcjDBlglW6n/sRR2UF10d50T uvviKTCR+dmPzQwVS8BvjwGKpky7rRbBbG0qK+rAcSxwyNvXj+ZQsSXn0aeKMDhRGYS5 gvB+s8BF3ekVf3ynisKdAj13OBTE0eyTL2I+7eE8oklmTZ1N4DOI0XbvLTl54K/Sg5v9 bn/bj/P7SVZDYRZb4bj/AjVItY79EVMstn/k//0inUfGusoun4F2q5kzW/jdB6Fq5EKP FxpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=SmeDvHt0; 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 o5si386728edc.244.2021.06.15.17.34.08; Tue, 15 Jun 2021 17:34:30 -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=SmeDvHt0; 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 S231499AbhFPAfL (ORCPT + 99 others); Tue, 15 Jun 2021 20:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbhFPAfL (ORCPT ); Tue, 15 Jun 2021 20:35:11 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06A04C06175F for ; Tue, 15 Jun 2021 17:33:05 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 131so1228075ljj.3 for ; Tue, 15 Jun 2021 17:33:04 -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=CBfvBtPeeZ+txOyCfuRZiBcTJq4klTe+mp15Vdy8/1A=; b=SmeDvHt0uOBK4zkN8iVTIqG+FjaChfdwC2QGIxtkRL4PGE0lM8qGLzbl4cRN7HzV5w jO2VtBLzpPVhsTyfy7YZsAbgvV+j8Nc61Qw+wNUiccqLf5kSFaP0Zub0/uHF5dtn68Nw 1mjlMKuoILO0G/BzShMseFzUbIY2yTZDFBTKI= 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=CBfvBtPeeZ+txOyCfuRZiBcTJq4klTe+mp15Vdy8/1A=; b=ZBKY/HP3Jc1HUJ8+XzVj0/o3K9ZopOgjX9eTmQPEGEk+BZdchbpOEjgsJ2p2tHTsza KByBRjzAr2LCQ0vmWjF/OrvDqeWJx5gvBsYFGMxxZoM2FWsat+mBSPlY1gdhjsDPPGkk AZnjhESoyHU1T4XH+PdY9PYMvNSqOW6wPVV7FAqN46RC+HR83K19A8wu/gNH6R00mBS0 IB+/O8ZEAV0dtJfJ1LdqcZEsT3xXpoogkLxNiDHhqBVPnfu3pWnHfDnZUxMebHD9MwU/ FrZt3OuCrZjVLR+DhXHd8ZWqeLtnj/UDHgaXRECkU4i7mbuMCntRbH1f34ytgLvAdYlx 72ug== X-Gm-Message-State: AOAM533URLoLpqGmiAMUM1oidQsd4JZYYxaZkw08wFtpPotY27Cg1w/o K9ayRtnZrW0ieN/FSpdbcclX+aZ5T3UIkk8NL10= X-Received: by 2002:a2e:8758:: with SMTP id q24mr1957101ljj.212.1623803582937; Tue, 15 Jun 2021 17:33:02 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id c9sm46483ljr.104.2021.06.15.17.33.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 17:33:02 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id x14so1196458ljp.7 for ; Tue, 15 Jun 2021 17:33:02 -0700 (PDT) X-Received: by 2002:a2e:9644:: with SMTP id z4mr1939304ljh.507.1623803581822; Tue, 15 Jun 2021 17:33:01 -0700 (PDT) MIME-Version: 1.0 References: <162375813191.653958.11993495571264748407.stgit@warthog.procyon.org.uk> In-Reply-To: From: Linus Torvalds Date: Tue, 15 Jun 2021 17:32:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] afs: fix no return statement in function returning non-void To: Randy Dunlap Cc: David Howells , Hulk Robot , Zheng Zengkai , Tom Rix , 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 Tue, Jun 15, 2021 at 4:58 PM Randy Dunlap wrote: > > Some implementations of BUG() are macros, not functions, Not "some", I think. Most. > so "unreachable" is not applicable AFAIK. Sure it is. One common pattern is the x86 one: #define BUG() \ do { \ instrumentation_begin(); \ _BUG_FLAGS(ASM_UD2, 0); \ unreachable(); \ } while (0) and that "unreachable()" is exactly what I'm talking about. So I repeat: what completely broken compiler / config / architecture is it that needs that "return 0" after a BUG() statement? Because that environment is broken, and the warning is bogus and wrong. It might not be the compiler. It might be some architecture that does this wrong. It might be some very particular configuration that does something bad and makes the "unreachable()" not work (or not exist). But *that* is the bug that should be fixed. Not adding a pointless and incorrect line that makes no sense, just to hide the real bug. Linus Linus