public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Hector Martin <marcan@marcan.st>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [asahilinux:pr/22 95/189] lib/vsprintf.c:1804:30: sparse: sparse: cast to restricted __le32
Date: Fri, 29 Apr 2022 00:15:12 +0800	[thread overview]
Message-ID: <202204290013.olXBPppO-lkp@intel.com> (raw)

tree:   https://github.com/AsahiLinux/linux pr/22
head:   7ee315306d1a3b0da8cf2a53e7f55889d0e7f034
commit: 87176f64712bb42092a6c89189f8b788f36eb70b [95/189] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc
config: powerpc-randconfig-s031-20220427 (https://download.01.org/0day-ci/archive/20220429/202204290013.olXBPppO-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 11.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/AsahiLinux/linux/commit/87176f64712bb42092a6c89189f8b788f36eb70b
        git remote add asahilinux https://github.com/AsahiLinux/linux
        git fetch --no-tags asahilinux pr/22
        git checkout 87176f64712bb42092a6c89189f8b788f36eb70b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> lib/vsprintf.c:1804:30: sparse: sparse: cast to restricted __le32
>> lib/vsprintf.c:1807:30: sparse: sparse: cast to restricted __be32

vim +1804 lib/vsprintf.c

  1778	
  1779	static noinline_for_stack
  1780	char *fourcc_string(char *buf, char *end, const u32 *fourcc,
  1781			    struct printf_spec spec, const char *fmt)
  1782	{
  1783		char output[sizeof("0123 little-endian (0x01234567)")];
  1784		char *p = output;
  1785		unsigned int i;
  1786		bool pix_fmt = false;
  1787		u32 orig, val;
  1788	
  1789		if (fmt[1] != 'c')
  1790			return error_string(buf, end, "(%p4?)", spec);
  1791	
  1792		if (check_pointer(&buf, end, fourcc, spec))
  1793			return buf;
  1794	
  1795		orig = get_unaligned(fourcc);
  1796		switch (fmt[2]) {
  1797		case 'h':
  1798			val = orig;
  1799			break;
  1800		case 'r':
  1801			val = orig = swab32(orig);
  1802			break;
  1803		case 'l':
> 1804			val = orig = le32_to_cpu(orig);
  1805			break;
  1806		case 'b':
> 1807			val = orig = be32_to_cpu(orig);
  1808			break;
  1809		case 'c':
  1810			/* Pixel formats are printed LSB-first */
  1811			val = swab32(orig & ~BIT(31));
  1812			pix_fmt = true;
  1813			break;
  1814		default:
  1815			return error_string(buf, end, "(%p4?)", spec);
  1816		}
  1817	
  1818		for (i = 0; i < sizeof(u32); i++) {
  1819			unsigned char c = val >> ((3 - i) * 8);
  1820	
  1821			/* Print non-control ASCII characters as-is, dot otherwise */
  1822			*p++ = isascii(c) && isprint(c) ? c : '.';
  1823		}
  1824	
  1825		if (pix_fmt) {
  1826			*p++ = ' ';
  1827			strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
  1828			p += strlen(p);
  1829		}
  1830	
  1831		*p++ = ' ';
  1832		*p++ = '(';
  1833		p = special_hex_number(p, output + sizeof(output) - 2, orig, sizeof(u32));
  1834		*p++ = ')';
  1835		*p = '\0';
  1836	
  1837		return string(buf, end, output, spec);
  1838	}
  1839	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-28 16:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202204290013.olXBPppO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    /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