From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Guan-Chun Wu <409411716@gms.tku.edu.tw>,
Kuan-Wei Chiu <visitorckw@gmail.com>,
linux-kernel@vger.kernel.org
Cc: David Laight <david.laight.linux@gmail.com>
Subject: Re: [PATCH v1 1/1] base64: Unroll the tables initialisers
Date: Mon, 3 Nov 2025 21:17:26 +0200 [thread overview]
Message-ID: <aQj_xgm5_dnyJ2cc@smile.fi.intel.com> (raw)
In-Reply-To: <20251103190510.627314-1-andriy.shevchenko@linux.intel.com>
On Mon, Nov 03, 2025 at 08:05:10PM +0100, Andy Shevchenko wrote:
> Currently the initialisers of the tables have duplicate indices.
> This prevents from building with `make W=1`.
>
> To address the issue, unroll the table initialisers with generated
> arrays by the following Python excerpt:
>
> CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
>
> def gen_table(ch62, ch63):
> table = [ 0xff ] * 256
> for idx, char in enumerate(CHARS):
> table[ord(char)] = idx
> table[ord(ch62)] = 62
> table[ord(ch63)] = 63
>
> for i in range(0, len(table), 8):
> print (f"\t{', '.join(f"0x{c:02x}" for c in table[i:i+8])},\t/* {i:-3d} - {i+7:-3d} */")
I haven't added a Fixes tag as the idea to fold this to the initial
contribution.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-11-03 19:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 19:05 [PATCH v1 1/1] base64: Unroll the tables initialisers Andy Shevchenko
2025-11-03 19:17 ` Andy Shevchenko [this message]
2025-11-03 22:18 ` David Laight
2025-11-04 8:18 ` Andy Shevchenko
2025-11-04 9:07 ` David Laight
2025-11-04 9:44 ` Andy Shevchenko
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=aQj_xgm5_dnyJ2cc@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=409411716@gms.tku.edu.tw \
--cc=akpm@linux-foundation.org \
--cc=david.laight.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=visitorckw@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox