linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: George Spelvin <linux@horizon.com>
Cc: kbuild-all@01.org, Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [mmotm:master 153/230] lib/glob.c:48:32: sparse: Using plain integer as NULL pointer
Date: Fri, 20 Jun 2014 15:52:18 +0800	[thread overview]
Message-ID: <20140620075218.GA3059@localhost> (raw)
In-Reply-To: <53a3cf27.i2H5zBcGy/9VGAAt%fengguang.wu@intel.com>

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>

           reply	other threads:[~2014-06-20  7:52 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <53a3cf27.i2H5zBcGy/9VGAAt%fengguang.wu@intel.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140620075218.GA3059@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@horizon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).