diff options
author | Dave Jones <davej@redhat.com> | 2006-09-05 17:20:21 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-09-05 17:20:21 -0400 |
commit | 115b384cf87249d76adb0b21aca11ee22128927d (patch) | |
tree | f39a2a54863e9d82d1196906f92c82ab5991c6af /lib | |
parent | 8eb7925f93af75e66a240d148efdec212f95bcb7 (diff) | |
parent | c336923b668fdcf0312efbec3b44895d713f4d81 (diff) |
Merge ../linus
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kobject_uevent.c | 4 | ||||
-rw-r--r-- | lib/spinlock_debug.c | 10 | ||||
-rw-r--r-- | lib/ts_bm.c | 11 | ||||
-rw-r--r-- | lib/zlib_inflate/inflate.c | 5 |
4 files changed, 15 insertions, 15 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 2b1530fc573b..7f20e7b857cb 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c | |||
@@ -50,10 +50,6 @@ static char *action_to_string(enum kobject_action action) | |||
50 | return "offline"; | 50 | return "offline"; |
51 | case KOBJ_ONLINE: | 51 | case KOBJ_ONLINE: |
52 | return "online"; | 52 | return "online"; |
53 | case KOBJ_DOCK: | ||
54 | return "dock"; | ||
55 | case KOBJ_UNDOCK: | ||
56 | return "undock"; | ||
57 | default: | 53 | default: |
58 | return NULL; | 54 | return NULL; |
59 | } | 55 | } |
diff --git a/lib/spinlock_debug.c b/lib/spinlock_debug.c index 3d9c4dc965ed..58c577dd82e5 100644 --- a/lib/spinlock_debug.c +++ b/lib/spinlock_debug.c | |||
@@ -162,6 +162,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg) | |||
162 | 162 | ||
163 | #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg) | 163 | #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg) |
164 | 164 | ||
165 | #if 0 /* __write_lock_debug() can lock up - maybe this can too? */ | ||
165 | static void __read_lock_debug(rwlock_t *lock) | 166 | static void __read_lock_debug(rwlock_t *lock) |
166 | { | 167 | { |
167 | int print_once = 1; | 168 | int print_once = 1; |
@@ -184,12 +185,12 @@ static void __read_lock_debug(rwlock_t *lock) | |||
184 | } | 185 | } |
185 | } | 186 | } |
186 | } | 187 | } |
188 | #endif | ||
187 | 189 | ||
188 | void _raw_read_lock(rwlock_t *lock) | 190 | void _raw_read_lock(rwlock_t *lock) |
189 | { | 191 | { |
190 | RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); | 192 | RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); |
191 | if (unlikely(!__raw_read_trylock(&lock->raw_lock))) | 193 | __raw_read_lock(&lock->raw_lock); |
192 | __read_lock_debug(lock); | ||
193 | } | 194 | } |
194 | 195 | ||
195 | int _raw_read_trylock(rwlock_t *lock) | 196 | int _raw_read_trylock(rwlock_t *lock) |
@@ -235,6 +236,7 @@ static inline void debug_write_unlock(rwlock_t *lock) | |||
235 | lock->owner_cpu = -1; | 236 | lock->owner_cpu = -1; |
236 | } | 237 | } |
237 | 238 | ||
239 | #if 0 /* This can cause lockups */ | ||
238 | static void __write_lock_debug(rwlock_t *lock) | 240 | static void __write_lock_debug(rwlock_t *lock) |
239 | { | 241 | { |
240 | int print_once = 1; | 242 | int print_once = 1; |
@@ -257,12 +259,12 @@ static void __write_lock_debug(rwlock_t *lock) | |||
257 | } | 259 | } |
258 | } | 260 | } |
259 | } | 261 | } |
262 | #endif | ||
260 | 263 | ||
261 | void _raw_write_lock(rwlock_t *lock) | 264 | void _raw_write_lock(rwlock_t *lock) |
262 | { | 265 | { |
263 | debug_write_lock_before(lock); | 266 | debug_write_lock_before(lock); |
264 | if (unlikely(!__raw_write_trylock(&lock->raw_lock))) | 267 | __raw_write_lock(&lock->raw_lock); |
265 | __write_lock_debug(lock); | ||
266 | debug_write_lock_after(lock); | 268 | debug_write_lock_after(lock); |
267 | } | 269 | } |
268 | 270 | ||
diff --git a/lib/ts_bm.c b/lib/ts_bm.c index 0110e4414805..d90822c378a4 100644 --- a/lib/ts_bm.c +++ b/lib/ts_bm.c | |||
@@ -111,15 +111,14 @@ static int subpattern(u8 *pattern, int i, int j, int g) | |||
111 | return ret; | 111 | return ret; |
112 | } | 112 | } |
113 | 113 | ||
114 | static void compute_prefix_tbl(struct ts_bm *bm, const u8 *pattern, | 114 | static void compute_prefix_tbl(struct ts_bm *bm) |
115 | unsigned int len) | ||
116 | { | 115 | { |
117 | int i, j, g; | 116 | int i, j, g; |
118 | 117 | ||
119 | for (i = 0; i < ASIZE; i++) | 118 | for (i = 0; i < ASIZE; i++) |
120 | bm->bad_shift[i] = len; | 119 | bm->bad_shift[i] = bm->patlen; |
121 | for (i = 0; i < len - 1; i++) | 120 | for (i = 0; i < bm->patlen - 1; i++) |
122 | bm->bad_shift[pattern[i]] = len - 1 - i; | 121 | bm->bad_shift[bm->pattern[i]] = bm->patlen - 1 - i; |
123 | 122 | ||
124 | /* Compute the good shift array, used to match reocurrences | 123 | /* Compute the good shift array, used to match reocurrences |
125 | * of a subpattern */ | 124 | * of a subpattern */ |
@@ -150,8 +149,8 @@ static struct ts_config *bm_init(const void *pattern, unsigned int len, | |||
150 | bm = ts_config_priv(conf); | 149 | bm = ts_config_priv(conf); |
151 | bm->patlen = len; | 150 | bm->patlen = len; |
152 | bm->pattern = (u8 *) bm->good_shift + prefix_tbl_len; | 151 | bm->pattern = (u8 *) bm->good_shift + prefix_tbl_len; |
153 | compute_prefix_tbl(bm, pattern, len); | ||
154 | memcpy(bm->pattern, pattern, len); | 152 | memcpy(bm->pattern, pattern, len); |
153 | compute_prefix_tbl(bm); | ||
155 | 154 | ||
156 | return conf; | 155 | return conf; |
157 | } | 156 | } |
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c index 7f922dccf1a5..fceb97c3aff7 100644 --- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c | |||
@@ -347,7 +347,10 @@ int zlib_inflate(z_streamp strm, int flush) | |||
347 | static const unsigned short order[19] = /* permutation of code lengths */ | 347 | static const unsigned short order[19] = /* permutation of code lengths */ |
348 | {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; | 348 | {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; |
349 | 349 | ||
350 | if (strm == NULL || strm->state == NULL || strm->next_out == NULL || | 350 | /* Do not check for strm->next_out == NULL here as ppc zImage |
351 | inflates to strm->next_out = 0 */ | ||
352 | |||
353 | if (strm == NULL || strm->state == NULL || | ||
351 | (strm->next_in == NULL && strm->avail_in != 0)) | 354 | (strm->next_in == NULL && strm->avail_in != 0)) |
352 | return Z_STREAM_ERROR; | 355 | return Z_STREAM_ERROR; |
353 | 356 | ||