Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6437170rwb; Wed, 18 Jan 2023 05:18:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXsPuLFqS1NxJq73b/xJE/gahHT6GPibJkuvKBtzlzf6OwrXxYEnV620NKvOFZoo9bp1UzM8 X-Received: by 2002:a05:6402:1151:b0:498:216:ee4a with SMTP id g17-20020a056402115100b004980216ee4amr7447479edw.8.1674047886976; Wed, 18 Jan 2023 05:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674047886; cv=none; d=google.com; s=arc-20160816; b=h9T9uODMSULHl81/pSNbJHwGbrqPCF4Q1RgBu1YMCPQkw/VDFVcvGgT+307VNDFsk+ n7Cj+qd1sn3zMqR979o3ei1A/30Pf1iJXTeeXipoFP7fDX+mT3iMFb9R5WRJu1XP45RT mtDSE8dWzw9ZSZt9pqMOeqxz36BmRdfehUfJ/rr5qAAA2mdcdWfeLvnrhfhDrPaE1idD /ZQYBbTGvdoQoeDDq+WWXhoTK/cFAPVMF+a4cnsyKQBAx20kiWXlYYaa4kwiWEd2e0WT arpzdxQ130zEqC5jMrOaIgn0lxQvfO9ylIQfWWv670JUj6VllJA3ufzUYG1992v7/43p In0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Jx2PCGI6GufPJPjOowt4wYY0IR2WvTJsEuqsBxWDOGE=; b=HLrw/5N+xTmXs/MmXZJI54TNqh8UeWx2q3t/v/yc6KP7s+eh2FTE2himbp39YiXCgm lbQMaL2Kuh/EyhcVotuc/iC9zNTbE5FNkKJSiWNRJzYqDWXEB+DUwgKKHP/LXSWUSRbu mh0CwKPXva0nSKlAVQ1umwXgfG406gE+4ZKeG3UgcOGJHbkzhGktwmm0NHu+YUi9B7wb foo/r03QkS5nPVQn19Ak0S6Kz3p90Y5aZbl1T6tXClzK4sky4cN+Bk/6iKfLFSu5gvja YokeJWZ1dtzYBqkYFeR2JHonAh2kNT+lO8W7+bQ4LM4tIojFR2kTlT0kGEdRbsJDsmah fpkQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a05640240cb00b0049d3f37b767si16033193edb.268.2023.01.18.05.17.55; Wed, 18 Jan 2023 05:18:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjARMYo (ORCPT + 45 others); Wed, 18 Jan 2023 07:24:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbjARMXS (ORCPT ); Wed, 18 Jan 2023 07:23:18 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FDDC65F00; Wed, 18 Jan 2023 03:45:03 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 491331477; Wed, 18 Jan 2023 03:45:45 -0800 (PST) Received: from [10.1.196.46] (eglon.cambridge.arm.com [10.1.196.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B5EE3F71A; Wed, 18 Jan 2023 03:45:02 -0800 (PST) Message-ID: <99b295ed-7157-0c95-cafb-9cf8afdf41f2@arm.com> Date: Wed, 18 Jan 2023 11:44:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH] ia64: Fix build error due to switch case label appearing next to declaration Content-Language: en-GB To: Sergei Trofimovich Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, matoro , =?UTF-8?Q?=c3=89meric_Maschino?= , Andrew Morton References: <20230117151632.393836-1-james.morse@arm.com> <20230117193109.5650fd6f@nz> From: James Morse In-Reply-To: <20230117193109.5650fd6f@nz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 Hi Sergei, On 17/01/2023 19:31, Sergei Trofimovich wrote: > On Tue, 17 Jan 2023 15:16:32 +0000 > James Morse wrote: > >> Since commit aa06a9bd8533 ("ia64: fix clock_getres(CLOCK_MONOTONIC) to >> report ITC frequency"), gcc 10.1.0 fails to build ia64 with the gnomic: >> | ../arch/ia64/kernel/sys_ia64.c: In function 'ia64_clock_getres': >> | ../arch/ia64/kernel/sys_ia64.c:189:3: error: a label can only be part of a statement and a declaration is not a statement >> | 189 | s64 tick_ns = DIV_ROUND_UP(NSEC_PER_SEC, local_cpu_data->itc_freq); >> >> This line appears immediately after a case label in a switch. >> >> Move the declarations out of the case, to the top of the function. >> >> Fixes: aa06a9bd8533 ("ia64: fix clock_getres(CLOCK_MONOTONIC) to report ITC frequency") >> Signed-off-by: James Morse > Out of curiosity what compiler version behaves like that? I think I and > matoro build-/run-tested it on gcc-12 and maybe gcc-11. | # ia64-linux-gcc --version | ia64-linux-gcc (GCC) 10.1.0 | Copyright (C) 2020 Free Software Foundation, Inc. | This is free software; see the source for copying conditions. There is NO | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The toolchain originally came from https://mirrors.edge.kernel.org/pub/tools/crosstool/ The really odd thing I'm doing is cross compiling for ia64 on arm64 ... but I wouldn't have thought the toolchain configuration was any different. > Thank you! > > Reviewed-by: Sergei Trofimovich Thanks, James