All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
Date: Tue, 11 Feb 2020 09:04:48 +0300	[thread overview]
Message-ID: <20200211060447.GS24804@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 3359 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head:   93aef18a872beaf24093f699268e56a484e31f64
commit: 93aef18a872beaf24093f699268e56a484e31f64 [23/23] lib: vsprint debug-ptrval

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.

Old smatch warnings:
lib/vsprintf.c:1405 ip6_compressed_string() warn: possible spectre second half.  '*p'
lib/vsprintf.c:1408 ip6_compressed_string() warn: possible spectre second half.  '*p'

# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?id=93aef18a872beaf24093f699268e56a484e31f64
git remote add rcar https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git remote update rcar
git checkout 93aef18a872beaf24093f699268e56a484e31f64
vim +800 lib/vsprintf.c

e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  789) 
9073dac14e397f Geert Uytterhoeven      2018-10-11  790  static char *ptr_to_id(char *buf, char *end, const void *ptr,
9073dac14e397f Geert Uytterhoeven      2018-10-11  791  		       struct printf_spec spec)
9073dac14e397f Geert Uytterhoeven      2018-10-11  792  {
9073dac14e397f Geert Uytterhoeven      2018-10-11  793  	const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
9073dac14e397f Geert Uytterhoeven      2018-10-11  794  	unsigned long hashval;
e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  795) 	int ret;
9073dac14e397f Geert Uytterhoeven      2018-10-11  796  
93aef18a872bea Laurent Pinchart        2020-02-10  797  	return pointer_string(buf, end, ptr, spec);
                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93aef18a872bea Laurent Pinchart        2020-02-10  798  
9073dac14e397f Geert Uytterhoeven      2018-10-11  799  	/* When debugging early boot use non-cryptographically secure hash. */
9073dac14e397f Geert Uytterhoeven      2018-10-11 @800  	if (unlikely(debug_boot_weak_hash)) {
9073dac14e397f Geert Uytterhoeven      2018-10-11  801  		hashval = hash_long((unsigned long)ptr, 32);
9073dac14e397f Geert Uytterhoeven      2018-10-11  802  		return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven      2018-10-11  803  	}
9073dac14e397f Geert Uytterhoeven      2018-10-11  804  
e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  805) 	ret = __ptr_to_hashval(ptr, &hashval);
e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  806) 	if (ret) {
9073dac14e397f Geert Uytterhoeven      2018-10-11  807  		spec.field_width = 2 * sizeof(ptr);
9073dac14e397f Geert Uytterhoeven      2018-10-11  808  		/* string length must be less than default_width */
c8c3b584343cb7 Petr Mladek             2019-04-17  809  		return error_string(buf, end, str, spec);
9073dac14e397f Geert Uytterhoeven      2018-10-11  810  	}
9073dac14e397f Geert Uytterhoeven      2018-10-11  811  
9073dac14e397f Geert Uytterhoeven      2018-10-11  812  	return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven      2018-10-11  813  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
Date: Tue, 11 Feb 2020 09:04:48 +0300	[thread overview]
Message-ID: <20200211060447.GS24804@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 3359 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head:   93aef18a872beaf24093f699268e56a484e31f64
commit: 93aef18a872beaf24093f699268e56a484e31f64 [23/23] lib: vsprint debug-ptrval

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.

Old smatch warnings:
lib/vsprintf.c:1405 ip6_compressed_string() warn: possible spectre second half.  '*p'
lib/vsprintf.c:1408 ip6_compressed_string() warn: possible spectre second half.  '*p'

# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?id=93aef18a872beaf24093f699268e56a484e31f64
git remote add rcar https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git remote update rcar
git checkout 93aef18a872beaf24093f699268e56a484e31f64
vim +800 lib/vsprintf.c

e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  789) 
9073dac14e397f Geert Uytterhoeven      2018-10-11  790  static char *ptr_to_id(char *buf, char *end, const void *ptr,
9073dac14e397f Geert Uytterhoeven      2018-10-11  791  		       struct printf_spec spec)
9073dac14e397f Geert Uytterhoeven      2018-10-11  792  {
9073dac14e397f Geert Uytterhoeven      2018-10-11  793  	const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
9073dac14e397f Geert Uytterhoeven      2018-10-11  794  	unsigned long hashval;
e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  795) 	int ret;
9073dac14e397f Geert Uytterhoeven      2018-10-11  796  
93aef18a872bea Laurent Pinchart        2020-02-10  797  	return pointer_string(buf, end, ptr, spec);
                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93aef18a872bea Laurent Pinchart        2020-02-10  798  
9073dac14e397f Geert Uytterhoeven      2018-10-11  799  	/* When debugging early boot use non-cryptographically secure hash. */
9073dac14e397f Geert Uytterhoeven      2018-10-11 @800  	if (unlikely(debug_boot_weak_hash)) {
9073dac14e397f Geert Uytterhoeven      2018-10-11  801  		hashval = hash_long((unsigned long)ptr, 32);
9073dac14e397f Geert Uytterhoeven      2018-10-11  802  		return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven      2018-10-11  803  	}
9073dac14e397f Geert Uytterhoeven      2018-10-11  804  
e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  805) 	ret = __ptr_to_hashval(ptr, &hashval);
e4dcad204d3a28 Joel Fernandes (Google  2019-11-30  806) 	if (ret) {
9073dac14e397f Geert Uytterhoeven      2018-10-11  807  		spec.field_width = 2 * sizeof(ptr);
9073dac14e397f Geert Uytterhoeven      2018-10-11  808  		/* string length must be less than default_width */
c8c3b584343cb7 Petr Mladek             2019-04-17  809  		return error_string(buf, end, str, spec);
9073dac14e397f Geert Uytterhoeven      2018-10-11  810  	}
9073dac14e397f Geert Uytterhoeven      2018-10-11  811  
9073dac14e397f Geert Uytterhoeven      2018-10-11  812  	return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven      2018-10-11  813  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

             reply	other threads:[~2020-02-11  6:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  6:04 Dan Carpenter [this message]
2020-02-11  6:04 ` [rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code Dan Carpenter

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=20200211060447.GS24804@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /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 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.