Commit Graph

51 Commits

Author SHA1 Message Date
Bart Van Assche
9455613488 scripts/specialize-patch: Update comments next to #else and #endif directives.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-08-16 11:26:59 +00:00
Bart Van Assche
8f48d8d7e9 Follow-up for r3807: make the hunk headers match again.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3808 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-08-16 08:32:23 +00:00
Bart Van Assche
803bae6fb8 scripts/specialize-patch: Remove #elif 0 sections from the output
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3807 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-08-16 07:47:32 +00:00
Bart Van Assche
dbc55781d7 Add remaining Linux kernel 3.0 patches and port nightly build scripts to 3.0 too.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3783 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-07-27 14:05:47 +00:00
Bart Van Assche
fb9ea53977 Expand CONFIG_SCST_PROC too.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3433 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-01 09:14:06 +00:00
Bart Van Assche
e40875d9b9 specialize-patch: Generalized a pattern.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3188 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-01-05 13:12:14 +00:00
Bart Van Assche
5fe037e5b9 Updated my e-mail address in copyright statements and README files.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3175 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-12-21 18:48:14 +00:00
Bart Van Assche
e66128f414 Added yet another pattern to the preprocessor statement partial evaluation engine.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2709 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-14 16:16:15 +00:00
Bart Van Assche
a9663949f0 Patch generation scripts: Fixed a typo.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2669 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-11 14:50:37 +00:00
Bart Van Assche
91aec29858 svn merge -r2369:2520 https://scst.svn.sourceforge.net/svnroot/scst/branches/ibmvstgt-port/scripts
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2521 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-31 10:54:36 +00:00
Bart Van Assche
9c20ed6584 Process tabs properly.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2432 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-21 14:06:51 +00:00
Bart Van Assche
6e152a3be1 #elif handling should now really be correct.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2362 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-06 20:26:38 +00:00
Bart Van Assche
89a2090064 Fixed a bug in #elif handling.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2361 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-06 19:58:06 +00:00
Bart Van Assche
507b7f0ae7 Reverted recently introduced #if/#elif handling changes because these were wrong.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2286 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-27 09:36:10 +00:00
Bart Van Assche
ad27ac341d patch header parsing bug fix.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2280 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-26 10:40:53 +00:00
Bart Van Assche
c9ad2e7a7b Changes:
- Process #elif directives correctly (doesn't affect the current SCST source code).
- Do not remove double blank lines from documentation files.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2278 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-26 09:37:27 +00:00
Bart Van Assche
e99d621185 Fixed bug in handling of #else statements matching an #if statement that could
be evaluated partially.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2265 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-25 09:16:26 +00:00
Bart Van Assche
9ece28c4f5 Added an additional expression to the list of recognized expressions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2261 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-24 20:44:02 +00:00
Bart Van Assche
82b810f2ad Remove /* #define CONFIG_SCST_PROC */ from the input.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2104 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-12 08:07:28 +00:00
Bart Van Assche
2aa9e1d69a Bug fix: substitute CONFIG_SCST_PROC properly.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2103 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-12 07:49:54 +00:00
Bart Van Assche
0f4411d273 Added support for operator != (not equal to). Undefine CONFIG_SUSE_KERNEL.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-10 07:35:58 +00:00
Bart Van Assche
0ff36ae2e2 Unbreak the nightly build after the procfs to sysfs switch.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2047 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-04 08:17:55 +00:00
Bart Van Assche
a504344cee Bug fix: process undefined RHEL_MAJOR / RHEL_MINOR macros properly.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1909 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-02 18:25:47 +00:00
Bart Van Assche
12b1d9d57e Changes:
- Process the pattern [01] && defined(...) properly.
- Added command-line option -d (debug) to generate-kernel-patch.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1582 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-04 13:27:24 +00:00
Bart Van Assche
a907dc6d2e Made sure that all double blank lines are converted into single blank lines.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1293 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 13:18:03 +00:00
Bart Van Assche
a068429f5d Delete double blank lines from the input.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1287 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-28 10:54:11 +00:00
Bart Van Assche
9d89f0a77f Updated copyright statement.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1277 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-25 13:27:17 +00:00
Bart Van Assche
0c3c7bc193 run-regression-tests:
- Adding the suffix "-u" to a kernel version will make the tests to be run
  with generate-kernel-patch -u ${kernel_version} instead of
  generate-kernel-patch ${kernel_version}.
generate-kernel-patch:
- sBUG(...) and sBUG_ON(...) are now replaced by BUG(...) and BUG_ON(...)
  respectively.
