* [mmotm:master 153/230] lib/glob.c:48:32: sparse: Using plain integer as NULL pointer
[not found] <53a3cf27.i2H5zBcGy/9VGAAt%fengguang.wu@intel.com>
@ 2014-06-20 7:52 ` Fengguang Wu
0 siblings, 0 replies; only message in thread
From: Fengguang Wu @ 2014-06-20 7:52 UTC (permalink / raw)
To: George Spelvin
Cc: kbuild-all, Johannes Weiner, Andrew Morton,
Linux Memory Management List
tree: git://git.cmpxchg.org/linux-mmotm.git master
head: df25ba7db0775d87018e2cd92f26b9b087093840
commit: 31b8d64a94ed8129048a904cc07c11a05c2efd6f [153/230] libata: Use glob_match from lib/glob.c
reproduce: make C=1 CF=-D__CHECK_ENDIAN__
>> lib/glob.c:48:32: sparse: Using plain integer as NULL pointer
vim +48 lib/glob.c
37e65fe1 George Spelvin 2014-06-20 32 * treat / or leading . specially; it isn't actually used for pathnames.
37e65fe1 George Spelvin 2014-06-20 33 *
37e65fe1 George Spelvin 2014-06-20 34 * Note that according to glob(7) (and unlike bash), character classes
37e65fe1 George Spelvin 2014-06-20 35 * are complemented by a leading !; this does not support the regex-style
37e65fe1 George Spelvin 2014-06-20 36 * [^a-z] syntax.
37e65fe1 George Spelvin 2014-06-20 37 *
37e65fe1 George Spelvin 2014-06-20 38 * An opening bracket without a matching close is matched literally.
37e65fe1 George Spelvin 2014-06-20 39 */
37e65fe1 George Spelvin 2014-06-20 40 bool __pure glob_match(char const *pat, char const *str)
37e65fe1 George Spelvin 2014-06-20 41 {
37e65fe1 George Spelvin 2014-06-20 42 /*
37e65fe1 George Spelvin 2014-06-20 43 * Backtrack to previous * on mismatch and retry starting one
37e65fe1 George Spelvin 2014-06-20 44 * character later in the string. Because * matches all characters
37e65fe1 George Spelvin 2014-06-20 45 * (no exception for /), it can be easily proved that there's
37e65fe1 George Spelvin 2014-06-20 46 * never a need to backtrack multiple levels.
37e65fe1 George Spelvin 2014-06-20 47 */
37e65fe1 George Spelvin 2014-06-20 @48 char const *back_pat = 0, *back_str = back_str;
37e65fe1 George Spelvin 2014-06-20 49
37e65fe1 George Spelvin 2014-06-20 50 /*
37e65fe1 George Spelvin 2014-06-20 51 * Loop over each token (character or class) in pat, matching
37e65fe1 George Spelvin 2014-06-20 52 * it against the remaining unmatched tail of str. Return false
37e65fe1 George Spelvin 2014-06-20 53 * on mismatch, or true after matching the trailing nul bytes.
37e65fe1 George Spelvin 2014-06-20 54 */
37e65fe1 George Spelvin 2014-06-20 55 for (;;) {
37e65fe1 George Spelvin 2014-06-20 56 unsigned char c = *str++;
---
0-DAY kernel build testing backend Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-20 7:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <53a3cf27.i2H5zBcGy/9VGAAt%fengguang.wu@intel.com>
2014-06-20 7:52 ` [mmotm:master 153/230] lib/glob.c:48:32: sparse: Using plain integer as NULL pointer Fengguang Wu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.