Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3889914pxb; Fri, 11 Feb 2022 09:58:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdopaSCclntZ75L0zSs/uoCqKyt4yweI7KxBQRo2KKuz6AQqpkJxuWujJhnjDLzkkhc0xZ X-Received: by 2002:a05:6a00:174b:: with SMTP id j11mr2874975pfc.19.1644602322841; Fri, 11 Feb 2022 09:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644602322; cv=none; d=google.com; s=arc-20160816; b=FcyijP0vJZN0KFpRRBavuUDVE2MHWwPhNpP8zMq1YK936FfhFVignN9UfeRk/rvenf i2Ou6WHy5VrXVZTrZWKcE6/0JnX1jcENZdlpsHen8pLW7tE2x6aeGfqwaTqhGOzP68JP d662DhDEMhZpNYKXf5DXEB5VnM9IhavaU3V+tiht7Ra7a1LoXwNkgkw1mbRHAzAXsyUF LaSkNagbk/naZKz9q4L5QDmgWd1fG5My9cE1H3VvA2elMvmawfLmHhYX+Zxv061QbPnu /JhHOZXZ67/wt3+NM7XaUKm5OdJ2jDtXOXpWqzILIVXYa29428UIScImKVxK/rVUGwSh ajow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+VigcQLytz0iuHCE+k+y78JnvvZ09aQp4DOS6f0o7TM=; b=R8YUaDy0oSRsXf8uCij0USvmab7GvR4JLtB3dLAQQ/LvjN9yCUWoMsrD017y1IEHGx aGkgzmJKbeb4RqMKIDqT1TRc5v5MIzVGOU4Owx17mrkvyUpvO4Km8RYmJz3rPPbfWShz JGWF3mCMxG/vOhvbvVATwGovm4T7a+RpRPrAMl5yLObeR5Hdn/t5f9LFa5BH9gSQJHHx +FPYU7iL4JdxJsuo5l6WDBKPyTyuLE+xqBlESv24NujVnE0PM+T+kI/KoVa/6OfHFfvS Ny61RsxUyowufIJm3qf7Y+K1ZzRvdqYn8TlMenOBaW65jkEjjS5jK9FjxgAKJz0T6sn7 S+NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dAh1C5a3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9si25139544pgu.353.2022.02.11.09.58.28; Fri, 11 Feb 2022 09:58:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dAh1C5a3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345875AbiBJXss (ORCPT + 99 others); Thu, 10 Feb 2022 18:48:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244555AbiBJXsr (ORCPT ); Thu, 10 Feb 2022 18:48:47 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AE75F80 for ; Thu, 10 Feb 2022 15:48:46 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id w20so3225138plq.12 for ; Thu, 10 Feb 2022 15:48:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+VigcQLytz0iuHCE+k+y78JnvvZ09aQp4DOS6f0o7TM=; b=dAh1C5a34PseGXHmaQZfM4wxYL4wwblUd5jDt5LLve2vU6jWUhtwN8MKnJNOf2qufB lLDHDA3elq1Y16fxoyykEwvdijWHwc7OFoKWI14jMZpOT3WpuvHCKRIZu2l8t+rAqmsE SJZTBCTMhb6eQRwZsHqdo4hY7alEqRycNqGHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+VigcQLytz0iuHCE+k+y78JnvvZ09aQp4DOS6f0o7TM=; b=Y1xdn4DVxN/OJsq3AYasJMq7apVgjNE7Jvt4uf556QjtviwFPrG7PYvT3v9fjmV586 m5u3IezsLV3hRw5t61nMR6rP9Cl/xFolLWRevrXk1u8jnyHuomFzLUn83+Hvd/mrhDLS jAfQevLfQXbs4KY1jljmGayXsZ9XZwE3v3dCdouwzN5Wn223gjJDm2NWNeQQlkwLJlKd 9UnxpdAwzMJpEm7CXWudGE9U1Hfg5tgL5S/miypMyZqrqsz+fj5FILk8FeHvoMoM9Kle EciRGtitRGsnhge37W+KKx17AduFH9JnfCkdLlAnN6Byjmh9pVPl3FSDXXo2NPWltGHa J4rA== X-Gm-Message-State: AOAM5301RBNFC4YnVou4LKAu9anSFzysWveH24XfAGaT//WqPhXC/B0Q GA3B+kl4qwhpX4qEnKDYlRwZ5A== X-Received: by 2002:a17:902:ef49:: with SMTP id e9mr9590070plx.56.1644536926217; Thu, 10 Feb 2022 15:48:46 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j3sm18279269pgs.0.2022.02.10.15.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 15:48:45 -0800 (PST) Date: Thu, 10 Feb 2022 15:48:44 -0800 From: Kees Cook To: Victor Erminpour Cc: a.zummo@towertech.it, alexandre.belloni@bootlin.com, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, trivial@kernel.org Subject: Re: [PATCH] rtc: pcf8523: Fix GCC 12 warning Message-ID: <202202101548.D2CF8DAC@keescook> References: <1644453027-886-1-git-send-email-victor.erminpour@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1644453027-886-1-git-send-email-victor.erminpour@oracle.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 09, 2022 at 04:30:27PM -0800, Victor Erminpour wrote: > When building with automatic stack variable initialization, GCC 12 > complains about variables defined outside of switch case statements. > Move variables outside the switch, which silences warnings: > > ./drivers/rtc/rtc-pcf8523.c:284:20: error: statement will never be executed [-Werror=switch-unreachable] > 284 | u8 mode; > | > > ./drivers/rtc/rtc-pcf8523.c:245:21: error: statement will never be executed [-Werror=switch-unreachable] > 245 | u32 value; > | ^~~~~ > > Signed-off-by: Victor Erminpour Thanks for finding these! I haven't done any cross compiles with GCC 12 yet. :) Reviewed-by: Kees Cook -- Kees Cook