lib: remove trailing spaces and tabs
Subsystems (2)
cover lib: remove trailing spaces and tabs
find lib/ -type f | xargs sed -r -i 's/[ \t]+$//'
Run the above command to find and remove the trailing spaces and tabs. To keep the patch from being too big, I broke it down into five parts.
Zhen Lei (5):
lib/zlib: remove trailing spaces and tabs
Fonts: remove trailing spaces and tabs
lib/inflate.c: remove trailing spaces and tabs
lib/ts_bm.c: remove trailing spaces and tabs
lib: remove trailing spaces and tabs
lib/Kconfig | 2 +- lib/fonts/font_acorn_8x8.c | 2 +- lib/fonts/font_mini_4x6.c | 8 ++++---- lib/inflate.c | 26 +++++++++++++------------- lib/libcrc32c.c | 2 +- lib/textsearch.c | 4 ++-- lib/ts_bm.c | 24 ++++++++++++------------ lib/ts_kmp.c | 2 +- lib/zlib_deflate/deflate.c | 10 +++++----- lib/zlib_deflate/deftree.c | 4 ++-- lib/zlib_deflate/defutil.h | 10 +++++----- lib/zlib_inflate/inflate_syms.c | 2 +- lib/zlib_inflate/infutil.h | 2 +- 13 files changed, 49 insertions(+), 49 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/5 lib/zlib: remove trailing spaces and tabs
Run the following command to find and remove the trailing spaces and tabs:
find lib/zlib*/ -type f | xargs sed -r -i 's/[ \t]+$//'
--- lib/zlib_deflate/deflate.c | 10 +++++----- lib/zlib_deflate/deftree.c | 4 ++-- lib/zlib_deflate/defutil.h | 10 +++++----- lib/zlib_inflate/inflate_syms.c | 2 +- lib/zlib_inflate/infutil.h | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-)
lib/zlib_deflate/deflate.c +5 -5
@@ -1,7 +1,7 @@/* +++ deflate.c */ /* deflate.c -- compress data using the deflation algorithm * Copyright (C) 1995-1996 Jean-loup Gailly. -* For conditions of distribution and use, see copyright notice in zlib.h +* For conditions of distribution and use, see copyright notice in zlib.h */ /*
@@ -284,7 +284,7 @@ int zlib_deflateReset( ) {deflate_state *s; - +if (strm ==NULL || strm->state ==NULL )return Z_STREAM_ERROR ;
@@ -323,7 +323,7 @@ static void putShortMSB( {put_byte (s, (Byte)(b >>8 ));put_byte (s, (Byte)(b &0xff )); -} +}/* ========================================================================= */ int zlib_deflate(
@@ -976,7 +976,7 @@ static block_state deflate_fast(* always MIN_MATCH bytes ahead. */ }while (--s->match_length !=0 ); - s->strstart++; + s->strstart++; }else { s->strstart += s->match_length; s->match_length =0 ;
@@ -994,7 +994,7 @@ static block_state deflate_fast(Tracevv ((stderr,"%c" , s->window[s->strstart])); bflush =zlib_tr_tally (s,0 , s->window[s->strstart]); s->lookahead--; - s->strstart++; + s->strstart++; }if (bflush)FLUSH_BLOCK (s,0 ); }
lib/zlib_deflate/deftree.c +2 -2
@@ -1,7 +1,7 @@/* +++ trees.c */ /* trees.c -- output deflated data using Huffman coding * Copyright (C) 1995-1996 Jean-loup Gailly -* For conditions of distribution and use, see copyright notice in zlib.h +* For conditions of distribution and use, see copyright notice in zlib.h */ /*
@@ -1043,7 +1043,7 @@ static void copy_block( s->last_eob_len =8 ;/* enough lookahead for inflate */ if (header) { -put_short (s, (ush )len); +put_short (s, (ush )len);put_short (s, (ush )~len);#ifdef DEBUG_ZLIB s->bits_sent +=2 *16 ;
lib/zlib_deflate/defutil.h +5 -5
@@ -3,11 +3,11 @@#include <linux/zutil.h> -#define Assert (err, str) -#define Trace(dummy) -#define Tracev (dummy) -#define Tracecv(err, dummy) -#define Tracevv (dummy) +#define Assert (err, str) +#define Trace (dummy) +#define Tracev (dummy) +#define Tracecv (err, dummy) +#define Tracevv (dummy)
lib/zlib_inflate/inflate_syms.c +1 -1
@@ -16,6 +16,6 @@ EXPORT_SYMBOL(zlib_inflate);EXPORT_SYMBOL (zlib_inflateInit2);EXPORT_SYMBOL (zlib_inflateEnd);EXPORT_SYMBOL (zlib_inflateReset); -EXPORT_SYMBOL (zlib_inflateIncomp); +EXPORT_SYMBOL (zlib_inflateIncomp);EXPORT_SYMBOL (zlib_inflate_blob);MODULE_LICENSE ("GPL" );
lib/zlib_inflate/infutil.h +1 -1
@@ -1,6 +1,6 @@/* infutil.h -- types and macros common to blocks and codes * Copyright (C) 1995-1998 Mark Adler -* For conditions of distribution and use, see copyright notice in zlib.h +* For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is
Signature · 1 line
2.25.1
PATCH 2/5 Fonts: remove trailing spaces and tabs
In reply to Zhen LeiRun the following command to find and remove the trailing spaces and tabs:
find lib/fonts/ -type f | xargs sed -r -i 's/[ \t]+$//'
--- lib/fonts/font_acorn_8x8.c | 2 +- lib/fonts/font_mini_4x6.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
lib/fonts/font_acorn_8x8.c +1 -1
@@ -68,7 +68,7 @@ static const struct font_data acorndata_8x8 = {/* 3A */ 0x00 ,0x00 ,0x18 ,0x18 ,0x00 ,0x18 ,0x18 ,0x00 ,/* : */ /* 3B */ 0x00 ,0x00 ,0x18 ,0x18 ,0x00 ,0x18 ,0x18 ,0x30 ,/* ; */ /* 3C */ 0x0C ,0x18 ,0x30 ,0x60 ,0x30 ,0x18 ,0x0C ,0x00 ,/* < */ -/* 3D */ 0x00 ,0x00 ,0x7E ,0x00 ,0x7E ,0x00 ,0x00 ,0x00 ,/* = */ +/* 3D */ 0x00 ,0x00 ,0x7E ,0x00 ,0x7E ,0x00 ,0x00 ,0x00 ,/* = */ /* 3E */ 0x30 ,0x18 ,0x0C ,0x06 ,0x0C ,0x18 ,0x30 ,0x00 ,/* > */ /* 3F */ 0x3C ,0x66 ,0x0C ,0x18 ,0x18 ,0x00 ,0x18 ,0x00 ,/* ? */ /* 40 */ 0x3C, 0x66, 0x6E, 0x6A, 0x6E, 0x60, 0x3C, 0x00, /* @ */
lib/fonts/font_mini_4x6.c +4 -4
@@ -18,15 +18,15 @@ s{((0x)?[0-9a-fA-F]+)(.*\[([\*\ ]{4})\])}{ ($num,$pat,$bits) = ($1,$3,$4); - + $bits =~ s/([^\s0])|(.)/ defined($1) + 0 /ge; - + $num =ord (pack ("B8" , $bits)); $num |= $num >>4 ; $num =sprintf ("0x%.2x" , $num); - +
Signature · 1 line
2.25.1
PATCH 3/5 lib/inflate.c: remove trailing spaces and tabs
In reply to Zhen LeiRun the following command to find and remove the trailing spaces and tabs:
sed -r -i 's/[ \t]+$//' lib/inflate.c
--- lib/inflate.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
lib/inflate.c +13 -13
@@ -4,9 +4,9 @@/* inflate.c -- Not copyrighted 1992 by Mark Adler version c10p1, 10 January 1993 */ -/* +/* * Adapted for booting Linux by Hannu Savolainen 1993 -* based on gzip-1.0.3 +* based on gzip-1.0.3 * * Nicolas Pitre <[email protected]>, 1999/04/14 : * Little mods for all variable to reside either into rodata or bss segments
@@ -51,7 +51,7 @@ chunks), otherwise the dynamic method is used. In the latter case, the codes are customized to the probabilities in the current block, and so can code it much better than the pre-determined fixed codes. - + The Huffman codes themselves are decoded using a multi-level table lookup, in order to maximize the speed of decoding plus the speed of building the decoding tables. See the comments below that precede the
@@ -126,7 +126,7 @@ static char rcsid[] = "#Id: inflate.c,v 0.14 1993/06/10 13:27:04 jloup Exp #";#ifndef INIT #define INIT #endif - +#define slide window/* Huffman code lookup table entry--this entry is four bytes for machines
@@ -147,7 +147,7 @@ struct huft {/* Function prototypes */ -STATIC int INIT huft_build OF((unsigned *, unsigned, unsigned, +STATIC int INIT huft_build OF((unsigned *, unsigned, unsigned, const ush *, const ush *, struct huft **, int *)); STATIC int INIT huft_free OF((struct huft *)); STATIC int INIT inflate_codes OF((struct huft *, struct huft *, int, int));
@@ -193,7 +193,7 @@ static const ush cpdext[] = { /* Extra bits for distance codes *//* Macros for inflate() bit peeking and grabbing. The usage is: -+ NEEDBITS(j) x = b & mask_bits[j]; DUMPBITS(j)
@@ -374,7 +374,7 @@ DEBG("huft1 ");memzero (stk->c,sizeof (stk->c)); p = b; i = n; do { - Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"), + Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"), n-i, *p)); c[*p]++; /* assume all entries <= BMAX */ p++; /* Can't combine with above line (Solaris bug) */
@@ -581,7 +581,7 @@ STATIC int INIT huft_free( q = (--p)->v.t;free ((char *)p); p = q; - } + }return 0 ; }
@@ -1139,7 +1139,7 @@ static ulg crc; /* initialized in makecrc() so it'll reside in bss */#define CRC_VALUE (crc ^ 0xffffffffUL)/* -* Code to compute the CRC-32 table. Borrowed from +* Code to compute the CRC-32 table. Borrowed from * gzip-1.0.3/makecrc.c. */
@@ -1247,7 +1247,7 @@ static int INIT gunzip(void)if ((flags &ORIG_NAME ) !=0 ) {/* Discard the old name */ while (NEXTBYTE () !=0 )/* null */ ; - } + }/* Discard file comment if any */ if ((flags &COMMENT ) !=0 ) {
@@ -1276,7 +1276,7 @@ static int INIT gunzip(void) }return -1 ; } - +/* Get the crc and original length */ /* crc32 (see algorithm.doc) * uncompressed input size modulo 2^32
@@ -1285,12 +1285,12 @@ static int INIT gunzip(void) orig_crc |= (ulg )NEXTBYTE () <<8 ; orig_crc |= (ulg )NEXTBYTE () <<16 ; orig_crc |= (ulg )NEXTBYTE () <<24 ; - + orig_len = (ulg )NEXTBYTE (); orig_len |= (ulg )NEXTBYTE () <<8 ; orig_len |= (ulg )NEXTBYTE () <<16 ; orig_len |= (ulg )NEXTBYTE () <<24 ; - +/* Validate decompression */ if (orig_crc !=CRC_VALUE ) {error ("crc error" );
Signature · 1 line
2.25.1
PATCH 4/5 lib/ts_bm.c: remove trailing spaces and tabs
In reply to Zhen LeiRun the following command to find and remove the trailing spaces and tabs:
sed -r -i 's/[ \t]+$//' lib/ts_bm.c
--- lib/ts_bm.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
lib/ts_bm.c +12 -12
@@ -5,27 +5,27 @@* Authors: Pablo Neira Ayuso <[email protected]> * * ========================================================================== -* +* * Implements Boyer-Moore string matching algorithm: * * [1] A Fast String Searching Algorithm, R.S. Boyer and Moore. -* Communications of the Association for Computing Machinery, +* Communications of the Association for Computing Machinery, * 20(10), 1977, pp. 762-772. * https://www.cs.utexas.edu/users/moore/publications/fstrpos.pdf * * [2] Handbook of Exact String Matching Algorithms, Thierry Lecroq, 2004 * http://www-igm.univ-mlv.fr/~lecroq/string/string.pdf * -* Note: Since Boyer-Moore (BM) performs searches for matchings from right -* to left, it's still possible that a matching could be spread over +* Note: Since Boyer-Moore (BM) performs searches for matchings from right +* to left, it's still possible that a matching could be spread over * multiple blocks, in that case this algorithm won't find any coincidence. -* +* * If you're willing to ensure that such thing won't ever happen, use the -* Knuth-Pratt-Morris (KMP) implementation instead. In conclusion, choose -* the proper string search algorithm depending on your setting. +* Knuth-Pratt-Morris (KMP) implementation instead. In conclusion, choose +* the proper string search algorithm depending on your setting. * -* Say you're using the textsearch infrastructure for filtering, NIDS or -* any similar security focused purpose, then go KMP. Otherwise, if you +* Say you're using the textsearch infrastructure for filtering, NIDS or +* any similar security focused purpose, then go KMP. Otherwise, if you * really care about performance, say you're classifying packets to apply * Quality of Service (QoS) policies, and you don't mind about possible * matchings spread over multiple fragments, then go BM.
@@ -70,9 +70,9 @@ static unsigned int bm_find(struct ts_config *conf, struct ts_state *state)break ;while (shift < text_len) { -DEBUGP ("Searching in position %d (%c)\n" , +DEBUGP ("Searching in position %d (%c)\n" , shift, text[shift]); -for (i =0 ; i < bm->patlen; i++) +for (i =0 ; i < bm->patlen; i++)if ((icase ?toupper (text[shift-i]) : text[shift-i]) != bm->pattern[bm->patlen-1 -i])
@@ -124,7 +124,7 @@ static void compute_prefix_tbl(struct ts_bm *bm, int flags) = bm->patlen - 1 - i; } -/* Compute the good shift array, used to match reocurrences +/* Compute the good shift array, used to match reocurrences * of a subpattern */ bm->good_shift[0 ] =1 ;for (i =1 ; i < bm->patlen; i++)
Signature · 1 line
2.25.1
PATCH 5/5 lib: remove trailing spaces and tabs
In reply to Zhen LeiRun the following command to find and remove the trailing spaces and tabs:
find lib/ -type f | xargs sed -r -i 's/[ \t]+$//'
--- lib/Kconfig | 2 +- lib/libcrc32c.c | 2 +- lib/textsearch.c | 4 ++-- lib/ts_kmp.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
lib/Kconfig +1 -1
@@ -357,7 +357,7 @@ config GENERIC_ALLOCATOR # config REED_SOLOMON tristate - + config REED_SOLOMON_ENC8 bool
lib/libcrc32c.c +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0-or-later -/* +/* * CRC32C *@Article{castagnoli-crc, * author = { Guy Castagnoli and Stefan Braeuer and Martin Herrman},
lib/textsearch.c +2 -2
@@ -266,7 +266,7 @@ struct ts_config *textsearch_prepare(const char *algo, const void *pattern,int err = -ENOENT ;struct ts_config *conf;struct ts_ops *ops; - +if (len ==0 )return ERR_PTR (-EINVAL );
@@ -298,7 +298,7 @@ struct ts_config *textsearch_prepare(const char *algo, const void *pattern, errout:if (ops)module_put (ops->owner); - +return ERR_PTR (err); }EXPORT_SYMBOL (textsearch_prepare);
lib/ts_kmp.c +1 -1
@@ -5,7 +5,7 @@* Authors: Thomas Graf <[email protected]> * * ========================================================================== -* +* * Implements a linear-time string-matching algorithm due to Knuth, * Morris, and Pratt [1]. Their algorithm avoids the explicit * computation of the transition function DELTA altogether. Its
Signature · 1 line
2.25.1