- Option -n does no longer disable the above substitution.
- Source file scst/src/scst_proc.c is now excluded when option -u is specified.
specialize-patch:
- Replaced variable delete_disabled_code by blank_deleted_lines. While setting
  the former variable had the effect of deleting disabled code, the latter
  has the effect of replacing disabled code by blank lines.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1271 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-25 09:46:40 +00:00
Bart Van Assche
51892c42d8 The generate-kernel-patch option -u does now enable #undef CONFIG_SCST_PROC.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1265 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-24 07:48:44 +00:00
Bart Van Assche
64803db9f1 When command-line option -u is passed to scripts/generate-kernel-patch,
undefine the preprocessor symbol
CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1249 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-22 18:26:19 +00:00
Bart Van Assche
7c9a154e05 Added support for continued lines.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1234 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-21 19:45:35 +00:00
Bart Van Assche
b9528d1407 Added variable generating_upstream_patch_defined. When set to 1, this
variable tells the script specialize-patch to treat the preprocessor
symbol GENERATING_UPSTREAM_PATCH as defined.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1218 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-15 07:14:54 +00:00
Bart Van Assche
45523183e4 Made sure all per-hunk state variables are initialized properly.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1204 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-12 17:40:24 +00:00
Bart Van Assche
a003cea218 Do not only remove references of SCSI_EXEC_REQ_FIFO_DEFINED / SCST_IO_CONTEXT
but also their definition.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-06 12:02:49 +00:00
Bart Van Assche
9d4e2f9399 Refinements / bug fixes of the changes introduced in the previous commit:
- Only replace sBUG/sBUG_ON by BUG/BUG_ON when this macro is being used, not
  in its definition.
- Fixed bugs in algorithm for preserving the original code during a sparse run.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-06 11:09:21 +00:00
Bart Van Assche
aaf2ed455d Modified scripts invoked during a regression test run such that the line numbers printed by sparse match those of the SCST source files present in the Subversion repository.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1068 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-02 16:42:26 +00:00
Bart Van Assche
d9bc8bbff8 Fixed bug introduced in the previous revision of the specialize-patch
script: empty lines after #if ... #else ... #endif blocks were deleted.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1058 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-08-16 12:18:52 +00:00
Bart Van Assche
8c029b22ec Whether or not SCSI_EXEC_REQ_FIFO_DEFINED and SCST_IO_CONTEXT are defined
does now depend on their definition in the per kernel-version patches.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1053 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-08-14 19:34:55 +00:00
Bart Van Assche
2232922dd9 - The expression "defined(SCST_IO_CONTEXT)" is now replaced by "1".
- The following two lines and the first blank line below are now removed:
  +#define SCSI_EXEC_REQ_FIFO_DEFINED
  +#define SCST_IO_CONTEXT
- Hunks that do no longer contain any modifications because of the 
  previous steps are now removed from the output because patch otherwise
  complains.
- Added support for evaluating expressions containing the arithmetic
  operators *, /, +, -.
- Removed support for partial evaluation of expressions because it is too
  tricky to get this right due to operator precedence.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1047 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-08-14 18:26:58 +00:00
Bart Van Assche
edb8da8616 - Remove the line "+#define SCSI_EXEC_REQ_FIFO_DEFINED" from the generated
patch.
- Substitute "defined(SCSI_EXEC_REQ_FIFO_DEFINED)" by "1" in preprocessor
  statements.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1045 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-08-13 18:29:59 +00:00
Bart Van Assche
29da0878e3 Added support for partial evaluation of && and || expressions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@957 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-07-15 15:55:20 +00:00
Bart Van Assche
69d545d77d Added the equivalent of #undef BACKPORT_LINUX_WORKQUEUE_TO_2_6_19.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@823 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-05-04 20:03:48 +00:00
Bart Van Assche
3e61c8b59e Bug fix: undefined macro's, e.g. RHEL_RELEASE_CODE, expand to the empty
string. The substitution for RHEL_RELEASE_CODE when it was not defined
was missing.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@788 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-18 09:12:39 +00:00
Bart Van Assche
c5faf6a7b4 - Fixed bug in evaluation of expressions containing '&&' or '||'.
- Added support for evaluating #ifdef and #ifndef.
- Added support for substituting the macro's RHEL_MAJOR, RHEL_MINOR and RHEL_RELEASE_CODE.
- Added more comments.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@637 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-19 19:07:42 +00:00
Vladislav Bolkhovitin
9af236707e The patch below implements the following changes:
- Add a dummy Signed-off-by line to the generated patch, such that checkpatch
  doesn't complain that it's missing.
- Sort the names of source files (through ls) before using these, such that
  the generated patch is the same during each run.
- Fixed a bug in #elif handling (this bug is not triggered by the current SCST
  code).

This patch has been tested by comparing the output of the old and the new
generate-kernel-patch script.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@530 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-10-22 17:47:28 +00:00
Vladislav Bolkhovitin
1504425c40 All empty lines due
to code commented out because inside #if LINUX_VERSION_CODE ... /
#endif is now really removed.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@481 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-07-28 18:19:34 +00:00
Vladislav Bolkhovitin
1c9a2b3f4b The patch below implements the following changes:
- The script specialize-patch now acts as if #define INSIDE_KERNEL_TREE 1
  is effective.
- The script generate-kernel-patch now renames sBUG_ON() into BUG_ON()
  and sBUG() into BUG(). The same script removes the definitions of the
  sBUG_ON(), sBUG() and WARN_ON_ONCE() macro's from the header file
  scst_debug.h. The last macro is only removed for kernel versions later than
  2.6.19.

This patch has been tested as follows:
- Compared the output of the command "scripts/generate-kernel-patch 2.6.25"
  before and after the changes.
- Verified the newly generated patch with checkpatch. Checkpatch statistics
  are now as follows:
    521 WARNING: line over 80 characters
     12 WARNING: consider using strict_strtoul in preference to simple_strtoul
     10 WARNING: printk() should include KERN_ facility level
      3 WARNING: CVS style keyword markers, these will _not_ be updated
      2 WARNING: do not add new typedefs
      1 WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
- Verified that the generated kernel patch still applies cleanly to the
  2.6.25.10 kernel and that this kernel still compiles, installs and boots fine.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@445 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-07-09 17:28:36 +00:00
Vladislav Bolkhovitin
14bd19ede1 Patch from Bart Van Assche <bart.vanassche@gmail.com>:
The script scripts/specialize-patch'>scripts/specialize-patch is an awk script. Currently it specifies /usr/bin/awk as its interpreter although it doesn't use the standard AWK syntax but the extended GNU AWK syntax. The patch below changes the interpreter name such that the script also works on systems where /usr/bin/awk is not GNU AWK (e.g. Ubuntu 8.04). Note: GNU AWK is not installed by default on all Linux systems. E.g. on Debian systems it's in the gawk package.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@413 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-06-13 11:08:23 +00:00
Vladislav Bolkhovitin
83af00fd15 Patch from Bart Van Assche <bart.vanassche@gmail.com>:
The current version of generate-kernel-patch does not remove preprocessor
statements that should have been removed because intended for another kernel
version (surrounded by #if LINUX_VERSION_CODE ... KERNEL_VERSION(...) / #endif).
The patch below fixes this.

I have verified the patch below by comparing the patch generated by the
old and the new versions of the generate-kernel-patch script:
$ diff p1 p2
7190d7189
< +#if defined(EXTRACHECKS)
7196c7195,7196
< +#endif
---
> > +
> > +
13056d13055
< +#ifdef STRICT_SERIALIZING
13058d13056
< +#elif !defined(SCSI_EXEC_REQ_FIFO_DEFINED)
13060d13057
< +#else
13062c13059,13062
< +#endif
---
> > +
> > +
> > +
> > +

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@392 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-23 15:19:52 +00:00
Vladislav Bolkhovitin
22a46ff163 Patch from Bart Van Assche <bart.vanassche@gmail.com>:
The patch below implements the following changes:
- Make sure the output of the make command does not appear in the generated
  kernel patch.
- Changed interpreter of scripts/specialize-patch from /usr/bin/gawk to
  /usr/bin/awk in order to make sure this awk script also runs on systems
  where awk is installed but not gawk.
- Added an extra evaluation rule such that expressions like (0) are rewritten
  as 0.
- Fixed a spelling error.
- Expressions that can only be partially evaluated are now partially evaluated.
  E.g. #if defined(EXTRACHECKS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
  becomes #if defined(EXTRACHECKS) && 0 in the output.
- Code between #if 0 / #endif or #if 1 / #endif is included in the generated
  kernel patch, including the surrounding preprocessor directives.
- Preprocessor statements with spaces behind # are now recognized (e.g. "#   if").
- Expression evaluator now supports ! (logical not) and () (braces).
- #elif is now evaluated correctly.
- Nested #if / #elif / #else / #endif are now interpreted correctly.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@385 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-22 15:55:23 +00:00