Re: [PATCH v2] checkpatch: recognize standard SI unit prefixes and symbols
From: Andy Shevchenko
Date: Mon Aug 17 2026 - 04:33:35 EST
On Sat, Aug 15, 2026 at 06:04:49PM +0000, Ariel Yu wrote:
> checkpatch flags identifiers containing valid SI units as CamelCase.
>
> Expand the SI unit ignore patterns to recognize standard Système
> International d'unités prefixes (u, m, k, M, G) and unit symbols
> (V, A, Hz, Ohm, C, K, s, W, etc.):
>
> - Allow mixed-case suffixes after the [a-z][A-Z] SI unit core, so
> derived units like _uV_per_C or _mV_per_K are no longer flagged.
> - Allow mixed-case prefixes in both the two-char and three-char SI
> patterns, so identifiers like clock_FREQ_kHz are recognized.
> - Add Ohm (with all standard prefixes: uOhm, mOhm, kOhm, MOhm, GOhm)
> to the three-char SI unit list.
> - Allow mixed-case suffixes after three-char SI units as well.
Maybe this way, or maybe some leveled one (first check the multiplier, then
validate the SI unit). Whatever, I am okay with this approach.
Acked-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko