Re: [PATCH v3] can: m_can: don't enable transceiver when probing
From: kernel test robot
Date: Thu May 30 2024 - 12:20:31 EST
Hi Martin,
kernel test robot noticed the following build warnings:
[auto build test WARNING on mkl-can-next/testing]
[also build test WARNING on linus/master v6.10-rc1 next-20240529]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Martin-Hundeb-ll/can-m_can-don-t-enable-transceiver-when-probing/20240530-185906
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git testing
patch link: https://lore.kernel.org/r/20240530105801.3930087-1-martin%40geanix.com
patch subject: [PATCH v3] can: m_can: don't enable transceiver when probing
config: i386-buildonly-randconfig-003-20240530 (https://download.01.org/0day-ci/archive/20240530/202405302307.MKjlGruk-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/202405302307.MKjlGruk-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405302307.MKjlGruk-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
>> drivers/net/can/m_can/m_can.c:1725:11: warning: variable 'err' is uninitialized when used here [-Wuninitialized]
1725 | return err;
| ^~~
drivers/net/can/m_can/m_can.c:1674:24: note: initialize the variable 'err' to silence this warning
1674 | int m_can_version, err, niso;
| ^
| = 0
1 warning generated.
vim +/err +1725 drivers/net/can/m_can/m_can.c
1670
1671 static int m_can_dev_setup(struct m_can_classdev *cdev)
1672 {
1673 struct net_device *dev = cdev->net;
1674 int m_can_version, err, niso;
1675
1676 m_can_version = m_can_check_core_release(cdev);
1677 /* return if unsupported version */
1678 if (!m_can_version) {
1679 dev_err(cdev->dev, "Unsupported version number: %2d",
1680 m_can_version);
1681 return -EINVAL;
1682 }
1683
1684 if (!cdev->is_peripheral)
1685 netif_napi_add(dev, &cdev->napi, m_can_poll);
1686
1687 /* Shared properties of all M_CAN versions */
1688 cdev->version = m_can_version;
1689 cdev->can.do_set_mode = m_can_set_mode;
1690 cdev->can.do_get_berr_counter = m_can_get_berr_counter;
1691
1692 /* Set M_CAN supported operations */
1693 cdev->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
1694 CAN_CTRLMODE_LISTENONLY |
1695 CAN_CTRLMODE_BERR_REPORTING |
1696 CAN_CTRLMODE_FD |
1697 CAN_CTRLMODE_ONE_SHOT;
1698
1699 /* Set properties depending on M_CAN version */
1700 switch (cdev->version) {
1701 case 30:
1702 /* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.0.x */
1703 err = can_set_static_ctrlmode(dev, CAN_CTRLMODE_FD_NON_ISO);
1704 if (err)
1705 return err;
1706 cdev->can.bittiming_const = &m_can_bittiming_const_30X;
1707 cdev->can.data_bittiming_const = &m_can_data_bittiming_const_30X;
1708 break;
1709 case 31:
1710 /* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.1.x */
1711 err = can_set_static_ctrlmode(dev, CAN_CTRLMODE_FD_NON_ISO);
1712 if (err)
1713 return err;
1714 cdev->can.bittiming_const = &m_can_bittiming_const_31X;
1715 cdev->can.data_bittiming_const = &m_can_data_bittiming_const_31X;
1716 break;
1717 case 32:
1718 case 33:
1719 /* Support both MCAN version v3.2.x and v3.3.0 */
1720 cdev->can.bittiming_const = &m_can_bittiming_const_31X;
1721 cdev->can.data_bittiming_const = &m_can_data_bittiming_const_31X;
1722
1723 niso = m_can_niso_supported(cdev);
1724 if (niso < 0)
> 1725 return err;
1726 if (niso)
1727 cdev->can.ctrlmode_supported |= CAN_CTRLMODE_FD_NON_ISO;
1728 break;
1729 default:
1730 dev_err(cdev->dev, "Unsupported version number: %2d",
1731 cdev->version);
1732 return -EINVAL;
1733 }
1734
1735 /* Forcing standby mode should be redunant, as the chip should be in
1736 * standby after a reset. Write the INIT bit anyways, should the chip
1737 * be configured by previous stage.
1738 */
1739 return m_can_cccr_update_bits(cdev, CCCR_INIT, CCCR_INIT);
1740 }
1741
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki