util/make_linux_ec_commands_h: Transform UINTxx_MAX into Uxx_MAX

To match kernel defines, transform UINT32_MAX and friends into
U32_MAX and friends.

BUG=chromium:945948
BRANCH=none
TEST=compile.
Check changes with linux-next/master cros_ec_commands.h.

Change-Id: Id965a192f2e32b0f57983c69d51d7c07c4f5b4ef
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2087845
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
Gwendal Grignou 2020-03-04 10:18:48 -08:00 committed by Commit Bot
parent a00ace498d
commit bcce68baec
1 changed files with 5 additions and 0 deletions

View File

@ -66,6 +66,11 @@ EOF
# Change header guards
sed -i "s/__CROS_EC_EC_COMMANDS_H/__CROS_EC_COMMANDS_H/" "${tmp}"
# Convert UINT32_MAX into U32_MAX (and friends).
sed -i "s/UINT\([0-9]\{1,2\}\)_MAX/U\1_MAX/" "${tmp}"
sed -i "s/INT\([0-9]\{1,2\}\)_MAX/S\1_MAX/" "${tmp}"
sed -i "s/INT\([0-9]\{1,2\}\)_MIN/S\1_MIN/" "${tmp}"
# Remove non kernel code to prevent checkpatch warnings and simplify the .h.
unifdef -x2 -m -UCONFIG_HOSTCMD_ALIGNED -U__ACPI__ -D__KERNEL__ -U__cplusplus \
-UCHROMIUM_EC "${tmp}"