forked from Minki/linux
2874c5fd28
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31 lines
686 B
Bash
31 lines
686 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
#
|
|
# Just process the CPP output from systbl_chk.c and complain
|
|
# if anything is out of order.
|
|
#
|
|
# Copyright © 2008 IBM Corporation
|
|
#
|
|
|
|
awk 'BEGIN { num = -1; } # Ignore the beginning of the file
|
|
/^#/ { next; }
|
|
/^[ \t]*$/ { next; }
|
|
/^START_TABLE/ { num = 0; next; }
|
|
/^END_TABLE/ {
|
|
if (num != $2) {
|
|
printf "Error: NR_syscalls (%s) is not one more than the last syscall (%s)\n",
|
|
$2, num - 1;
|
|
exit(1);
|
|
}
|
|
num = -1; # Ignore the rest of the file
|
|
}
|
|
{
|
|
if (num == -1) next;
|
|
if (($1 != -1) && ($1 != num)) {
|
|
printf "Error: Syscall %s out of order (expected %s)\n",
|
|
$1, num;
|
|
exit(1);
|
|
};
|
|
num++;
|
|
}' "$1"
|