From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com ([134.134.136.20]:2808 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934517AbeEIOxQ (ORCPT ); Wed, 9 May 2018 10:53:16 -0400 Date: Wed, 9 May 2018 22:52:45 +0800 From: kbuild test robot To: Gabriel Krisman Bertazi Cc: kbuild-all@01.org, linux-fsdevel@vger.kernel.org, jra@google.com, tytso@mit.edu, olaf@sgi.com, darrick.wong@oracle.com, kernel@lists.collabora.co.uk, Gabriel Krisman Bertazi Subject: Re: [PATCH 04/15] nls: Split default charset from NLS core Message-ID: <201805092210.rmRjBwsU%fengguang.wu@intel.com> References: <20180509064800.28658-5-krisman@collabora.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509064800.28658-5-krisman@collabora.co.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Gabriel, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v4.17-rc4] [cannot apply to next-20180509] [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/Gabriel-Krisman-Bertazi/NLS-refactor-and-UTF-8-normalization/20180509-190115 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> fs/nls/nls_default.c:118:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:118:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:118:20: got restricted __le16 [usertype] fs/nls/nls_default.c:121:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:121:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:121:20: got restricted __be16 [usertype] >> fs/nls/nls_default.c:118:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:118:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:118:20: got restricted __le16 [usertype] fs/nls/nls_default.c:121:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:121:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:121:20: got restricted __be16 [usertype] >> fs/nls/nls_default.c:118:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:118:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:118:20: got restricted __le16 [usertype] fs/nls/nls_default.c:121:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:121:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:121:20: got restricted __be16 [usertype] >> fs/nls/nls_default.c:118:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:118:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:118:20: got restricted __le16 [usertype] fs/nls/nls_default.c:121:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [short] [usertype] @@ got unsigned] [short] [usertype] @@ fs/nls/nls_default.c:121:20: expected unsigned short [unsigned] [short] [usertype] fs/nls/nls_default.c:121:20: got restricted __be16 [usertype] >> fs/nls/nls_default.c:174:24: sparse: cast to restricted __le16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:174:24: sparse: cast to restricted __le16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 >> fs/nls/nls_default.c:176:24: sparse: cast to restricted __be16 vim +118 fs/nls/nls_default.c 110 111 static inline void put_utf16(wchar_t *s, unsigned c, enum utf16_endian endian) 112 { 113 switch (endian) { 114 default: 115 *s = (wchar_t) c; 116 break; 117 case UTF16_LITTLE_ENDIAN: > 118 *s = __cpu_to_le16(c); 119 break; 120 case UTF16_BIG_ENDIAN: > 121 *s = __cpu_to_be16(c); 122 break; 123 } 124 } 125 126 int utf8s_to_utf16s(const u8 *s, int inlen, enum utf16_endian endian, 127 wchar_t *pwcs, int maxout) 128 { 129 u16 *op; 130 int size; 131 unicode_t u; 132 133 op = pwcs; 134 while (inlen > 0 && maxout > 0 && *s) { 135 if (*s & 0x80) { 136 size = utf8_to_utf32(s, inlen, &u); 137 if (size < 0) 138 return -EINVAL; 139 s += size; 140 inlen -= size; 141 142 if (u >= PLANE_SIZE) { 143 if (maxout < 2) 144 break; 145 u -= PLANE_SIZE; 146 put_utf16(op++, SURROGATE_PAIR | 147 ((u >> 10) & SURROGATE_BITS), 148 endian); 149 put_utf16(op++, SURROGATE_PAIR | 150 SURROGATE_LOW | 151 (u & SURROGATE_BITS), 152 endian); 153 maxout -= 2; 154 } else { 155 put_utf16(op++, u, endian); 156 maxout--; 157 } 158 } else { 159 put_utf16(op++, *s++, endian); 160 inlen--; 161 maxout--; 162 } 163 } 164 return op - pwcs; 165 } 166 EXPORT_SYMBOL(utf8s_to_utf16s); 167 168 static inline unsigned long get_utf16(unsigned c, enum utf16_endian endian) 169 { 170 switch (endian) { 171 default: 172 return c; 173 case UTF16_LITTLE_ENDIAN: > 174 return __le16_to_cpu(c); 175 case UTF16_BIG_ENDIAN: > 176 return __be16_to_cpu(c); 177 } 178 } 179 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation