From d554d56423974e56f38232eb74815b2c8c5c62da Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 16 Aug 2011 12:22:31 +0000 Subject: [PATCH] scripts/specialize-patch: Make sure that checkpatch doesn't complain about space after operator \! git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3812 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/specialize-patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/specialize-patch b/scripts/specialize-patch index f7303111b..96a26d8fd 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -60,7 +60,7 @@ function evaluate(stmnt, pattern, arg, op, result) { if (match(stmnt, "^+#ifndef (.*)$", arg)) { - stmnt = "+#if ! defined(" arg[1] ")" + stmnt = "+#if !defined(" arg[1] ")" } gsub("LINUX_VERSION_CODE", LINUX_VERSION_CODE, stmnt) @@ -241,9 +241,9 @@ function evaluate(stmnt, pattern, arg, op, result) { } -# Evaluate ! stmnt +# Evaluate !stmnt function invert(stmnt) { - return evaluate(gensub("^+#if (.*)$", "+#if ! (\\1)", "g", stmnt)) + return evaluate(gensub("^+#if (.*)$", "+#if !(\\1)", "g", stmnt)) } @@ -259,7 +259,8 @@ function handle_if(evaluated) || $0 ~ "RHEL_MAJOR" \ || $0 ~ "RHEL_MINOR" \ || $0 ~ "RHEL_RELEASE_CODE" \ - || $0 ~ "GENERATING_UPSTREAM_PATCH" \ + || generating_upstream_patch_defined \ + && $0 ~ "GENERATING_UPSTREAM_PATCH" \ || $0 ~ "CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION" \ || ($0 ~ "CONFIG_SCST_PROC" && config_scst_proc_undefined) \ || ($0 ~ "SCSI_EXEC_REQ_FIFO_DEFINED" && SCSI_EXEC_REQ_FIFO_DEFINED!="") \ @@ -279,7 +280,7 @@ function handle_if(evaluated) if_stmnt[if_nesting_level] = evaluated any_section_output[if_nesting_level] = 0 decision[if_nesting_level] = evaluated - inv_decision[if_nesting_level] = evaluate(sprintf("+#if ! %s", substr(evaluated, 6))) + inv_decision[if_nesting_level] = evaluate(sprintf("+#if !%s", substr(evaluated, 6))) if (debug) printf "/* debug specialize-patch: (f) %s / %s */\n", \ decision[if_nesting_level], inv_decision[if_nesting_level] @@ -294,7 +295,7 @@ function handle_if(evaluated) evaluated = evaluate(evaluated) decision[if_nesting_level] = evaluated inv_decision[if_nesting_level] \ - = evaluate(sprintf("+#if %s && ! %s", \ + = evaluate(sprintf("+#if %s && !%s", \ substr(inv_decision[if_nesting_level], 6), \ substr(evaluated, 6))) if (debug) @@ -361,7 +362,7 @@ function process_preprocessor_statement(evaluated, condition) { discard = 1 delete_next_blank_line = 1 } - else if (output && (! condition \ + else if (output && (!condition \ || condition && matching_if !~ "^+#if [01]" \ && matching_if !~ "^+#elif [01]")) {