From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA2A817F36C for ; Wed, 10 Apr 2024 17:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712768551; cv=none; b=Mpe4PuKks53+mfPtbf1MGBvHVzXQJPJAGbl41gQOFAVOZjOjIZn3cqZqn0LUoMdeaDogWhE+aK8Bv8XVwuzZJv4CXDV86oLQs7DlegRPunHpFx9vG0gb9Ti3pzUrcBCf9d+atZvXq43P4gyFuiWUe8HyQhCHw6jjo/7UypZSrnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712768551; c=relaxed/simple; bh=Ro3xK5q4IrY0T9S12NVIoXoa4EqFPVxp3QMVafHPnmk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jiEUKGUWz7lazirvMCkNtg/hQEGNdN4MhnM44bV4vJ2ECUlJKev/DV0cVgQZkjQuyJ4EJItqRxUAmMOXA8aijF3eN2jvrAQOJft8AEcP/B6aRUU7uLxaaGT3JYs/pkGxPyuQQ6ZP50J2Pyl7TxIS5iIFSWGZSBq9WnW8sVHprZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gCJdMayQ; arc=none smtp.client-ip=209.85.167.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gCJdMayQ" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3c60019ee02so483642b6e.0 for ; Wed, 10 Apr 2024 10:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712768548; x=1713373348; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uMoPP11thXk4/7UbTWGCDNVZtlBCq9YfZi08dxGpwkM=; b=gCJdMayQNcptgjdyj0XaPYS/CKWxiizmrKkPOZNY0BJquD+IwfqjDWiRiNpCUs33P7 +YVtVAie+wmxlztmBDbeqrmxb/AN5GmAoISgmi9wEM3M7BQBgROwPk9vcIy+DEtsYsi1 S+HtUFuuH4cYepRdrbjYd3Sib1mPdNt+lgDkERubGTY/9qmT8+re7qk6sx9vYgGqeMvW 0Rte4kJkErC8SJggf/EXJasb0QhCZP/hJwyukXcOa9Neb7BJjdyxiA3ZJpPAbhjk01Kl Ud9klQBZNxFct+Qj+nPL2xlmiR+eUnAgnrD6+Ey0tGebf3ydWAJ31bKorzKk8VvMsfZ7 1Y2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712768548; x=1713373348; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uMoPP11thXk4/7UbTWGCDNVZtlBCq9YfZi08dxGpwkM=; b=WBV10rg6p53Wt+1nsmg02YqEJWdEGJUreHPlujB59FX8o7ryIBWldKRyDRgD9XJb03 tE+9SNjBip9Abej0oL53NP8fGo+ONHfG9Zi1ppQQH8ki/BgYVOZ5saGjTzN8SDhVayiN MDgEk5oh/9reU9qa8llTw064ICwzyAF4tQP79HSxDA9rw/0ZmKyXpfn6uAuJ6QkEjj5b Pz7a8KLzSNEgcoVxx1VscKMtE3rPMq/y97Z7fChhmLyd4I9SwsTku9TcpgFqMsTh1oe6 tDsZQnbuBeWdTgWTqaq3KNPNh33AOn/K1v52aIW1chRcdm5UQ+cA7Jqn6aUu8yXUEbm+ bZpQ== X-Forwarded-Encrypted: i=1; AJvYcCVYBx6CmcPnVsmaN+Ac3OY1qyG9NguESpOWFjy/PHzX+MqqpPztcGGfHwJoW3hic/iYzDAr3/7nGJWfXeJXaSSJLWsEkaianN9PZU12 X-Gm-Message-State: AOJu0Yx+0x5GtrhRqbQmPTtpuwet//Dw29espOmATG7Xmg7Fb31uA5vG PyMtMS7xQmK7+rcxnxVp2aFcQqTIOD2aZ2WiasrpetPnxHOdcAZt28RqVYakv8UjkLaWsG5Wgj7 X89Qh7qxDI+hR+ct8N+aafAPyDyYuaG54zNQQ5g== X-Google-Smtp-Source: AGHT+IFNF1nhZXvybXgcJEFh8M4RKpKSYief0sXA9TsDfyic6FFts1F5HiYeJTzbEnw67nBhXnq5gM9nLeSrRUK3LkY= X-Received: by 2002:a05:6808:20a3:b0:3c5:f831:5f33 with SMTP id s35-20020a05680820a300b003c5f8315f33mr3792446oiw.16.1712768548028; Wed, 10 Apr 2024 10:02:28 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240410153212.127477-1-adrian.hunter@intel.com> In-Reply-To: <20240410153212.127477-1-adrian.hunter@intel.com> From: Naresh Kamboju Date: Wed, 10 Apr 2024 22:32:16 +0530 Message-ID: Subject: Re: [PATCH] bug: Fix no-return-statement warning with !CONFIG_BUG To: Adrian Hunter Cc: Thomas Gleixner , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Vincenzo Frascino , John Stultz , Stephen Boyd , Peter Zijlstra , Randy Dunlap , Bjorn Helgaas , Arnd Bergmann , Anna-Maria Behnsen , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 10 Apr 2024 at 21:02, Adrian Hunter wrote= : > > BUG() does not return, and arch implementations of BUG() use unreachable(= ) > or other non-returning code. However with !CONFIG_BUG, the default > implementation is often used instead, and that does not do that. x86 alwa= ys > uses its own implementation, but powerpc with !CONFIG_BUG gives a build > error: > > kernel/time/timekeeping.c: In function =E2=80=98timekeeping_debug_get_n= s=E2=80=99: > kernel/time/timekeeping.c:286:1: error: no return statement in function > returning non-void [-Werror=3Dreturn-type] > > Add unreachable() to default !CONFIG_BUG BUG() implementation. > > Fixes: e8e9d21a5df6 ("timekeeping: Refactor timekeeping helpers") > Reported-by: Naresh Kamboju > Closes: https://lore.kernel.org/all/CA+G9fYvjdZCW=3D7ZGxS6A_3bysjQ56YF7S-= +PNLQ_8a4DKh1Bhg@mail.gmail.com/ > Signed-off-by: Adrian Hunter This patch applied on top of today's Linux next-20240410 tag and build test pass. Tested-by: Linux Kernel Functional Testing > --- > include/asm-generic/bug.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) -- Linaro LKFT https://lkft.linaro.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D493BCD128A for ; Wed, 10 Apr 2024 17:03:19 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=y09VKzG+; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VF8Kf1rPlz3vfh for ; Thu, 11 Apr 2024 03:03:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=y09VKzG+; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linaro.org (client-ip=2607:f8b0:4864:20::22f; helo=mail-oi1-x22f.google.com; envelope-from=naresh.kamboju@linaro.org; receiver=lists.ozlabs.org) Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4VF8Jp0x0Xz30f8 for ; Thu, 11 Apr 2024 03:02:32 +1000 (AEST) Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3c5fea1bb42so376169b6e.2 for ; Wed, 10 Apr 2024 10:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712768548; x=1713373348; darn=lists.ozlabs.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uMoPP11thXk4/7UbTWGCDNVZtlBCq9YfZi08dxGpwkM=; b=y09VKzG+ljFg4wpi1EW4d/+PpFeJRloeC32G5KnKOzUHDm0874lLGO0QWSjZ4NpsEx 4XDUCxDu8yddtPSZB4XkMAlclBwH90JNfsa9GMq3T0DFQXYhdmThA2FEtbvOWclU+SgD jMqAkyybXR8MornWW0CvOEEJdhx33s0iV5amMTi+pa/7aEHLLHcAElx5gz1KhDVN5TsK yEi6aHg+zm5k7PlATZNmkLKTwYhBfbKCHpPJskAAATfPDjqxvo9d53oJCjZAd4Gwkxnq 1ZO/Lj2ofmUhlA3+E8AUsN2qsIH4l795TELRrL6yaoexY+kZAqkmgQnsRokF4Y90ZEYY ogww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712768548; x=1713373348; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uMoPP11thXk4/7UbTWGCDNVZtlBCq9YfZi08dxGpwkM=; b=hq7zmoVgh4ZKvx+3r8Z2+Qd9ZebY78esRwtTo3rkkZRmbu+G+UOvMeSloyLLlbSsra 4Ng25REbf6slQqiojvgS1WKOHuRrxZiHqHw9YRr10Osi+J9jzupQfLpO8IWbw4snLeY3 PESeediT2PiR8SnBWzYeVhNkluzKpdhEpBEm9A/ul4eRAlrfQYmOFOGHK63FPRZzH1h2 5lDB1q23SbAghO2zj5sMQtX+KN6EmElZzRjeY4H300qLg2kIzfDpDV+JgjFHP4Cz0TV3 sRH6DnUF8VlWBzWd/EHCsuLqlCF9qEIkPDg72IEn+LzTSmGeyJjqBdY3eEFV+/JR9Ga9 1kxQ== X-Forwarded-Encrypted: i=1; AJvYcCWYmMvCgrt7quRmVJPeUYjQxcE/WqhtrRzYtxQqdnJUkKiclxQ3Twoci7OKLX7yPXsSj/ivw3NlqI4er3og8zhoIg59EU3SMfkEE09s2Q== X-Gm-Message-State: AOJu0Yxg+sD0XUzmUxa9JAAp0CM8Og3dsNjQWwWRvN9I4gx0TVkvMo85 N74wP32F1OHTGF2w/5yWWN+zE8xCKbRxdW0tnZra2i64MD+0kwzB5G8KA9+GtKePQ5as3LsWNvH TJ0xJUePSb4JhQYWWY8CqfgBtf0/KvWmSV1hzvg== X-Google-Smtp-Source: AGHT+IFNF1nhZXvybXgcJEFh8M4RKpKSYief0sXA9TsDfyic6FFts1F5HiYeJTzbEnw67nBhXnq5gM9nLeSrRUK3LkY= X-Received: by 2002:a05:6808:20a3:b0:3c5:f831:5f33 with SMTP id s35-20020a05680820a300b003c5f8315f33mr3792446oiw.16.1712768548028; Wed, 10 Apr 2024 10:02:28 -0700 (PDT) MIME-Version: 1.0 References: <20240410153212.127477-1-adrian.hunter@intel.com> In-Reply-To: <20240410153212.127477-1-adrian.hunter@intel.com> From: Naresh Kamboju Date: Wed, 10 Apr 2024 22:32:16 +0530 Message-ID: Subject: Re: [PATCH] bug: Fix no-return-statement warning with !CONFIG_BUG To: Adrian Hunter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Dave Hansen , John Stultz , "H. Peter Anvin" , Alexander Gordeev , Vincenzo Frascino , linux-s390@vger.kernel.org, Arnd Bergmann , x86@kernel.org, "Aneesh Kumar K.V" , Ingo Molnar , "Naveen N. Rao" , Christian Borntraeger , Vasily Gorbik , Heiko Carstens , Nicholas Piggin , Borislav Petkov , Andy Lutomirski , Bjorn Helgaas , Thomas Gleixner , Anna-Maria Behnsen , Stephen Boyd , Randy Dunlap , linux-kernel@vger.kernel.org, Sven Schnelle , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 10 Apr 2024 at 21:02, Adrian Hunter wrote= : > > BUG() does not return, and arch implementations of BUG() use unreachable(= ) > or other non-returning code. However with !CONFIG_BUG, the default > implementation is often used instead, and that does not do that. x86 alwa= ys > uses its own implementation, but powerpc with !CONFIG_BUG gives a build > error: > > kernel/time/timekeeping.c: In function =E2=80=98timekeeping_debug_get_n= s=E2=80=99: > kernel/time/timekeeping.c:286:1: error: no return statement in function > returning non-void [-Werror=3Dreturn-type] > > Add unreachable() to default !CONFIG_BUG BUG() implementation. > > Fixes: e8e9d21a5df6 ("timekeeping: Refactor timekeeping helpers") > Reported-by: Naresh Kamboju > Closes: https://lore.kernel.org/all/CA+G9fYvjdZCW=3D7ZGxS6A_3bysjQ56YF7S-= +PNLQ_8a4DKh1Bhg@mail.gmail.com/ > Signed-off-by: Adrian Hunter This patch applied on top of today's Linux next-20240410 tag and build test pass. Tested-by: Linux Kernel Functional Testing > --- > include/asm-generic/bug.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) -- Linaro LKFT https://lkft.linaro.org