mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Tiezhu Yang <yangtiezhu@loongson.cn>,
	Huacai Chen <chenhuacai@kernel.org>,
	loongarch@lists.linux.dev, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] perf loongarch: Fix discarded const qualifier in _get_field()
Date: Thu, 24 Sep 2026 19:22:40 +0200	[thread overview]
Message-ID: <arVcYFo1xAXFdogt@x2> (raw)
In-Reply-To: <arSzzwtLnew2t7VY@z2>

On Wed, Sep 23, 2026 at 10:23:27PM -0700, Namhyung Kim wrote:
> On Thu, Sep 24, 2026 at 10:17:56AM +0800, Tiezhu Yang wrote:
> > When building perf on LoongArch, the following compilation errors occur:
> > 
> >   CC      arch/loongarch/util/header.o
> > arch/loongarch/util/header.c: In function '_get_field':
> > arch/loongarch/util/header.c:31:15: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> >    31 |         line2 = strrchr(line, ' ');
> >       |               ^
> > arch/loongarch/util/header.c:36:12: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> >    36 |         nl = strrchr(line, '\n');
> >       |            ^
> > cc1: all warnings being treated as errors
> > 
> > Declare 'line2' and 'nl' as const char * to ensure type safety. In modern
> > glibc versions, strrchr() returns a 'const char *' if the input string is
> > const.
> > 
> > This is similar to commit 7378b6656aa4 ("perf riscv: Fix discarded const
> > qualifier in _get_field()").
> > 
> > Fixes: 492ac37fa38f ("perf kvm: Add kvm-stat for loongarch64")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo

      reply	other threads:[~2026-09-24 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  2:17 Tiezhu Yang
2026-09-24  5:23 ` Namhyung Kim
2026-09-24 17:22   ` Arnaldo Carvalho de Melo [this message]

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=arVcYFo1xAXFdogt@x2 \
    --to=acme@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=namhyung@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®