From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTGi1-0001fH-QF for linux-mtd@lists.infradead.org; Thu, 14 Jun 2018 01:05:55 +0000 Date: Thu, 14 Jun 2018 09:04:40 +0800 From: kbuild test robot To: Richard Weinberger Cc: kbuild-all@01.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Richard Weinberger Subject: Re: [PATCH 01/14] ubi: fastmap: Read PEB numbers more carefully Message-ID: <201806140802.6mK4vHdX%fengguang.wu@intel.com> References: <20180613212344.11608-2-richard@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180613212344.11608-2-richard@nod.at> List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Richard, I love your patch! Perhaps something to improve: [auto build test WARNING on mtd/master] [also build test WARNING on v4.17 next-20180613] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Richard-Weinberger/ubi-Fastmap-updates/20180614-052830 base: git://git.infradead.org/linux-mtd.git master reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> drivers/mtd/ubi/fastmap.c:110:14: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] pnum @@ got [usertype] pnum @@ drivers/mtd/ubi/fastmap.c:110:14: expected restricted __be32 [usertype] pnum drivers/mtd/ubi/fastmap.c:110:14: got unsigned int >> drivers/mtd/ubi/fastmap.c:111:13: sparse: restricted __be32 degrades to integer >> drivers/mtd/ubi/fastmap.c:112:27: sparse: incorrect type in assignment (different base types) @@ expected int [signed] @@ got restricted __be3int [signed] @@ drivers/mtd/ubi/fastmap.c:112:27: expected int [signed] drivers/mtd/ubi/fastmap.c:112:27: got restricted __be32 [usertype] pnum drivers/mtd/ubi/fastmap.c:116:13: sparse: restricted __be32 degrades to integer drivers/mtd/ubi/fastmap.c:116:25: sparse: restricted __be32 degrades to integer drivers/mtd/ubi/fastmap.c:121:27: sparse: incorrect type in assignment (different base types) @@ expected int [signed] @@ got restricted __be3int [signed] @@ drivers/mtd/ubi/fastmap.c:121:27: expected int [signed] drivers/mtd/ubi/fastmap.c:121:27: got restricted __be32 [usertype] pnum drivers/mtd/ubi/fastmap.c:604:23: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [unsigned] max_sqnum @@ got nsigned long long [unsigned] max_sqnum @@ drivers/mtd/ubi/fastmap.c:604:23: expected unsigned long long [unsigned] max_sqnum drivers/mtd/ubi/fastmap.c:604:23: got restricted __be64 [usertype] sqnum drivers/mtd/ubi/fastmap.c:1075:17: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] tmp_crc @@ got [usertype] tmp_crc @@ drivers/mtd/ubi/fastmap.c:1075:17: expected restricted __be32 [usertype] tmp_crc drivers/mtd/ubi/fastmap.c:1075:17: got unsigned int drivers/mtd/ubi/fastmap.c:1077:13: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] crc @@ got [usertype] crc @@ drivers/mtd/ubi/fastmap.c:1077:13: expected restricted __be32 [usertype] crc drivers/mtd/ubi/fastmap.c:1077:13: got unsigned int drivers/mtd/ubi/fastmap.c:1086:22: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [usertype] sqnum @@ got unsigned lonrestricted __be64 [usertype] sqnum @@ drivers/mtd/ubi/fastmap.c:1086:22: expected restricted __be64 [usertype] sqnum drivers/mtd/ubi/fastmap.c:1086:22: got unsigned long long [unsigned] [assigned] sqnum vim +110 drivers/mtd/ubi/fastmap.c 103 104 static bool read_pnum(struct ubi_device *ubi, struct ubi_attach_info *ai, 105 __be32 pnum, int *out_pnum) 106 { 107 int ret = true; 108 int max_pnum = ubi->peb_count; 109 > 110 pnum = be32_to_cpu(pnum); > 111 if (pnum == UBI_UNKNOWN) { > 112 *out_pnum = pnum; 113 goto out; 114 } 115 116 if (pnum < 0 || pnum >= max_pnum) { 117 ubi_err(ubi, "fastmap references PEB out of range: %i", pnum); 118 ret = false; 119 goto out; 120 } else { 121 *out_pnum = pnum; 122 } 123 124 out: 125 return ret; 126 } 127 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation