[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207141718.NA620oNa-lkp@intel.com>
Date: Thu, 14 Jul 2022 17:30:07 +0800
From: kernel test robot <lkp@...el.com>
To: Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [sre-misc:rk3588 39/42] drivers/mfd/rk8xx-core.c:654:40: warning:
operator '?:' has lower precedence than '|'; '|' will be evaluated first
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git rk3588
head: 720bd5858aced5b400d963fd155c40adb98c47b4
commit: 18650ce6630a3f066680e3affab33a11b9f3d14d [39/42] mfd: rk8xx: add rk806 support
config: arm64-randconfig-r005-20220714 (https://download.01.org/0day-ci/archive/20220714/202207141718.NA620oNa-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e61b9c556267086ef9b743a0b57df302eef831b)
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://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/commit/?id=18650ce6630a3f066680e3affab33a11b9f3d14d
git remote add sre-misc https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git
git fetch --no-tags sre-misc rk3588
git checkout 18650ce6630a3f066680e3affab33a11b9f3d14d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/mfd/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/mfd/rk8xx-core.c:654:40: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
IRQF_ONESHOT | dual_support ? IRQF_SHARED : 0, -1,
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
drivers/mfd/rk8xx-core.c:654:40: note: place parentheses around the '|' expression to silence this warning
IRQF_ONESHOT | dual_support ? IRQF_SHARED : 0, -1,
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
drivers/mfd/rk8xx-core.c:654:40: note: place parentheses around the '?:' expression to evaluate it first
IRQF_ONESHOT | dual_support ? IRQF_SHARED : 0, -1,
^
( )
1 warning generated.
vim +654 drivers/mfd/rk8xx-core.c
585
586 int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap *regmap)
587 {
588 struct rk808 *rk808;
589 const struct rk808_reg_data *pre_init_reg;
590 const struct mfd_cell *cells;
591 bool dual_support = false;
592 int nr_pre_init_regs;
593 int nr_cells;
594 int ret;
595 int i;
596
597 rk808 = devm_kzalloc(dev, sizeof(*rk808), GFP_KERNEL);
598 if (!rk808)
599 return -ENOMEM;
600 rk808->dev = dev;
601 rk808->variant = variant;
602 rk808->regmap = regmap;
603 dev_set_drvdata(dev, rk808);
604
605 switch (rk808->variant) {
606 case RK805_ID:
607 rk808->regmap_irq_chip = &rk805_irq_chip;
608 pre_init_reg = rk805_pre_init_reg;
609 nr_pre_init_regs = ARRAY_SIZE(rk805_pre_init_reg);
610 cells = rk805s;
611 nr_cells = ARRAY_SIZE(rk805s);
612 break;
613 case RK806_ID:
614 rk808->regmap_irq_chip = &rk806_irq_chip;
615 pre_init_reg = rk806_pre_init_reg;
616 nr_pre_init_regs = ARRAY_SIZE(rk806_pre_init_reg);
617 cells = rk806s;
618 nr_cells = ARRAY_SIZE(rk806s);
619 dual_support = true;
620 break;
621 case RK808_ID:
622 rk808->regmap_irq_chip = &rk808_irq_chip;
623 pre_init_reg = rk808_pre_init_reg;
624 nr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg);
625 cells = rk808s;
626 nr_cells = ARRAY_SIZE(rk808s);
627 break;
628 case RK818_ID:
629 rk808->regmap_irq_chip = &rk818_irq_chip;
630 pre_init_reg = rk818_pre_init_reg;
631 nr_pre_init_regs = ARRAY_SIZE(rk818_pre_init_reg);
632 cells = rk818s;
633 nr_cells = ARRAY_SIZE(rk818s);
634 break;
635 case RK809_ID:
636 case RK817_ID:
637 rk808->regmap_irq_chip = &rk817_irq_chip;
638 pre_init_reg = rk817_pre_init_reg;
639 nr_pre_init_regs = ARRAY_SIZE(rk817_pre_init_reg);
640 cells = rk817s;
641 nr_cells = ARRAY_SIZE(rk817s);
642 break;
643 default:
644 dev_err(dev, "Unsupported RK8XX ID %lu\n", rk808->variant);
645 return -EINVAL;
646 }
647
648 dev_info(dev, "chip id: 0x%x\n", (unsigned int)rk808->variant);
649
650 if (!irq)
651 return dev_err_probe(dev, -EINVAL, "No interrupt support, no core IRQ\n");
652
653 ret = devm_regmap_add_irq_chip(dev, rk808->regmap, irq,
> 654 IRQF_ONESHOT | dual_support ? IRQF_SHARED : 0, -1,
655 rk808->regmap_irq_chip, &rk808->irq_data);
656 if (ret)
657 return dev_err_probe(dev, ret, "Failed to add irq_chip\n");
658
659 for (i = 0; i < nr_pre_init_regs; i++) {
660 ret = regmap_update_bits(rk808->regmap,
661 pre_init_reg[i].addr,
662 pre_init_reg[i].mask,
663 pre_init_reg[i].value);
664 if (ret)
665 return dev_err_probe(dev, ret, "0x%x write err\n",
666 pre_init_reg[i].addr);
667 }
668
669 ret = devm_mfd_add_devices(dev, dual_support ? PLATFORM_DEVID_AUTO : PLATFORM_DEVID_NONE,
670 cells, nr_cells, NULL, 0,
671 regmap_irq_get_domain(rk808->irq_data));
672 if (ret)
673 return dev_err_probe(dev, ret, "failed to add MFD devices\n");
674
675 if (device_property_read_bool(dev, "rockchip,system-power-controller")) {
676 ret = devm_register_sys_off_handler(dev,
677 SYS_OFF_MODE_POWER_OFF_PREPARE, SYS_OFF_PRIO_HIGH,
678 &rk808_power_off, rk808);
679 if (ret)
680 return dev_err_probe(dev, ret,
681 "failed to register poweroff handler\n");
682
683 switch (rk808->variant) {
684 case RK809_ID:
685 case RK817_ID:
686 ret = devm_register_sys_off_handler(dev,
687 SYS_OFF_MODE_RESTART, SYS_OFF_PRIO_HIGH,
688 &rk808_restart, rk808);
689 if (ret)
690 dev_warn(dev, "failed to register rst handler, %d\n", ret);
691 break;
692 default:
693 dev_dbg(dev, "pmic controlled board reset not supported\n");
694 break;
695 }
696 }
697
698 return 0;
699 }
700 EXPORT_SYMBOL_GPL(rk8xx_probe);
701
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists