All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Conor Dooley <conor@kernel.org>, Andrew Jones <ajones@ventanamicro.com>
Cc: palmer@dabbelt.com, linux-riscv@lists.infradead.org,
	christoph.muellner@vrull.eu, philipp.tomsich@vrull.eu
Subject: Re: [PATCH] RISC-V: fix compile error from decuplicated __ALTERNATIVE_CFG_2
Date: Wed, 04 Jan 2023 16:58:00 +0100	[thread overview]
Message-ID: <2035002.VLH7GnMWUR@diego> (raw)
In-Reply-To: <20230104140833.nbulmdsgcm5x7d47@orel>

Hi again,

Am Mittwoch, 4. Januar 2023, 15:08:33 CET schrieb Andrew Jones:
> On Wed, Jan 04, 2023 at 01:29:25PM +0000, Conor Dooley wrote:
> > On Tue, Jan 03, 2023 at 10:42:28PM +0100, Heiko Stuebner wrote:
> > > From: Heiko Stuebner <heiko.stuebner@vrull.eu>
> > 
> > > RISC-V: fix compile error from decuplicated __ALTERNATIVE_CFG_2
> > 
> > Hey Heiko/Palmer,
> > 
> > Was a little hard to tell from Drew's mail if he was objecting to this
> > variant of the patch, but FWIW s/decup/dedup/ if this gets applied
> > as-is.
> 
> I wasn't completely objecting, but rather suggesting we still try to
> factor out what we can. However, after reading a bit more about macros
> I tried this
> 
>  .macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1,   \
>                                 new_c_2, vendor_id_2, errata_id_2, enable_2
> -       ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
> +       ALTERNATIVE_CFG "\old_c", "\new_c_1", \vendor_id_1, \errata_id_1, \enable_1
>         ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2
>  .endm
> 
> which appears to work for my simple test. Does that work for you too,
> Heiko? If so, then I think I'd prefer we do that. Also, we may want to add
> quotes to all macro arguments which may contain spaces, even if things
> seem to work now, e.g. the \new_c_2 argument passed to ALT_NEW_CONTENT.

Yay ... adding quotes really seems to work - at least a GNU toolchain

I guess that may have been the reason to move new_c at the end and making
it vararg in ALT_NEW_CONTENT originally.

And in fact with added quotes the varargs argument wouldn't be necessary
anymore.

Just removing the varargs argument alone results in
	Error: too many positional arguments
erros, but wrapping the "\new_c*" in quotes lets it compile again.


Heiko



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2023-01-04 16:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 21:42 [PATCH] RISC-V: fix compile error from decuplicated __ALTERNATIVE_CFG_2 Heiko Stuebner
2023-01-04 10:06 ` Andrew Jones
2023-01-04 14:11   ` Heiko Stübner
2023-01-04 14:16     ` Heiko Stübner
2023-01-04 13:29 ` Conor Dooley
2023-01-04 14:08   ` Andrew Jones
2023-01-04 15:58     ` Heiko Stübner [this message]
2023-01-05 15:00       ` Andrew Jones
2023-01-05 16:14         ` Heiko Stübner

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=2035002.VLH7GnMWUR@diego \
    --to=heiko@sntech.de \
    --cc=ajones@ventanamicro.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=conor@kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=philipp.tomsich@vrull.eu \
    /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.