Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3258690rdb; Tue, 29 Aug 2023 09:49:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrFq0WpdAZj/RLubcc8oTrqGcFDC1WjinpesRys+Gk7pOFGskJckMjXjCuZL4EbTGR9m70 X-Received: by 2002:a17:902:e842:b0:1b9:d2fc:ba9f with SMTP id t2-20020a170902e84200b001b9d2fcba9fmr22344429plg.11.1693327741990; Tue, 29 Aug 2023 09:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693327741; cv=none; d=google.com; s=arc-20160816; b=JRrfKRlXJqUL4RQKkRwM6HomzhdJvv7pATcsdk99ukBtpncXSpb32NiZjRkEUbeEaV b1Fb7nsRp9Bp4Aqq8mvd1q8M58J7cSJ5xG9WDuS4LDVPrqU23bmomjiyKXJxg0z/gHM6 8d+6m3S53Z8G8rNnYqFhT9g3iZ1Xec99MfKL9Z8TBI90uQTAUMlYhUVitSIe5kef4xwV K2BX5AqJZkVZXc/JvbCwfDnnLgOM3JdF59+s4IoxxVYkT9Va5D4H2cja2oUzkXmR92ky 26UdcNgOgL0Qt551WoPCYKipqQ50j+0bTOtCH1fwViRZnJVWAVGM7SjajzLy7jHyybyq wIvQ== 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=FXRkfd3bmLmJLS5a9VmJ1MOCtOoevOWzcqG51N/EaoI=; fh=jPZI8w8aUw0i2hpe7P1DmvihrSL+fbEsX730crIQw50=; b=Jp0VWlf1deW0dGcGIPDkZkNgcdo4h67Roi+4p5bf98gadQAzLvTQVzT+4o2+ymvR53 qE5mzqvJ8ly+pGTizu2Up46YmceQhKhdHlUBG+4Y7ogKuoF2QJyhDIcm7lMEQf1QwoE9 E1iV1QippgxAIxe0kipTPymDW/qe3i1EAV8faA9axywdo9/pR42nnjM+jaMoNmIqgPnY VqLMuLEQsJniKJJjxA93seZqXjcwZAC6kBWzrjUzK2ZEvyQbZvRhrmUcpIAhRtVfEJyR Pe0TLTyFTmQuQWKwjpm5ZVomXBsx9gyhuQ1ycTJ9JOaTJRi4x6U9wFSq7p498ui884Br a/bw== 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 u10-20020a170902e80a00b001bbc61fedafsi4939092plg.422.2023.08.29.09.48.45; Tue, 29 Aug 2023 09:49:01 -0700 (PDT) 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 S234047AbjH2P23 (ORCPT + 99 others); Tue, 29 Aug 2023 11:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237318AbjH2P2U (ORCPT ); Tue, 29 Aug 2023 11:28:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D451132 for ; Tue, 29 Aug 2023 08:28:12 -0700 (PDT) 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 043A92F4; Tue, 29 Aug 2023 08:28:51 -0700 (PDT) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0FB73F738; Tue, 29 Aug 2023 08:28:10 -0700 (PDT) Message-ID: Date: Tue, 29 Aug 2023 16:28:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/2] dma/pool: trivial: add semicolon after label attributes Content-Language: en-GB To: Christoph Hellwig Cc: Chunhui He , Marek Szyprowski , iommu@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230826085317.69713-1-hchunhui@mail.ustc.edu.cn> <6f936d6e-9f27-ba72-68de-0ed27c0dbbe1@arm.com> <20230829151216.GA4211@lst.de> From: Robin Murphy In-Reply-To: <20230829151216.GA4211@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 On 29/08/2023 4:12 pm, Christoph Hellwig wrote: > On Tue, Aug 29, 2023 at 03:22:22PM +0100, Robin Murphy wrote: >> AFAICS, what that clearly says is that *C++* label attributes can be >> ambiguous. This is not C++ code. Even in C11, declarations still cannot be >> labelled, so it should still be the case that, per the same GCC >> documentation, "the ambiguity does not arise". And even if the language did >> allow it, an inline declaration at that point at the end of a function >> would be downright weird and against the kernel coding style anyway. >> >> So, I don't really see what's "better" about cluttering up C code with >> unnecessary C++isms; it's just weird noise to me. The only thing I think it >> *does* achieve is introduce the chance that the static checker brigade >> eventually identifies a redundant semicolon and we get more patches to >> remove it again. > > Agreed. Even more importantly that attribute looks rather questionable > to start with as it can be dropped by just moving the #endif a little: > > diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c > index 1acec2e228273f..da03c4a57cebe3 100644 > --- a/kernel/dma/pool.c > +++ b/kernel/dma/pool.c > @@ -135,8 +135,8 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, > remove_mapping: > #ifdef CONFIG_DMA_DIRECT_REMAP > dma_common_free_remap(addr, pool_size); > +free_page: > #endif > -free_page: __maybe_unused > __free_pages(page, order); > out: > return ret; Oh, indeed - I hadn't really looked at the context itself. My non-exhaustive grep skills show a couple of hundred instances of label-above-#endif vs. three (!) instances of __maybe_unused, so ack to making that cleanup to just remove the question entirely. Cheers, Robin.