All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Chunhui He <hchunhui@mail.ustc.edu.cn>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dma/pool: trivial: add semicolon after label attributes
Date: Tue, 29 Aug 2023 17:12:16 +0200	[thread overview]
Message-ID: <20230829151216.GA4211@lst.de> (raw)
In-Reply-To: <6f936d6e-9f27-ba72-68de-0ed27c0dbbe1@arm.com>

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;

  reply	other threads:[~2023-08-29 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26  8:53 [PATCH 1/2] dma/pool: trivial: add semicolon after label attributes Chunhui He
2023-08-29 14:22 ` Robin Murphy
2023-08-29 15:12   ` Christoph Hellwig [this message]
2023-08-29 15:28     ` Robin Murphy
2023-08-31 11:59       ` Chunhui He
2023-09-01  8:56         ` Robin Murphy
2023-09-01  8:59           ` Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230829151216.GA4211@lst.de \
    --to=hch@lst.de \
    --cc=hchunhui@mail.ustc.edu.cn \
    --cc=iommu@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.