[norov:bm8 6/8] include/linux/cpumask.h:602:14: error: redefinition of 'cpumask_first_and'
by kernel test robot
tree: https://github.com/norov/linux bm8
head: 0a0ad2ef1593e9a9fbb0689e791698d8496a52a8
commit: 50128e2f5132bd1f35ecb626628a6ea1cdeb8779 [6/8] cpumask: use find_first_and_bit()
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/norov/linux/commit/50128e2f5132bd1f35ecb626628a6ea1cde...
git remote add norov https://github.com/norov/linux
git fetch --no-tags norov bm8
git checkout 50128e2f5132bd1f35ecb626628a6ea1cdeb8779
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/rcupdate.h:29,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/x86/um/shared/sysdep/kernel-offsets.h:3,
from arch/um/kernel/asm-offsets.c:1:
>> include/linux/cpumask.h:602:14: error: redefinition of 'cpumask_first_and'
602 | unsigned int cpumask_first_and(const struct cpumask *srcp1, const struct cpumask *srcp2)
| ^~~~~~~~~~~~~~~~~
include/linux/cpumask.h:126:28: note: previous definition of 'cpumask_first_and' was here
126 | static inline unsigned int cpumask_first_and(const struct cpumask *srcp1,
| ^~~~~~~~~~~~~~~~~
In file included from arch/um/kernel/asm-offsets.c:1:
arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
9 | void foo(void)
| ^~~
--
arch/x86/um/user-offsets.c:18:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
18 | void foo(void)
| ^~~
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/rcupdate.h:29,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/x86/um/shared/sysdep/kernel-offsets.h:3,
from arch/um/kernel/asm-offsets.c:1:
>> include/linux/cpumask.h:602:14: error: redefinition of 'cpumask_first_and'
602 | unsigned int cpumask_first_and(const struct cpumask *srcp1, const struct cpumask *srcp2)
| ^~~~~~~~~~~~~~~~~
include/linux/cpumask.h:126:28: note: previous definition of 'cpumask_first_and' was here
126 | static inline unsigned int cpumask_first_and(const struct cpumask *srcp1,
| ^~~~~~~~~~~~~~~~~
In file included from arch/um/kernel/asm-offsets.c:1:
arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
9 | void foo(void)
| ^~~
make[2]: *** [scripts/Makefile.build:118: arch/um/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1288: prepare0] Error 2
make[1]: Target 'modules_prepare' not remade because of errors.
make: *** [Makefile:222: __sub-make] Error 2
make: Target 'modules_prepare' not remade because of errors.
--
error: no override and no default toolchain set
init/Kconfig:70:warning: 'RUSTC_VERSION': number is invalid
arch/x86/um/user-offsets.c:18:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
18 | void foo(void)
| ^~~
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/rcupdate.h:29,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/x86/um/shared/sysdep/kernel-offsets.h:3,
from arch/um/kernel/asm-offsets.c:1:
>> include/linux/cpumask.h:602:14: error: redefinition of 'cpumask_first_and'
602 | unsigned int cpumask_first_and(const struct cpumask *srcp1, const struct cpumask *srcp2)
| ^~~~~~~~~~~~~~~~~
include/linux/cpumask.h:126:28: note: previous definition of 'cpumask_first_and' was here
126 | static inline unsigned int cpumask_first_and(const struct cpumask *srcp1,
| ^~~~~~~~~~~~~~~~~
In file included from arch/um/kernel/asm-offsets.c:1:
arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
9 | void foo(void)
| ^~~
make[2]: *** [scripts/Makefile.build:118: arch/um/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1288: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:222: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/cpumask_first_and +602 include/linux/cpumask.h
593
594 /**
595 * cpumask_first_and - return the first cpu from *srcp1 & *srcp2
596 * @src1p: the first input
597 * @src2p: the second input
598 *
599 * Returns >= nr_cpu_ids if no cpus set in both. See also cpumask_next_and().
600 */
601 static inline
> 602 unsigned int cpumask_first_and(const struct cpumask *srcp1, const struct cpumask *srcp2)
603 {
604 return find_first_and_bit(cpumask_bits(srcp1), cpumask_bits(srcp2), nr_cpumask_bits);
605 }
606
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/yocto 50/1142] drivers/gpu/drm/kmb/kmb_dsi.c:206:5: warning: no previous prototype for 'mipi_get_datatype_params'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: 8fd392d9856e8537c81f680ccade84783ef0eadb [50/1142] drm/kmb: Part 1 of Mipi Tx Initialization
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel/linux-intel-lts/commit/8fd392d9856e8537c81f680cc...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 8fd392d9856e8537c81f680ccade84783ef0eadb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/kmb/kmb_dsi.c:206:5: warning: no previous prototype for 'mipi_get_datatype_params' [-Wmissing-prototypes]
206 | u32 mipi_get_datatype_params(u32 data_type, u32 data_mode,
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/mipi_get_datatype_params +206 drivers/gpu/drm/kmb/kmb_dsi.c
205
> 206 u32 mipi_get_datatype_params(u32 data_type, u32 data_mode,
207 struct mipi_data_type_params *params)
208 {
209 struct mipi_data_type_params data_type_parameters;
210
211 switch (data_type) {
212 case DSI_LP_DT_PPS_YCBCR420_12B:
213 data_type_parameters.size_constraint_pixels = 2;
214 data_type_parameters.size_constraint_bytes = 3;
215 switch (data_mode) {
216 /* case 0 not supported according to MDK */
217 case 1:
218 case 2:
219 case 3:
220 data_type_parameters.pixels_per_pclk = 2;
221 data_type_parameters.bits_per_pclk = 24;
222 break;
223 default:
224 DRM_ERROR("DSI: Invalid data_mode %d\n", data_mode);
225 return -EINVAL;
226 };
227 break;
228 case DSI_LP_DT_PPS_YCBCR422_16B:
229 data_type_parameters.size_constraint_pixels = 2;
230 data_type_parameters.size_constraint_bytes = 4;
231 switch (data_mode) {
232 /* case 0 and 1 not supported according to MDK */
233 case 2:
234 data_type_parameters.pixels_per_pclk = 1;
235 data_type_parameters.bits_per_pclk = 16;
236 break;
237 case 3:
238 data_type_parameters.pixels_per_pclk = 2;
239 data_type_parameters.bits_per_pclk = 32;
240 break;
241 default:
242 DRM_ERROR("DSI: Invalid data_mode %d\n", data_mode);
243 return -EINVAL;
244 };
245 break;
246 case DSI_LP_DT_LPPS_YCBCR422_20B:
247 case DSI_LP_DT_PPS_YCBCR422_24B:
248 data_type_parameters.size_constraint_pixels = 2;
249 data_type_parameters.size_constraint_bytes = 6;
250 switch (data_mode) {
251 /* case 0 not supported according to MDK */
252 case 1:
253 case 2:
254 case 3:
255 data_type_parameters.pixels_per_pclk = 1;
256 data_type_parameters.bits_per_pclk = 24;
257 break;
258 default:
259 DRM_ERROR("DSI: Invalid data_mode %d\n", data_mode);
260 return -EINVAL;
261 };
262 break;
263 case DSI_LP_DT_PPS_RGB565_16B:
264 data_type_parameters.size_constraint_pixels = 1;
265 data_type_parameters.size_constraint_bytes = 2;
266 switch (data_mode) {
267 case 0:
268 case 1:
269 data_type_parameters.pixels_per_pclk = 1;
270 data_type_parameters.bits_per_pclk = 16;
271 break;
272 case 2:
273 case 3:
274 data_type_parameters.pixels_per_pclk = 2;
275 data_type_parameters.bits_per_pclk = 32;
276 break;
277 default:
278 DRM_ERROR("DSI: Invalid data_mode %d\n", data_mode);
279 return -EINVAL;
280 };
281 break;
282 case DSI_LP_DT_PPS_RGB666_18B:
283 data_type_parameters.size_constraint_pixels = 4;
284 data_type_parameters.size_constraint_bytes = 9;
285 data_type_parameters.bits_per_pclk = 18;
286 data_type_parameters.pixels_per_pclk = 1;
287 break;
288 case DSI_LP_DT_LPPS_RGB666_18B:
289 case DSI_LP_DT_PPS_RGB888_24B:
290 data_type_parameters.size_constraint_pixels = 1;
291 data_type_parameters.size_constraint_bytes = 3;
292 data_type_parameters.bits_per_pclk = 24;
293 data_type_parameters.pixels_per_pclk = 1;
294 break;
295 case DSI_LP_DT_PPS_RGB101010_30B:
296 data_type_parameters.size_constraint_pixels = 4;
297 data_type_parameters.size_constraint_bytes = 15;
298 data_type_parameters.bits_per_pclk = 30;
299 data_type_parameters.pixels_per_pclk = 1;
300 break;
301
302 default:
303 DRM_ERROR("DSI: Invalid data_type %d\n", data_type);
304 return -EINVAL;
305 }
306
307 *params = data_type_parameters;
308 return 0;
309 }
310
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/preempt-rt 15/16] kernel/printk/printk.c:2014:5: warning: no previous prototype for function 'vprintk_default'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/preempt-rt
head: 2046457bf9f4a420f69e915453d59db5b38edbaa
commit: 3c3f9863f8b96ccbf6fd420c93f1685f6085651a [15/16] Merge tag 'lts-v5.4.58-yocto-200825T002733Z' into lts2019/yocto-rt
config: arm64-randconfig-r005-20210610 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d2012d965d60c3258b3a69d024491698f8aec386)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/intel/linux-intel-lts/commit/3c3f9863f8b96ccbf6fd420c9...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/preempt-rt
git checkout 3c3f9863f8b96ccbf6fd420c93f1685f6085651a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> kernel/printk/printk.c:2014:5: warning: no previous prototype for function 'vprintk_default' [-Wmissing-prototypes]
int vprintk_default(const char *fmt, va_list args)
^
kernel/printk/printk.c:2014:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int vprintk_default(const char *fmt, va_list args)
^
static
1 warning generated.
--
>> kernel/rcu/srcutree.c:739:30: warning: unused variable 'sp_llock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(sp_llock);
^
1 warning generated.
--
lib/radix-tree.c:301:6: warning: no previous prototype for function 'radix_tree_node_rcu_free' [-Wmissing-prototypes]
void radix_tree_node_rcu_free(struct rcu_head *head)
^
lib/radix-tree.c:301:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void radix_tree_node_rcu_free(struct rcu_head *head)
^
static
>> lib/radix-tree.c:75:30: warning: unused variable 'radix_tree_preloads_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(radix_tree_preloads_lock);
^
2 warnings generated.
--
>> mm/swap.c:56:30: warning: unused variable 'rotate_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(rotate_lock);
^
1 warning generated.
--
mm/page_alloc.c:6098:23: warning: no previous prototype for function 'memmap_init' [-Wmissing-prototypes]
void __meminit __weak memmap_init(unsigned long size, int nid,
^
mm/page_alloc.c:6098:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __meminit __weak memmap_init(unsigned long size, int nid,
^
static
>> mm/page_alloc.c:361:30: warning: unused variable 'pa_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(pa_lock);
^
2 warnings generated.
--
>> mm/memcontrol.c:96:30: warning: unused variable 'event_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(event_lock);
^
mm/memcontrol.c:1010:43: warning: unused function 'get_mem_cgroup_from_current' [-Wunused-function]
static __always_inline struct mem_cgroup *get_mem_cgroup_from_current(void)
^
2 warnings generated.
--
>> mm/zsmalloc.c:500:30: warning: unused variable 'zs_map_area_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(zs_map_area_lock);
^
1 warning generated.
vim +/vprintk_default +2014 kernel/printk/printk.c
^1da177e4c3f41 kernel/printk.c Linus Torvalds 2005-04-16 2013
a0cba2179ea4c1 kernel/printk/printk.c Linus Torvalds 2016-08-09 @2014 int vprintk_default(const char *fmt, va_list args)
afdc34a3d3b823 kernel/printk/printk.c Steven Rostedt (Red Hat 2014-06-19 2015) {
afdc34a3d3b823 kernel/printk/printk.c Steven Rostedt (Red Hat 2014-06-19 2016) int r;
afdc34a3d3b823 kernel/printk/printk.c Steven Rostedt (Red Hat 2014-06-19 2017)
:::::: The code at line 2014 was first introduced by commit
:::::: a0cba2179ea4c1820fce2ee046b6ed90ecc56196 Revert "printk: create pr_<level> functions"
:::::: TO: Linus Torvalds <torvalds(a)linux-foundation.org>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/preempt-rt 7050/16579] drivers/misc/gna/gna_drv.c:270:6: error: no previous prototype for 'gna_dev_release'
by kernel test robot
Hi Seng,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 5.4/preempt-rt
head: b428b2464d25f05987f834bbd84273b8d6859495
commit: 2d2e3dc79dbf54b9905e4086db001a25047d8c0c [7050/16579] Enable support for GNA drivers based on GNA API specification 2.0
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/linux-intel-lts/commit/2d2e3dc79dbf54b9905e4086d...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/preempt-rt
git checkout 2d2e3dc79dbf54b9905e4086db001a25047d8c0c
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/misc/gna/gna_drv.c:270:6: error: no previous prototype for 'gna_dev_release' [-Werror=missing-prototypes]
270 | void gna_dev_release(struct device *dev)
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
drivers/misc/gna/gna_ioctl.c: In function 'gna_ioctl':
>> drivers/misc/gna/gna_ioctl.c:251:6: error: variable 'size' set but not used [-Werror=unused-but-set-variable]
251 | u64 size;
| ^~~~
>> drivers/misc/gna/gna_ioctl.c:250:8: error: variable 'data' set but not used [-Werror=unused-but-set-variable]
250 | void *data;
| ^~~~
cc1: all warnings being treated as errors
--
drivers/misc/gna/gna_mem.c: In function 'gna_priv_userptr':
>> drivers/misc/gna/gna_mem.c:527:20: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
527 | if (mo->memory_id < 0) {
| ^
cc1: all warnings being treated as errors
--
>> drivers/misc/gna/gna_pci.c:37:21: error: initialized field overwritten [-Werror=override-init]
37 | .max_layer_count = 4096
| ^~~~
drivers/misc/gna/gna_pci.c:61:2: note: in expansion of macro 'GNA_GEN2_FEATURES'
61 | GNA_GEN2_FEATURES
| ^~~~~~~~~~~~~~~~~
drivers/misc/gna/gna_pci.c:37:21: note: (near initialization for 'jsl_drv_info.max_layer_count')
37 | .max_layer_count = 4096
| ^~~~
drivers/misc/gna/gna_pci.c:61:2: note: in expansion of macro 'GNA_GEN2_FEATURES'
61 | GNA_GEN2_FEATURES
| ^~~~~~~~~~~~~~~~~
>> drivers/misc/gna/gna_pci.c:37:21: error: initialized field overwritten [-Werror=override-init]
37 | .max_layer_count = 4096
| ^~~~
drivers/misc/gna/gna_pci.c:66:2: note: in expansion of macro 'GNA_GEN2_FEATURES'
66 | GNA_GEN2_FEATURES
| ^~~~~~~~~~~~~~~~~
drivers/misc/gna/gna_pci.c:37:21: note: (near initialization for 'tgl_drv_info.max_layer_count')
37 | .max_layer_count = 4096
| ^~~~
drivers/misc/gna/gna_pci.c:66:2: note: in expansion of macro 'GNA_GEN2_FEATURES'
66 | GNA_GEN2_FEATURES
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/gna_dev_release +270 drivers/misc/gna/gna_drv.c
269
> 270 void gna_dev_release(struct device *dev)
271 {
272 struct gna_private *gna_priv;
273
274 dev_dbg(dev, "%s enter\n", __func__);
275
276 gna_priv = dev_get_drvdata(dev);
277
278 __clear_bit(MINOR(dev->devt), gna_drv_priv.dev_map);
279 flush_workqueue(gna_priv->request_wq);
280 destroy_workqueue(gna_priv->request_wq);
281 idr_destroy(&gna_priv->memory_idr);
282 gna_mmu_free(gna_priv);
283 dev_set_drvdata(dev, NULL);
284 pci_set_drvdata(gna_priv->pdev, NULL);
285
286 kfree(gna_priv);
287
288 dev_dbg(dev, "%s exit\n", __func__);
289 }
290
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/preempt-rt 7252/16579] drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:6293:6: warning: no previous prototype for 'stmmac_clean_all_tx_rings'
by kernel test robot
Hi Ong,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 5.4/preempt-rt
head: b428b2464d25f05987f834bbd84273b8d6859495
commit: c2198809408cf67767651a83f3024c6340602479 [7252/16579] net: stmmac: clean all pending Tx buffers during suspend
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel/linux-intel-lts/commit/c2198809408cf67767651a83f...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/preempt-rt
git checkout c2198809408cf67767651a83f3024c6340602479
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 'rom_out_le16'
466 | rom_out_le16(port, *buf++);
| ^~~~~~~~~~~~
In file included from include/linux/err.h:5,
from include/linux/clk.h:12,
from drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:17:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/mutex.h:18,
from include/linux/notifier.h:14,
from include/linux/clk.h:14,
from drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:17:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
170 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h:355:19: note: in expansion of macro 'pfn_valid'
355 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_hwtstamp_set':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:555:7: warning: variable 'xmac' set but not used [-Wunused-but-set-variable]
555 | bool xmac;
| ^~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: At top level:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1403:6: warning: no previous prototype for 'stmmac_alloc_rx_buffers' [-Wmissing-prototypes]
1403 | bool stmmac_alloc_rx_buffers(struct stmmac_rx_queue *rx_q, u32 count)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_alloc_rx_buffers':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1429:13: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
1429 | while (--i >= 0)
| ^~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'init_dma_rx_desc_rings':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1537:15: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
1537 | while (queue >= 0) {
| ^~
In file included from include/linux/printk.h:327,
from include/linux/kernel.h:15,
from include/linux/clk.h:13,
from drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:17:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_rx':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:4642:27: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
4642 | netdev_dbg(priv->dev, "\tdesc: %p [entry %d] buff=0x%llx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4643 | p, entry, buf->addr);
| ~~~~~~~~~
| |
| dma_addr_t {aka unsigned int}
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
161 | _dynamic_func_call(fmt, __dynamic_netdev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/netdevice.h:4759:2: note: in expansion of macro 'dynamic_netdev_dbg'
4759 | dynamic_netdev_dbg(__dev, format, ##args); \
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:4642:5: note: in expansion of macro 'netdev_dbg'
4642 | netdev_dbg(priv->dev, "\tdesc: %p [entry %d] buff=0x%llx\n",
| ^~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:4642:60: note: format string is defined here
4642 | netdev_dbg(priv->dev, "\tdesc: %p [entry %d] buff=0x%llx\n",
| ~~~^
| |
| long long unsigned int
| %x
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_common_interrupt':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5007:6: warning: variable 'queues_count' set but not used [-Wunused-but-set-variable]
5007 | u32 queues_count;
| ^~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: At top level:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:5615:5: warning: no previous prototype for 'stmmac_xdp_xmit' [-Wmissing-prototypes]
5615 | int stmmac_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
| ^~~~~~~~~~~~~~~
>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:6293:6: warning: no previous prototype for 'stmmac_clean_all_tx_rings' [-Wmissing-prototypes]
6293 | void stmmac_clean_all_tx_rings(struct stmmac_priv *priv)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for NEED_MULTIPLE_NODES
Depends on DISCONTIGMEM || NUMA
Selected by
- SINGLE_MEMORY_CHUNK && MMU
vim +/stmmac_clean_all_tx_rings +6293 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
6292
> 6293 void stmmac_clean_all_tx_rings(struct stmmac_priv *priv)
6294 {
6295 u32 tx_count = priv->plat->tx_queues_to_use;
6296 u32 queue;
6297
6298 for (queue = 0; queue < tx_count; queue++) {
6299 struct stmmac_tx_queue *tx_q = get_tx_queue(priv, queue);
6300
6301 stmmac_clean_tx_queue(priv, tx_q);
6302 }
6303 }
6304
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/yocto 44/1142] drivers/gpu/drm/kmb/kmb_plane.c:57:14: warning: no previous prototype for 'set_pixel_format'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: 5dd63f642613babcc3b8eea1bc8212dc15f10558 [44/1142] drm/kmb: Set correct values in the LAYERn_CFG register
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel/linux-intel-lts/commit/5dd63f642613babcc3b8eea1b...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 5dd63f642613babcc3b8eea1bc8212dc15f10558
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/kmb/kmb_plane.c:57:14: warning: no previous prototype for 'set_pixel_format' [-Wmissing-prototypes]
57 | unsigned int set_pixel_format(u32 format)
| ^~~~~~~~~~~~~~~~
>> drivers/gpu/drm/kmb/kmb_plane.c:144:14: warning: no previous prototype for 'set_bits_per_pixel' [-Wmissing-prototypes]
144 | unsigned int set_bits_per_pixel(const struct drm_format_info *format)
| ^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/kmb/kmb_plane.c:275:25: warning: no previous prototype for 'kmb_plane_duplicate_state' [-Wmissing-prototypes]
275 | struct drm_plane_state *kmb_plane_duplicate_state(struct drm_plane *plane)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +/set_pixel_format +57 drivers/gpu/drm/kmb/kmb_plane.c
56
> 57 unsigned int set_pixel_format(u32 format)
58 {
59 unsigned int val = 0;
60
61 switch (format) {
62 /*planar formats */
63 case DRM_FORMAT_YUV444:
64 val = LCD_LAYER_FORMAT_YCBCR444PLAN | LCD_LAYER_PLANAR_STORAGE;
65 break;
66 case DRM_FORMAT_YVU444:
67 val = LCD_LAYER_FORMAT_YCBCR444PLAN | LCD_LAYER_PLANAR_STORAGE
68 | LCD_LAYER_CRCB_ORDER;
69 break;
70 case DRM_FORMAT_YUV422:
71 val = LCD_LAYER_FORMAT_YCBCR422PLAN | LCD_LAYER_PLANAR_STORAGE;
72 break;
73 case DRM_FORMAT_YVU422:
74 val = LCD_LAYER_FORMAT_YCBCR422PLAN | LCD_LAYER_PLANAR_STORAGE
75 | LCD_LAYER_CRCB_ORDER;
76 break;
77 case DRM_FORMAT_YUV420:
78 val = LCD_LAYER_FORMAT_YCBCR420PLAN | LCD_LAYER_PLANAR_STORAGE;
79 break;
80 case DRM_FORMAT_YVU420:
81 val = LCD_LAYER_FORMAT_YCBCR420PLAN | LCD_LAYER_PLANAR_STORAGE
82 | LCD_LAYER_CRCB_ORDER;
83 break;
84 case DRM_FORMAT_NV12:
85 val = LCD_LAYER_FORMAT_NV12 | LCD_LAYER_PLANAR_STORAGE;
86 break;
87 case DRM_FORMAT_NV21:
88 val = LCD_LAYER_FORMAT_NV12 | LCD_LAYER_PLANAR_STORAGE
89 | LCD_LAYER_CRCB_ORDER;
90 break;
91 /* packed formats */
92 case DRM_FORMAT_RGB332:
93 val = LCD_LAYER_FORMAT_RGB332;
94 break;
95 case DRM_FORMAT_XBGR4444:
96 val = LCD_LAYER_FORMAT_RGBX4444 | LCD_LAYER_BGR_ORDER;
97 break;
98 case DRM_FORMAT_ARGB4444:
99 val = LCD_LAYER_FORMAT_RGBA4444;
100 break;
101 case DRM_FORMAT_ABGR4444:
102 val = LCD_LAYER_FORMAT_RGBA4444 | LCD_LAYER_BGR_ORDER;
103 break;
104 case DRM_FORMAT_XRGB1555:
105 val = LCD_LAYER_FORMAT_XRGB1555;
106 break;
107 case DRM_FORMAT_XBGR1555:
108 val = LCD_LAYER_FORMAT_XRGB1555 | LCD_LAYER_BGR_ORDER;
109 break;
110 case DRM_FORMAT_ARGB1555:
111 val = LCD_LAYER_FORMAT_RGBA1555;
112 break;
113 case DRM_FORMAT_ABGR1555:
114 val = LCD_LAYER_FORMAT_RGBA1555 | LCD_LAYER_BGR_ORDER;
115 break;
116 case DRM_FORMAT_RGB565:
117 val = LCD_LAYER_FORMAT_RGB565;
118 break;
119 case DRM_FORMAT_BGR565:
120 val = LCD_LAYER_FORMAT_RGB565 | LCD_LAYER_BGR_ORDER;
121 break;
122 case DRM_FORMAT_RGB888:
123 val = LCD_LAYER_FORMAT_RGB888;
124 break;
125 case DRM_FORMAT_BGR888:
126 val = LCD_LAYER_FORMAT_RGB888 | LCD_LAYER_BGR_ORDER;
127 break;
128 case DRM_FORMAT_XRGB8888:
129 val = LCD_LAYER_FORMAT_RGBX8888;
130 break;
131 case DRM_FORMAT_XBGR8888:
132 val = LCD_LAYER_FORMAT_RGBX8888 | LCD_LAYER_BGR_ORDER;
133 break;
134 case DRM_FORMAT_ARGB8888:
135 val = LCD_LAYER_FORMAT_RGBA8888;
136 break;
137 case DRM_FORMAT_ABGR8888:
138 val = LCD_LAYER_FORMAT_RGBA8888 | LCD_LAYER_BGR_ORDER;
139 break;
140 }
141 return val;
142 }
143
> 144 unsigned int set_bits_per_pixel(const struct drm_format_info *format)
145 {
146 int i;
147 u32 bpp = 0;
148 unsigned int val = 0;
149
150 for (i = 0; i < format->num_planes; i++)
151 bpp += 8*format->cpp[i];
152
153 switch (bpp) {
154 case 8:
155 val = LCD_LAYER_8BPP;
156 break;
157 case 16:
158 val = LCD_LAYER_16BPP;
159 break;
160 case 24:
161 val = LCD_LAYER_24BPP;
162 break;
163 case 32:
164 val = LCD_LAYER_32BPP;
165 break;
166 }
167 return val;
168 }
169
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
arch/m68k/68000/dragen2.c:73:16: error: 'screen_bits' undeclared
by kernel test robot
Hi Arnd,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 614124bea77e452aa6df7a8714e8bc820b489922
commit: a734bbf694270dca8594a5c33375867dc31503f5 m68k: m68328: move platform code to separate files
date: 6 months ago
config: m68k-randconfig-r021-20210608 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a734bbf694270dca8594a5c33375867dc31503f5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/m68k/68000/dragen2.c:38:13: warning: no previous prototype for 'init_dragen2' [-Wmissing-prototypes]
38 | void __init init_dragen2(char *command, int size)
| ^~~~~~~~~~~~
arch/m68k/68000/dragen2.c: In function 'init_dragen2':
>> arch/m68k/68000/dragen2.c:73:16: error: 'screen_bits' undeclared (first use in this function)
73 | LSSA = (long) screen_bits;
| ^~~~~~~~~~~
arch/m68k/68000/dragen2.c:73:16: note: each undeclared identifier is reported only once for each function it appears in
vim +/screen_bits +73 arch/m68k/68000/dragen2.c
45
46 /* CSGB Init */
47 CSGBB = 0x4000;
48 CSB = 0x1a1;
49
50 /* CS8900 init */
51 /* PK3: hardware sleep function pin, active low */
52 PKSEL |= PK(3); /* select pin as I/O */
53 PKDIR |= PK(3); /* select pin as output */
54 PKDATA |= PK(3); /* set pin high */
55
56 /* PF5: hardware reset function pin, active high */
57 PFSEL |= PF(5); /* select pin as I/O */
58 PFDIR |= PF(5); /* select pin as output */
59 PFDATA &= ~PF(5); /* set pin low */
60
61 /* cs8900 hardware reset */
62 PFDATA |= PF(5);
63 { int i; for (i = 0; i < 32000; ++i); }
64 PFDATA &= ~PF(5);
65
66 /* INT1 enable (cs8900 IRQ) */
67 PDPOL &= ~PD(1); /* active high signal */
68 PDIQEG &= ~PD(1);
69 PDIRQEN |= PD(1); /* IRQ enabled */
70
71 #ifdef CONFIG_INIT_LCD
72 /* initialize LCD controller */
> 73 LSSA = (long) screen_bits;
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/preempt-rt 15/16] drivers/connector/cn_proc.c:44:30: warning: unused variable 'send_msg_lock'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/preempt-rt
head: 2046457bf9f4a420f69e915453d59db5b38edbaa
commit: 3c3f9863f8b96ccbf6fd420c93f1685f6085651a [15/16] Merge tag 'lts-v5.4.58-yocto-200825T002733Z' into lts2019/yocto-rt
config: powerpc64-randconfig-r034-20210610 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d2012d965d60c3258b3a69d024491698f8aec386)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/intel/linux-intel-lts/commit/3c3f9863f8b96ccbf6fd420c9...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/preempt-rt
git checkout 3c3f9863f8b96ccbf6fd420c93f1685f6085651a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/connector/cn_proc.c:11:
In file included from include/linux/kernel.h:11:
In file included from include/linux/compiler.h:256:
arch/powerpc/include/asm/barrier.h:47:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
^
<built-in>:309:9: note: previous definition is here
#define __lwsync __builtin_ppc_lwsync
^
>> drivers/connector/cn_proc.c:44:30: warning: unused variable 'send_msg_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(send_msg_lock);
^
2 warnings generated.
--
In file included from fs/squashfs/decompressor_multi_percpu.c:8:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:5:
In file included from include/linux/mmdebug.h:5:
In file included from include/linux/bug.h:5:
In file included from arch/powerpc/include/asm/bug.h:120:
In file included from include/asm-generic/bug.h:5:
In file included from include/linux/compiler.h:256:
arch/powerpc/include/asm/barrier.h:47:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
^
<built-in>:309:9: note: previous definition is here
#define __lwsync __builtin_ppc_lwsync
^
>> fs/squashfs/decompressor_multi_percpu.c:27:30: warning: unused variable 'stream_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(stream_lock);
^
2 warnings generated.
--
In file included from mm/zswap.c:16:
In file included from include/linux/module.h:9:
In file included from include/linux/list.h:9:
In file included from include/linux/kernel.h:11:
In file included from include/linux/compiler.h:256:
arch/powerpc/include/asm/barrier.h:47:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
^
<built-in>:309:9: note: previous definition is here
#define __lwsync __builtin_ppc_lwsync
^
>> mm/zswap.c:376:30: warning: unused variable 'zswap_cpu_lock' [-Wunused-const-variable]
static DEFINE_LOCAL_IRQ_LOCK(zswap_cpu_lock);
^
2 warnings generated.
vim +/send_msg_lock +44 drivers/connector/cn_proc.c
9f46080c41d5f3 Matt Helsley 2005-11-07 41
cc398c2eae35b1 David S. Miller 2006-01-08 42 /* proc_event_counts is used as the sequence number of the netlink message */
9f46080c41d5f3 Matt Helsley 2005-11-07 43 static DEFINE_PER_CPU(__u32, proc_event_counts) = { 0 };
78412101a22410 Mike Galbraith 2016-10-16 @44 static DEFINE_LOCAL_IRQ_LOCK(send_msg_lock);
9f46080c41d5f3 Matt Helsley 2005-11-07 45
:::::: The code at line 44 was first introduced by commit
:::::: 78412101a22410944389c3bbc954ba97a0f47e0f connector/cn_proc: Protect send_msg() with a local lock on RT
:::::: TO: Mike Galbraith <umgwanakikbuti(a)gmail.com>
:::::: CC: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[chrome-os:chromeos-5.4 114/249] drivers/bluetooth/hci_h5.c:801:18: error: variable 'hdev' set but not used
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 7d447bb293df1263f722e38a09c553f431f1ddc6
commit: 886e310cf5af7ee90cc42bd148100307834150ae [114/249] CHROMIUM: Bluetooth: hci_h5: keep RTL8822C powered during suspend
config: x86_64-randconfig-r025-20210609 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout 886e310cf5af7ee90cc42bd148100307834150ae
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/bluetooth/hci_h5.c: In function 'h5_serdev_probe':
>> drivers/bluetooth/hci_h5.c:801:18: error: variable 'hdev' set but not used [-Werror=unused-but-set-variable]
801 | struct hci_dev *hdev;
| ^~~~
cc1: all warnings being treated as errors
vim +/hdev +801 drivers/bluetooth/hci_h5.c
796
797 static int h5_serdev_probe(struct serdev_device *serdev)
798 {
799 const struct acpi_device_id *match;
800 struct device *dev = &serdev->dev;
> 801 struct hci_dev *hdev;
802 struct h5 *h5;
803 const struct h5_device_data *data;
804 int err;
805
806 h5 = devm_kzalloc(dev, sizeof(*h5), GFP_KERNEL);
807 if (!h5)
808 return -ENOMEM;
809
810 set_bit(HCI_UART_RESET_ON_INIT, &h5->serdev_hu.hdev_flags);
811
812 h5->hu = &h5->serdev_hu;
813 h5->serdev_hu.serdev = serdev;
814 serdev_device_set_drvdata(serdev, h5);
815
816 if (has_acpi_companion(dev)) {
817 match = acpi_match_device(dev->driver->acpi_match_table, dev);
818 if (!match)
819 return -ENODEV;
820
821 data = (const struct h5_device_data *)match->driver_data;
822 h5->vnd = data->vnd;
823 h5->id = (char *)match->id;
824
825 if (h5->vnd->acpi_gpio_map)
826 devm_acpi_dev_add_driver_gpios(dev,
827 h5->vnd->acpi_gpio_map);
828 } else {
829 data = of_device_get_match_data(dev);
830 if (!data)
831 return -ENODEV;
832
833 h5->vnd = data->vnd;
834 }
835
836
837 h5->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
838 if (IS_ERR(h5->enable_gpio))
839 return PTR_ERR(h5->enable_gpio);
840
841 h5->device_wake_gpio = devm_gpiod_get_optional(dev, "device-wake",
842 GPIOD_OUT_LOW);
843 if (IS_ERR(h5->device_wake_gpio))
844 return PTR_ERR(h5->device_wake_gpio);
845
846 err = hci_uart_register_device(&h5->serdev_hu, &h5p);
847 if (err)
848 return err;
849
850 hdev = h5->serdev_hu.hdev;
851
852 /* Set H5 specific quirks */
853 if (data->capabilities & H5_CAP_WAKEUP_ENABLE)
854 set_bit(H5_WAKEUP_ENABLE, &h5->flags);
855
856 return 0;
857 }
858
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:5.4/yocto 1/13] drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
by kernel test robot
Hi Boris,
First bad commit (maybe != root cause):
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: 756623e2f190038a96e780f5f07990a065ebf2b9
commit: 4541b62447f9a65c9192597304d5f6cd11664386 [1/13] mtd: spi-nor: Prepare core / manufacturer code split
config: powerpc-randconfig-s031-20210610 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.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.3-341-g8af24329-dirty
# https://github.com/intel/linux-intel-lts/commit/4541b62447f9a65c919259730...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 4541b62447f9a65c9192597304d5f6cd11664386
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3651:38: sparse: sparse: dubious: x | !y
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
vim +3383 drivers/mtd/spi-nor/core.c
2aaa5f7e0c07a0 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3324
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3325 /**
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3326 * spi_nor_parse_bfpt() - read and parse the Basic Flash Parameter Table.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3327 * @nor: pointer to a 'struct spi_nor'
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3328 * @bfpt_header: pointer to the 'struct sfdp_parameter_header' describing
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3329 * the Basic Flash Parameter Table length and version
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3330 * @params: pointer to the 'struct spi_nor_flash_parameter' to be
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3331 * filled
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3332 *
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3333 * The Basic Flash Parameter Table is the main and only mandatory table as
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3334 * defined by the SFDP (JESD216) specification.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3335 * It provides us with the total size (memory density) of the data array and
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3336 * the number of address bytes for Fast Read, Page Program and Sector Erase
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3337 * commands.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3338 * For Fast READ commands, it also gives the number of mode clock cycles and
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3339 * wait states (regrouped in the number of dummy clock cycles) for each
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3340 * supported instruction op code.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3341 * For Page Program, the page size is now available since JESD216 rev A, however
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3342 * the supported instruction op codes are still not provided.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3343 * For Sector Erase commands, this table stores the supported instruction op
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3344 * codes and the associated sector sizes.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3345 * Finally, the Quad Enable Requirements (QER) are also available since JESD216
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3346 * rev A. The QER bits encode the manufacturer dependent procedure to be
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3347 * executed to set the Quad Enable (QE) bit in some internal register of the
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3348 * Quad SPI memory. Indeed the QE bit, when it exists, must be set before
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3349 * sending any Quad SPI command to the memory. Actually, setting the QE bit
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3350 * tells the memory to reassign its WP# and HOLD#/RESET# pins to functions IO2
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3351 * and IO3 hence enabling 4 (Quad) I/O lines.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3352 *
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3353 * Return: 0 on success, -errno otherwise.
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3354 */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3355 static int spi_nor_parse_bfpt(struct spi_nor *nor,
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3356 const struct sfdp_parameter_header *bfpt_header,
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3357 struct spi_nor_flash_parameter *params)
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3358 {
c46872170a54c9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2019-08-23 3359 struct spi_nor_erase_map *map = ¶ms->erase_map;
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3360 struct spi_nor_erase_type *erase_type = map->erase_type;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3361 struct sfdp_bfpt bfpt;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3362 size_t len;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3363 int i, cmd, err;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3364 u32 addr;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3365 u16 half;
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3366 u8 erase_mask;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3367
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3368 /* JESD216 Basic Flash Parameter Table length is at least 9 DWORDs. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3369 if (bfpt_header->length < BFPT_DWORD_MAX_JESD216)
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3370 return -EINVAL;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3371
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3372 /* Read the Basic Flash Parameter Table. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3373 len = min_t(size_t, sizeof(bfpt),
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3374 bfpt_header->length * sizeof(u32));
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3375 addr = SFDP_PARAM_HEADER_PTP(bfpt_header);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3376 memset(&bfpt, 0, sizeof(bfpt));
bfa4133795e5a0 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-09-06 3377 err = spi_nor_read_sfdp_dma_unsafe(nor, addr, len, &bfpt);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3378 if (err < 0)
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3379 return err;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3380
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3381 /* Fix endianness of the BFPT DWORDs. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3382 for (i = 0; i < BFPT_DWORD_MAX; i++)
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 @3383 bfpt.dwords[i] = le32_to_cpu(bfpt.dwords[i]);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3384
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3385 /* Number of address bytes. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3386 switch (bfpt.dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3387 case BFPT_DWORD1_ADDRESS_BYTES_3_ONLY:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3388 nor->addr_width = 3;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3389 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3390
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3391 case BFPT_DWORD1_ADDRESS_BYTES_4_ONLY:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3392 nor->addr_width = 4;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3393 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3394
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3395 default:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3396 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3397 }
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3398
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3399 /* Flash Memory Density (in bits). */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3400 params->size = bfpt.dwords[BFPT_DWORD(2)];
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3401 if (params->size & BIT(31)) {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3402 params->size &= ~BIT(31);
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3403
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3404 /*
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3405 * Prevent overflows on params->size. Anyway, a NOR of 2^64
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3406 * bits is unlikely to exist so this error probably means
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3407 * the BFPT we are reading is corrupted/wrong.
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3408 */
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3409 if (params->size > 63)
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3410 return -EINVAL;
b8f3911610529b drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3411
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3412 params->size = 1ULL << params->size;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3413 } else {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3414 params->size++;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3415 }
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3416 params->size >>= 3; /* Convert to bytes. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3417
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3418 /* Fast Read settings. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3419 for (i = 0; i < ARRAY_SIZE(sfdp_bfpt_reads); i++) {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3420 const struct sfdp_bfpt_read *rd = &sfdp_bfpt_reads[i];
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3421 struct spi_nor_read_command *read;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3422
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3423 if (!(bfpt.dwords[rd->supported_dword] & rd->supported_bit)) {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3424 params->hwcaps.mask &= ~rd->hwcaps;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3425 continue;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3426 }
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3427
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3428 params->hwcaps.mask |= rd->hwcaps;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3429 cmd = spi_nor_hwcaps_read2cmd(rd->hwcaps);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3430 read = ¶ms->reads[cmd];
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3431 half = bfpt.dwords[rd->settings_dword] >> rd->settings_shift;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3432 spi_nor_set_read_settings_from_bfpt(read, half, rd->proto);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3433 }
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3434
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3435 /*
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3436 * Sector Erase settings. Reinitialize the uniform erase map using the
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3437 * Erase Types defined in the bfpt table.
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3438 */
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3439 erase_mask = 0;
c46872170a54c9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2019-08-23 3440 memset(¶ms->erase_map, 0, sizeof(params->erase_map));
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3441 for (i = 0; i < ARRAY_SIZE(sfdp_bfpt_erases); i++) {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3442 const struct sfdp_bfpt_erase *er = &sfdp_bfpt_erases[i];
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3443 u32 erasesize;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3444 u8 opcode;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3445
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3446 half = bfpt.dwords[er->dword] >> er->shift;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3447 erasesize = half & 0xff;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3448
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3449 /* erasesize == 0 means this Erase Type is not supported. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3450 if (!erasesize)
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3451 continue;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3452
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3453 erasesize = 1U << erasesize;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3454 opcode = (half >> 8) & 0xff;
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3455 erase_mask |= BIT(i);
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3456 spi_nor_set_erase_settings_from_bfpt(&erase_type[i], erasesize,
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3457 opcode, i);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3458 }
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3459 spi_nor_init_uniform_erase_map(map, erase_mask, params->size);
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3460 /*
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3461 * Sort all the map's Erase Types in ascending order with the smallest
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3462 * erase size being the first member in the erase_type array.
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3463 */
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3464 sort(erase_type, SNOR_ERASE_TYPE_MAX, sizeof(erase_type[0]),
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3465 spi_nor_map_cmp_erase_type, NULL);
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3466 /*
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3467 * Sort the erase types in the uniform region in order to update the
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3468 * uniform_erase_type bitmask. The bitmask will be used later on when
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3469 * selecting the uniform erase.
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3470 */
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3471 spi_nor_regions_sort_erase_types(map);
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3472 map->uniform_erase_type = map->uniform_region.offset &
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3473 SNOR_ERASE_TYPE_MASK;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3474
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3475 /* Stop here if not JESD216 rev A or later. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3476 if (bfpt_header->length < BFPT_DWORD_MAX)
2aaa5f7e0c07a0 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3477 return spi_nor_post_bfpt_fixups(nor, bfpt_header, &bfpt,
2aaa5f7e0c07a0 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3478 params);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3479
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3480 /* Page size: this field specifies 'N' so the page size = 2^N bytes. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3481 params->page_size = bfpt.dwords[BFPT_DWORD(11)];
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3482 params->page_size &= BFPT_DWORD11_PAGE_SIZE_MASK;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3483 params->page_size >>= BFPT_DWORD11_PAGE_SIZE_SHIFT;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3484 params->page_size = 1U << params->page_size;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3485
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3486 /* Quad Enable Requirements. */
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3487 switch (bfpt.dwords[BFPT_DWORD(15)] & BFPT_DWORD15_QER_MASK) {
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3488 case BFPT_DWORD15_QER_NONE:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3489 params->quad_enable = NULL;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3490 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3491
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3492 case BFPT_DWORD15_QER_SR2_BIT1_BUGGY:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3493 case BFPT_DWORD15_QER_SR2_BIT1_NO_RD:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3494 params->quad_enable = spansion_no_read_cr_quad_enable;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3495 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3496
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3497 case BFPT_DWORD15_QER_SR1_BIT6:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3498 params->quad_enable = macronix_quad_enable;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3499 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3500
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3501 case BFPT_DWORD15_QER_SR2_BIT7:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3502 params->quad_enable = sr2_bit7_quad_enable;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3503 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3504
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3505 case BFPT_DWORD15_QER_SR2_BIT1:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3506 params->quad_enable = spansion_read_cr_quad_enable;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3507 break;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3508
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3509 default:
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3510 return -EINVAL;
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3511 }
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3512
2aaa5f7e0c07a0 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3513 return spi_nor_post_bfpt_fixups(nor, bfpt_header, &bfpt, params);
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3514 }
f384b352cbf031 drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3515
:::::: The code at line 3383 was first introduced by commit
:::::: f384b352cbf0310fd20c379c4710408c70e769b6 mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables
:::::: TO: Cyrille Pitchen <cyrille.pitchen(a)microchip.com>
:::::: CC: Cyrille Pitchen <cyrille.pitchen(a)wedev4u.fr>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months