Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3258204rdb; Tue, 29 Aug 2023 09:48:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfZkjSRLwrsbwgt0h0bxtAEG+NhP+Xayqa+3EXOqNs2n4BpwbsaV74mysyfGw8Jads1Fbd X-Received: by 2002:aa7:820b:0:b0:68b:bedd:c2e9 with SMTP id k11-20020aa7820b000000b0068bbeddc2e9mr3514133pfi.16.1693327686102; Tue, 29 Aug 2023 09:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693327686; cv=none; d=google.com; s=arc-20160816; b=Te+N+m6WJrYn0MhtvvW7ryGz3vQDaGHEUQlNLW7gy6blXlPtzHP2bG+av170D+VqGS LfMyhXDTQj6qkoC6P8wKW9FImOijYYZLvq3DcuPQ0SVMiITO++3duminihR/2MzU8MSW +4lz//JHrDFs/wQvvc8DcgiWwt0PIhY+YKBriOxdYUzObu/OSBI1sNLOtqxY0pv5YdI8 tXf0QcIDD8lqiWcAgZutE0e6Y67b2156yDh1ZYvMSTtvI3ntIKsdPs3TITGdyXLIRvWV dwYL8NCsQYosUYvRkwKzA2QJ0+bA0W6cUUWuOE6XQNj3wPmIRU0/CkFi4BB8Sgb0Dtv8 sMKA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=E3nuC3uJAp0BdP6rqDYX9UrdHgeALwn+83dYNa3ZwXo=; fh=qN4K4455MAlze+HfqokEyh1uUDCi8+moPMG0vgBFqc8=; b=UFWtwpDhmhAonuGexBnNc7YQOX8IEPuY8xYy6rGPkQSWZrlWqSBjtgx4wutMsBCgGZ lNlVqmkZnevRbHdlRPQiD/nfOofXFEZSfd1uiu/KL6bO2jlMXSNbYZGX5WI7wTeqwCIh 4TelnZwx+tTOt4qD50Ak3QLZokN57wIzcnHSkdn8XtiQBSjZ09YgGk1zpK/7mJpD9pGu tciEdwNMLEv8Et0ZbZFEFfEIQjXtTqM+19NPGCrsXwDtuGplPGTxKQF4iYI6j/Sts6qz tLV+UBQFDufoC+KS5AEjNc02v1el9ul4ZvK/6WQPcarrK9wXVgsx/VCIdU+QOzO/73FO ElXg== 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 a22-20020a631a56000000b0055c0477e26dsi1144580pgm.475.2023.08.29.09.47.50; Tue, 29 Aug 2023 09:48:06 -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 S232217AbjH2OX0 (ORCPT + 99 others); Tue, 29 Aug 2023 10:23:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236758AbjH2OW6 (ORCPT ); Tue, 29 Aug 2023 10:22:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8CFB8CCE for ; Tue, 29 Aug 2023 07:22:33 -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 982712F4; Tue, 29 Aug 2023 07:23:12 -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 731133F64C; Tue, 29 Aug 2023 07:22:32 -0700 (PDT) Message-ID: <6f936d6e-9f27-ba72-68de-0ed27c0dbbe1@arm.com> Date: Tue, 29 Aug 2023 15:22:22 +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 To: Chunhui He , Christoph Hellwig , Marek Szyprowski Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230826085317.69713-1-hchunhui@mail.ustc.edu.cn> Content-Language: en-GB From: Robin Murphy In-Reply-To: <20230826085317.69713-1-hchunhui@mail.ustc.edu.cn> 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 26/08/2023 9:53 am, Chunhui He wrote: > The gcc document says label attributes are ambiguous if they are > not immediately followed by a semicolon. Although the ambiguity > does not arise in C90/99, it would be better to add it. 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. Thanks, Robin. > Link: https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Label-Attributes-2 > Signed-off-by: Chunhui He > --- > kernel/dma/pool.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c > index 1acec2e22827..f99f02b88c40 100644 > --- a/kernel/dma/pool.c > +++ b/kernel/dma/pool.c > @@ -136,7 +136,7 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, > #ifdef CONFIG_DMA_DIRECT_REMAP > dma_common_free_remap(addr, pool_size); > #endif > -free_page: __maybe_unused > +free_page: __maybe_unused; > __free_pages(page, order); > out: > return ret;