UPSTREAM: checkpatch: allow certain SI units with three characters

Checkpatch flags CamelCase identifiers in strict mode, but it has a
feature to ignore parts with only two characters to allow for SI units
like mV or uA.  Unfortunately, not all SI units fit in two characters, and
not all are lower case followed by upper case.

This patch adds hardcoded detection for frequency and 1024-based size
units (Hz/KHz/MHz/GHz/THz and KiB/MiB/GiB/TiB), since allowing any three
character combinations might be too lenient.  The list can later be
expanded as needed.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Acked-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 6fcece53765443add30da4b085085dfda2b22ff0)
Cherry-picked from next/linux-next.git/master.

BUG=None
TEST=./checkpatch.pl --no-tree --strict -f
../third_party/coreboot/src/soc/rockchip/rk3288/include/soc/clock.h no
longer flags "MHz" as a CamelCase violation.

Change-Id: Ic5200ee7001a5f0a913f340b16bcce553d41f5f3
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/231131
Reviewed-by: Doug Anderson <dianders@chromium.org>
1 file changed