[pavel-linux-leds:for-next 32/32] drivers/leds/leds-pca955x.c:500:15: warning: cast to smaller integer type 'enum pca955x_type' from 'const void *'
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
head: 239f32b4f161c1584cd4b386d6ab8766432a6ede
commit: 239f32b4f161c1584cd4b386d6ab8766432a6ede [32/32] leds: pca955x: Switch to i2c probe_new
config: x86_64-randconfig-a014-20210820 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa)
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/pavel/linux-leds.git/comm...
git remote add pavel-linux-leds git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git
git fetch --no-tags pavel-linux-leds for-next
git checkout 239f32b4f161c1584cd4b386d6ab8766432a6ede
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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/leds/leds-pca955x.c:500:15: warning: cast to smaller integer type 'enum pca955x_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
chip_type = (enum pca955x_type)md;
^~~~~~~~~~~~~~~~~~~~~
drivers/leds/leds-pca955x.c:147:19: warning: unused function 'pca95xx_num_led_regs' [-Wunused-function]
static inline int pca95xx_num_led_regs(int bits)
^
2 warnings generated.
vim +500 drivers/leds/leds-pca955x.c
481
482 static int pca955x_probe(struct i2c_client *client)
483 {
484 struct pca955x *pca955x;
485 struct pca955x_led *pca955x_led;
486 struct pca955x_chipdef *chip;
487 struct led_classdev *led;
488 struct led_init_data init_data;
489 struct i2c_adapter *adapter;
490 int i, err;
491 struct pca955x_platform_data *pdata;
492 int ngpios = 0;
493 bool set_default_label = false;
494 bool keep_pwm = false;
495 char default_label[8];
496 enum pca955x_type chip_type;
497 const void *md = device_get_match_data(&client->dev);
498
499 if (md) {
> 500 chip_type = (enum pca955x_type)md;
501 } else {
502 const struct i2c_device_id *id = i2c_match_id(pca955x_id,
503 client);
504
505 if (id) {
506 chip_type = (enum pca955x_type)id->driver_data;
507 } else {
508 dev_err(&client->dev, "unknown chip\n");
509 return -ENODEV;
510 }
511 }
512
513 chip = &pca955x_chipdefs[chip_type];
514 adapter = client->adapter;
515 pdata = dev_get_platdata(&client->dev);
516 if (!pdata) {
517 pdata = pca955x_get_pdata(client, chip);
518 if (IS_ERR(pdata))
519 return PTR_ERR(pdata);
520 }
521
522 /* Make sure the slave address / chip type combo given is possible */
523 if ((client->addr & ~((1 << chip->slv_addr_shift) - 1)) !=
524 chip->slv_addr) {
525 dev_err(&client->dev, "invalid slave address %02x\n",
526 client->addr);
527 return -ENODEV;
528 }
529
530 dev_info(&client->dev, "leds-pca955x: Using %s %d-bit LED driver at "
531 "slave address 0x%02x\n", client->name, chip->bits,
532 client->addr);
533
534 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
535 return -EIO;
536
537 if (pdata->num_leds != chip->bits) {
538 dev_err(&client->dev,
539 "board info claims %d LEDs on a %d-bit chip\n",
540 pdata->num_leds, chip->bits);
541 return -ENODEV;
542 }
543
544 pca955x = devm_kzalloc(&client->dev, sizeof(*pca955x), GFP_KERNEL);
545 if (!pca955x)
546 return -ENOMEM;
547
548 pca955x->leds = devm_kcalloc(&client->dev, chip->bits,
549 sizeof(*pca955x_led), GFP_KERNEL);
550 if (!pca955x->leds)
551 return -ENOMEM;
552
553 i2c_set_clientdata(client, pca955x);
554
555 mutex_init(&pca955x->lock);
556 pca955x->client = client;
557 pca955x->chipdef = chip;
558
559 init_data.devname_mandatory = false;
560 init_data.devicename = "pca955x";
561
562 for (i = 0; i < chip->bits; i++) {
563 pca955x_led = &pca955x->leds[i];
564 pca955x_led->led_num = i;
565 pca955x_led->pca955x = pca955x;
566 pca955x_led->type = pdata->leds[i].type;
567
568 switch (pca955x_led->type) {
569 case PCA955X_TYPE_NONE:
570 break;
571 case PCA955X_TYPE_GPIO:
572 ngpios++;
573 break;
574 case PCA955X_TYPE_LED:
575 led = &pca955x_led->led_cdev;
576 led->brightness_set_blocking = pca955x_led_set;
577 led->brightness_get = pca955x_led_get;
578
579 if (pdata->leds[i].default_state ==
580 LEDS_GPIO_DEFSTATE_OFF) {
581 err = pca955x_led_set(led, LED_OFF);
582 if (err)
583 return err;
584 } else if (pdata->leds[i].default_state ==
585 LEDS_GPIO_DEFSTATE_ON) {
586 err = pca955x_led_set(led, LED_FULL);
587 if (err)
588 return err;
589 }
590
591 init_data.fwnode = pdata->leds[i].fwnode;
592
593 if (is_of_node(init_data.fwnode)) {
594 if (to_of_node(init_data.fwnode)->name[0] ==
595 '\0')
596 set_default_label = true;
597 else
598 set_default_label = false;
599 } else {
600 set_default_label = true;
601 }
602
603 if (set_default_label) {
604 snprintf(default_label, sizeof(default_label),
605 "%d", i);
606 init_data.default_label = default_label;
607 } else {
608 init_data.default_label = NULL;
609 }
610
611 err = devm_led_classdev_register_ext(&client->dev, led,
612 &init_data);
613 if (err)
614 return err;
615
616 /*
617 * For default-state == "keep", let the core update the
618 * brightness from the hardware, then check the
619 * brightness to see if it's using PWM1. If so, PWM1
620 * should not be written below.
621 */
622 if (pdata->leds[i].default_state ==
623 LEDS_GPIO_DEFSTATE_KEEP) {
624 if (led->brightness != LED_FULL &&
625 led->brightness != LED_OFF &&
626 led->brightness != LED_HALF)
627 keep_pwm = true;
628 }
629 }
630 }
631
632 /* PWM0 is used for half brightness or 50% duty cycle */
633 err = pca955x_write_pwm(client, 0, 255 - LED_HALF);
634 if (err)
635 return err;
636
637 if (!keep_pwm) {
638 /* PWM1 is used for variable brightness, default to OFF */
639 err = pca955x_write_pwm(client, 1, 0);
640 if (err)
641 return err;
642 }
643
644 /* Set to fast frequency so we do not see flashing */
645 err = pca955x_write_psc(client, 0, 0);
646 if (err)
647 return err;
648 err = pca955x_write_psc(client, 1, 0);
649 if (err)
650 return err;
651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[rcu:dev.2021.08.16a 70/91] kernel/cpu.c:158:6: error: conflicting types for 'cpu_hp_check_delay'; have 'bool(const char *, const void *)' {aka '_Bool(const char *, const void *)'}
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2021.08.16a
head: e376d3475154c40e5210eebbf33ac94696972190
commit: c7f73594812ddbe1d8cadb8c595dc7adcfa97e54 [70/91] EXP cpu: Make cpu_hp_check_delay() return true when detecting an anomaly
config: sparc64-buildonly-randconfig-r002-20210820 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 11.2.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/paulmck/linux-rcu.git/com...
git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git fetch --no-tags rcu dev.2021.08.16a
git checkout c7f73594812ddbe1d8cadb8c595dc7adcfa97e54
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc64
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 >>):
kernel/cpu.c:137:6: error: redefinition of 'cpu_hp_start_now'
137 | void cpu_hp_start_now(void)
| ^~~~~~~~~~~~~~~~
In file included from kernel/cpu.c:17:
include/linux/cpu.h:147:20: note: previous definition of 'cpu_hp_start_now' with type 'void(void)'
147 | static inline void cpu_hp_start_now(void) { }
| ^~~~~~~~~~~~~~~~
kernel/cpu.c:146:6: error: redefinition of 'cpu_hp_stop_now'
146 | void cpu_hp_stop_now(void)
| ^~~~~~~~~~~~~~~
In file included from kernel/cpu.c:17:
include/linux/cpu.h:148:20: note: previous definition of 'cpu_hp_stop_now' with type 'void(void)'
148 | static inline void cpu_hp_stop_now(void) { }
| ^~~~~~~~~~~~~~~
>> kernel/cpu.c:158:6: error: conflicting types for 'cpu_hp_check_delay'; have 'bool(const char *, const void *)' {aka '_Bool(const char *, const void *)'}
158 | bool cpu_hp_check_delay(const char *s, const void *func)
| ^~~~~~~~~~~~~~~~~~
In file included from kernel/cpu.c:17:
include/linux/cpu.h:149:20: note: previous definition of 'cpu_hp_check_delay' with type 'bool(const char *, void *)' {aka '_Bool(const char *, void *)'}
149 | static inline bool cpu_hp_check_delay(const char *s, void *func) { return false; }
| ^~~~~~~~~~~~~~~~~~
vim +158 kernel/cpu.c
156
157 /* Return true if a time-delay anomaly was detected. */
> 158 bool cpu_hp_check_delay(const char *s, const void *func)
159 {
160 bool ret = false;
161 u64 t, t1;
162
163 if (!smp_load_acquire(&cpu_hp_start_time_valid))
164 return false;
165 t = READ_ONCE(cpu_hp_start_time);
166 smp_mb();
167 if (!READ_ONCE(cpu_hp_start_time_valid))
168 return false;
169 t1 = ktime_get();
170 if (WARN_ONCE(time_after64(t1, t + 100 * NSEC_PER_SEC), "%s %ps took %llu milliseconds\n", s, func, (t1 - t) / NSEC_PER_MSEC)) {
171 WRITE_ONCE(cpu_hp_start_time, t1);
172 ret = true;
173 }
174 if (WARN_ONCE(time_before64(t1, t - 25 * NSEC_PER_MSEC), "%s %ps clock went backwards %llu milliseconds\n", s, func, (t - t1) / NSEC_PER_MSEC)){
175 WRITE_ONCE(cpu_hp_start_time, t1);
176 ret = true;
177 }
178 return ret;
179 }
180
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[mcgrof-next:20210819-add-disk-error-handling-next 55/90] drivers/block/paride/pd.c:943:34: error: expected ';' before ':' token
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210819-add-disk-error-handling-next
head: 4a644c3aee4465306a79d393956c84ce8925fa6b
commit: dead4ade0ca0ea1852b1c7a0b1b2a5ad3a66f49f [55/90] pd: add error handling support for add_disk()
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 11.2.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/mcgrof/linux-next.git/com...
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20210819-add-disk-error-handling-next
git checkout dead4ade0ca0ea1852b1c7a0b1b2a5ad3a66f49f
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash
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/block/paride/pd.c: In function 'pd_probe_drive':
>> drivers/block/paride/pd.c:943:34: error: expected ';' before ':' token
943 | goto cleanup_disk:
| ^
| ;
>> drivers/block/paride/pd.c:946:26: error: passing argument 1 of 'blk_cleanup_disk' from incompatible pointer type [-Werror=incompatible-pointer-types]
946 | blk_cleanup_disk(disk);
| ^~~~
| |
| struct pd_unit *
In file included from include/linux/blkdev.h:8,
from include/linux/blk-mq.h:5,
from drivers/block/paride/pd.c:154:
include/linux/genhd.h:281:39: note: expected 'struct gendisk *' but argument is of type 'struct pd_unit *'
281 | void blk_cleanup_disk(struct gendisk *disk);
| ~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
vim +943 drivers/block/paride/pd.c
877
878 static int pd_probe_drive(struct pd_unit *disk, int autoprobe, int port,
879 int mode, int unit, int protocol, int delay)
880 {
881 int index = disk - pd;
882 int *parm = *drives[index];
883 struct gendisk *p;
884 int ret;
885
886 disk->pi = &disk->pia;
887 disk->access = 0;
888 disk->changed = 1;
889 disk->capacity = 0;
890 disk->drive = parm[D_SLV];
891 snprintf(disk->name, PD_NAMELEN, "%s%c", name, 'a' + index);
892 disk->alt_geom = parm[D_GEO];
893 disk->standby = parm[D_SBY];
894 INIT_LIST_HEAD(&disk->rq_list);
895
896 if (!pi_init(disk->pi, autoprobe, port, mode, unit, protocol, delay,
897 pd_scratch, PI_PD, verbose, disk->name))
898 return -ENXIO;
899
900 memset(&disk->tag_set, 0, sizeof(disk->tag_set));
901 disk->tag_set.ops = &pd_mq_ops;
902 disk->tag_set.cmd_size = sizeof(struct pd_req);
903 disk->tag_set.nr_hw_queues = 1;
904 disk->tag_set.nr_maps = 1;
905 disk->tag_set.queue_depth = 2;
906 disk->tag_set.numa_node = NUMA_NO_NODE;
907 disk->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;
908 ret = blk_mq_alloc_tag_set(&disk->tag_set);
909 if (ret)
910 goto pi_release;
911
912 p = blk_mq_alloc_disk(&disk->tag_set, disk);
913 if (IS_ERR(p)) {
914 ret = PTR_ERR(p);
915 goto free_tag_set;
916 }
917 disk->gd = p;
918
919 strcpy(p->disk_name, disk->name);
920 p->fops = &pd_fops;
921 p->major = major;
922 p->first_minor = (disk - pd) << PD_BITS;
923 p->minors = 1 << PD_BITS;
924 p->events = DISK_EVENT_MEDIA_CHANGE;
925 p->private_data = disk;
926 blk_queue_max_hw_sectors(p->queue, cluster);
927 blk_queue_bounce_limit(p->queue, BLK_BOUNCE_HIGH);
928
929 if (disk->drive == -1) {
930 for (disk->drive = 0; disk->drive <= 1; disk->drive++) {
931 ret = pd_special_command(disk, pd_identify);
932 if (ret == 0)
933 break;
934 }
935 } else {
936 ret = pd_special_command(disk, pd_identify);
937 }
938 if (ret)
939 goto put_disk;
940 set_capacity(disk->gd, disk->capacity);
941 ret = add_disk(disk->gd);
942 if (ret)
> 943 goto cleanup_disk:
944 return 0;
945 cleanup_disk:
> 946 blk_cleanup_disk(disk);
947 put_disk:
948 put_disk(p);
949 disk->gd = NULL;
950 free_tag_set:
951 blk_mq_free_tag_set(&disk->tag_set);
952 pi_release:
953 pi_release(disk->pi);
954 return ret;
955 }
956
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[jimc:dd-drm-next 2/11] lib/dynamic_debug.c:609:54: error: incomplete definition of type 'struct module'
by kernel test robot
tree: https://github.com/jimc/linux.git dd-drm-next
head: 334f24cc73a3d5051217851d4616cb89c2d152dc
commit: 0322252e3c15fa80be1780ca68dde765a57f2c4b [2/11] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks
config: riscv-randconfig-r042-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/jimc/linux/commit/0322252e3c15fa80be1780ca68dde765a57f...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dd-drm-next
git checkout 0322252e3c15fa80be1780ca68dde765a57f2c4b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=riscv SHELL=/bin/bash
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 lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> lib/dynamic_debug.c:609:54: error: incomplete definition of type 'struct module'
matches = dynamic_debug_exec_queries(query, kp->mod->name);
~~~~~~~^
include/linux/jump_label.h:201:8: note: forward declaration of 'struct module'
struct module;
^
7 warnings and 1 error generated.
vim +609 lib/dynamic_debug.c
579
580 #define FMT_QUERY_SIZE 128 /* typically need <40 */
581 /**
582 * param_set_dyndbg() - drm.debug style bits=>categories setter
583 * @instr: string echo>d to sysfs
584 * @kp: struct kernel_param* ->data has bitmap
585 * Exported to support DEFINE_DYNAMIC_DEBUG_CATEGORIES
586 */
587 int param_set_dyndbg(const char *instr, const struct kernel_param *kp)
588 {
589 unsigned long inbits;
590 int rc, i, matches = 0, totct = 0;
591 char query[FMT_QUERY_SIZE];
592 const struct dyndbg_bitdesc *bitmap = kp->data;
593
594 if (!bitmap) {
595 pr_err("set_dyndbg: no bits=>queries map\n");
596 return -EINVAL;
597 }
598 rc = kstrtoul(instr, 0, &inbits);
599 if (rc) {
600 pr_err("set_dyndbg: failed\n");
601 return rc;
602 }
603 vpr_info("set_dyndbg: input 0x%lx\n", inbits);
604
605 for (i = 0; bitmap->prefix; i++, bitmap++) {
606 snprintf(query, FMT_QUERY_SIZE, "format '^%s' %cp", bitmap->prefix,
607 test_bit(i, &inbits) ? '+' : '-');
608
> 609 matches = dynamic_debug_exec_queries(query, kp->mod->name);
610
611 v2pr_info("bit-%d: %d matches on '%s'\n", i, matches, query);
612 totct += matches;
613 }
614 vpr_info("total matches: %d\n", totct);
615 return 0;
616 }
617 EXPORT_SYMBOL(param_set_dyndbg);
618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[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
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: i386-randconfig-s002-20210820 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-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
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/mtd/spi-nor/
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: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:3931:29: 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, 1 month
[linux-next:master 5279/9522] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:61:17: error: implicit declaration of function 'enable_kernel_altivec'; did you mean 'enable_kernel_vsx'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 86ed57fd8c93fdfaabb4f58e78455180fa7d8a84
commit: 96ee63730fa30614e943ac352ef772be49a712d9 [5279/9522] drm/amd/display: Add control mechanism for FPU
config: powerpc64-randconfig-r004-20210820 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 11.2.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/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 96ee63730fa30614e943ac352ef772be49a712d9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=powerpc
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/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c: In function 'dc_fpu_begin':
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:61:17: error: implicit declaration of function 'enable_kernel_altivec'; did you mean 'enable_kernel_vsx'? [-Werror=implicit-function-declaration]
61 | enable_kernel_altivec();
| ^~~~~~~~~~~~~~~~~~~~~
| enable_kernel_vsx
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c: In function 'dc_fpu_end':
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:89:17: error: implicit declaration of function 'disable_kernel_altivec'; did you mean 'disable_kernel_vsx'? [-Werror=implicit-function-declaration]
89 | disable_kernel_altivec();
| ^~~~~~~~~~~~~~~~~~~~~~
| disable_kernel_vsx
cc1: some warnings being treated as errors
vim +61 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c
35
36 /**
37 * dc_fpu_begin - Enables FPU protection
38 * @function_name: A string containing the function name for debug purposes
39 * (usually __func__)
40 *
41 * @line: A line number where DC_FP_START was invoked for debug purpose
42 * (usually __LINE__)
43 *
44 * This function is responsible for managing the use of kernel_fpu_begin() with
45 * the advantage of providing an event trace for debugging.
46 *
47 * Note: Do not call this function directly; always use DC_FP_START().
48 */
49 void dc_fpu_begin(const char *function_name, const int line)
50 {
51 TRACE_DCN_FPU(true, function_name, line);
52
53 #if defined(CONFIG_X86)
54 kernel_fpu_begin();
55 #elif defined(CONFIG_PPC64)
56 if (cpu_has_feature(CPU_FTR_VSX_COMP)) {
57 preempt_disable();
58 enable_kernel_vsx();
59 } else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) {
60 preempt_disable();
> 61 enable_kernel_altivec();
62 } else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) {
63 preempt_disable();
64 enable_kernel_fp();
65 }
66 #endif
67 }
68
69 /**
70 * dc_fpu_end - Disable FPU protection
71 * @function_name: A string containing the function name for debug purposes
72 * @line: A-line number where DC_FP_END was invoked for debug purpose
73 *
74 * This function is responsible for managing the use of kernel_fpu_end() with
75 * the advantage of providing an event trace for debugging.
76 *
77 * Note: Do not call this function directly; always use DC_FP_END().
78 */
79 void dc_fpu_end(const char *function_name, const int line)
80 {
81 TRACE_DCN_FPU(false, function_name, line);
82 #if defined(CONFIG_X86)
83 kernel_fpu_end();
84 #elif defined(CONFIG_PPC64)
85 if (cpu_has_feature(CPU_FTR_VSX_COMP)) {
86 disable_kernel_vsx();
87 preempt_enable();
88 } else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) {
> 89 disable_kernel_altivec();
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v2 2/2] net: Add driver for LiteX's LiteEth network interface
by kernel test robot
Hi Joel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on net-next/master net/master linus/master v5.14-rc6 next-20210819]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Joel-Stanley/net-Add-LiteETH-net...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 11.2.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/0day-ci/linux/commit/3355b2a96c6d9881128ebac1d3801171b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Joel-Stanley/net-Add-LiteETH-network-driver/20210820-154958
git checkout 3355b2a96c6d9881128ebac1d3801171b988dbeb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sh
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/net/ethernet/litex/litex_liteeth.c:204:5: warning: no previous prototype for 'liteeth_setup_slots' [-Wmissing-prototypes]
204 | int liteeth_setup_slots(struct liteeth *priv)
| ^~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +/liteeth_setup_slots +204 drivers/net/ethernet/litex/litex_liteeth.c
203
> 204 int liteeth_setup_slots(struct liteeth *priv)
205 {
206 struct device_node *np = priv->dev->of_node;
207 int err, depth;
208
209 err = of_property_read_u32(np, "rx-fifo-depth", &depth);
210 if (err) {
211 dev_err(priv->dev, "unable to get rx-fifo-depth\n");
212 return err;
213 }
214 if (depth < LITEETH_BUFFER_SIZE) {
215 dev_err(priv->dev, "invalid tx-fifo-depth: %d\n", depth);
216 return -EINVAL;
217 }
218 priv->num_rx_slots = depth / LITEETH_BUFFER_SIZE;
219
220 err = of_property_read_u32(np, "tx-fifo-depth", &depth);
221 if (err) {
222 dev_err(priv->dev, "unable to get tx-fifo-depth\n");
223 return err;
224 }
225 if (depth < LITEETH_BUFFER_SIZE) {
226 dev_err(priv->dev, "invalid rx-fifo-depth: %d\n", depth);
227 return -EINVAL;
228 }
229 priv->num_tx_slots = depth / LITEETH_BUFFER_SIZE;
230
231 return 0;
232 }
233
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[avpatel:riscv_kvm_aia_v1 35/44] drivers/irqchip/irq-riscv-imsic.c:268:26: error: 'struct imsic_priv' has no member named 'base_ipi'
by kernel test robot
tree: https://github.com/avpatel/linux.git riscv_kvm_aia_v1
head: 4da0ebf34286097da9de71c57fea2f09ec479877
commit: d0363c5e3512c058637a3c4b062f7a06c2498076 [35/44] irqchip: Add RISC-V incoming MSI controller driver
config: riscv-randconfig-r042-20210819 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 11.2.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/avpatel/linux/commit/d0363c5e3512c058637a3c4b062f7a06c...
git remote add avpatel https://github.com/avpatel/linux.git
git fetch --no-tags avpatel riscv_kvm_aia_v1
git checkout d0363c5e3512c058637a3c4b062f7a06c2498076
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash drivers/irqchip/
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/irqchip/irq-riscv-imsic.c: In function 'imsic_ids_local_sync':
>> drivers/irqchip/irq-riscv-imsic.c:268:26: error: 'struct imsic_priv' has no member named 'base_ipi'
268 | if ((priv->base_ipi <= i) &&
| ^~
drivers/irqchip/irq-riscv-imsic.c:269:31: error: 'struct imsic_priv' has no member named 'base_ipi'
269 | (i < (priv->base_ipi + priv->nr_ipis)))
| ^~
>> drivers/irqchip/irq-riscv-imsic.c:269:50: error: 'struct imsic_priv' has no member named 'nr_ipis'; did you mean 'nr_ids'?
269 | (i < (priv->base_ipi + priv->nr_ipis)))
| ^~~~~~~
| nr_ids
drivers/irqchip/irq-riscv-imsic.c: In function 'imsic_init':
drivers/irqchip/irq-riscv-imsic.c:906:45: error: 'struct imsic_priv' has no member named 'base_ipi'
906 | &priv->base_ipi))
| ^~
drivers/irqchip/irq-riscv-imsic.c:907:21: error: 'struct imsic_priv' has no member named 'base_ipi'
907 | priv->base_ipi = 0;
| ^~
drivers/irqchip/irq-riscv-imsic.c:909:47: error: 'struct imsic_priv' has no member named 'nr_ipis'; did you mean 'nr_ids'?
909 | &priv->nr_ipis))
| ^~~~~~~
| nr_ids
drivers/irqchip/irq-riscv-imsic.c:910:23: error: 'struct imsic_priv' has no member named 'nr_ipis'; did you mean 'nr_ids'?
910 | priv->nr_ipis = 0;
| ^~~~~~~
| nr_ids
vim +268 drivers/irqchip/irq-riscv-imsic.c
261
262 static void imsic_ids_local_sync(struct imsic_priv *priv)
263 {
264 int i;
265
266 raw_spin_lock(&priv->ids_lock);
267 for (i = 1; i <= priv->nr_ids; i++) {
> 268 if ((priv->base_ipi <= i) &&
> 269 (i < (priv->base_ipi + priv->nr_ipis)))
270 continue;
271 if (test_bit(i, priv->ids_enabled_bimap))
272 csr_write(CSR_SETEIENUM, i);
273 else
274 csr_write(CSR_CLREIENUM, i);
275 }
276 raw_spin_unlock(&priv->ids_lock);
277 }
278
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month