* [linux-next:master 10081/11483] drivers/net/ethernet/asix/ax88796c_main.c:851:24: warning: address of array 'ax_local->phydev->advertising' will always evaluate to 'true'
@ 2021-10-27 9:41 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-10-27 9:41 UTC (permalink / raw)
To: Łukasz Stelmach
Cc: llvm, kbuild-all, Linux Memory Management List, Jakub Kicinski
[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 2376e5fe91bcad74b997d2cc0535abff79ec73c5
commit: a97c69ba4f30e46abb9cc7be8b98227cb468fdf9 [10081/11483] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver
config: mips-randconfig-r011-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a97c69ba4f30e46abb9cc7be8b98227cb468fdf9
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 a97c69ba4f30e46abb9cc7be8b98227cb468fdf9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/asix/ax88796c_main.c:851:24: warning: address of array 'ax_local->phydev->advertising' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (ax_local->phydev->advertising &&
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ~~
1 warning generated.
vim +851 drivers/net/ethernet/asix/ax88796c_main.c
789
790 static int
791 ax88796c_open(struct net_device *ndev)
792 {
793 struct ax88796c_device *ax_local = to_ax88796c_device(ndev);
794 unsigned long irq_flag = 0;
795 int fc = AX_FC_NONE;
796 int ret;
797 u16 t;
798
799 ret = request_irq(ndev->irq, ax88796c_interrupt,
800 irq_flag, ndev->name, ndev);
801 if (ret) {
802 netdev_err(ndev, "unable to get IRQ %d (errno=%d).\n",
803 ndev->irq, ret);
804 return ret;
805 }
806
807 mutex_lock(&ax_local->spi_lock);
808
809 ret = ax88796c_soft_reset(ax_local);
810 if (ret < 0) {
811 free_irq(ndev->irq, ndev);
812 mutex_unlock(&ax_local->spi_lock);
813 return ret;
814 }
815 ax_local->seq_num = 0x1f;
816
817 ax88796c_set_mac_addr(ndev);
818 ax88796c_set_csums(ax_local);
819
820 /* Disable stuffing packet */
821 t = AX_READ(&ax_local->ax_spi, P1_RXBSPCR);
822 t &= ~RXBSPCR_STUF_ENABLE;
823 AX_WRITE(&ax_local->ax_spi, t, P1_RXBSPCR);
824
825 /* Enable RX packet process */
826 AX_WRITE(&ax_local->ax_spi, RPPER_RXEN, P1_RPPER);
827
828 t = AX_READ(&ax_local->ax_spi, P0_FER);
829 t |= FER_RXEN | FER_TXEN | FER_BSWAP | FER_IRQ_PULL;
830 AX_WRITE(&ax_local->ax_spi, t, P0_FER);
831
832 /* Setup LED mode */
833 AX_WRITE(&ax_local->ax_spi,
834 (LCR_LED0_EN | LCR_LED0_DUPLEX | LCR_LED1_EN |
835 LCR_LED1_100MODE), P2_LCR0);
836 AX_WRITE(&ax_local->ax_spi,
837 (AX_READ(&ax_local->ax_spi, P2_LCR1) & LCR_LED2_MASK) |
838 LCR_LED2_EN | LCR_LED2_LINK, P2_LCR1);
839
840 /* Disable PHY auto-polling */
841 AX_WRITE(&ax_local->ax_spi, PCR_PHYID(AX88796C_PHY_ID), P2_PCR);
842
843 /* Enable MAC interrupts */
844 AX_WRITE(&ax_local->ax_spi, IMR_DEFAULT, P0_IMR);
845
846 mutex_unlock(&ax_local->spi_lock);
847
848 /* Setup flow-control configuration */
849 phy_support_asym_pause(ax_local->phydev);
850
> 851 if (ax_local->phydev->advertising &&
852 (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
853 ax_local->phydev->advertising) ||
854 linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
855 ax_local->phydev->advertising)))
856 fc |= AX_FC_ANEG;
857
858 fc |= linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
859 ax_local->phydev->advertising) ? AX_FC_RX : 0;
860 fc |= (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
861 ax_local->phydev->advertising) !=
862 linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
863 ax_local->phydev->advertising)) ? AX_FC_TX : 0;
864 ax_local->flowctrl = fc;
865
866 phy_start(ax_local->ndev->phydev);
867
868 netif_start_queue(ndev);
869
870 spi_message_init(&ax_local->ax_spi.rx_msg);
871
872 return 0;
873 }
874
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37052 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [linux-next:master 10081/11483] drivers/net/ethernet/asix/ax88796c_main.c:851:24: warning: address of array 'ax_local->phydev->advertising' will always evaluate to 'true'
@ 2021-10-27 9:41 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-10-27 9:41 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4816 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 2376e5fe91bcad74b997d2cc0535abff79ec73c5
commit: a97c69ba4f30e46abb9cc7be8b98227cb468fdf9 [10081/11483] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver
config: mips-randconfig-r011-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a97c69ba4f30e46abb9cc7be8b98227cb468fdf9
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 a97c69ba4f30e46abb9cc7be8b98227cb468fdf9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/asix/ax88796c_main.c:851:24: warning: address of array 'ax_local->phydev->advertising' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (ax_local->phydev->advertising &&
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ~~
1 warning generated.
vim +851 drivers/net/ethernet/asix/ax88796c_main.c
789
790 static int
791 ax88796c_open(struct net_device *ndev)
792 {
793 struct ax88796c_device *ax_local = to_ax88796c_device(ndev);
794 unsigned long irq_flag = 0;
795 int fc = AX_FC_NONE;
796 int ret;
797 u16 t;
798
799 ret = request_irq(ndev->irq, ax88796c_interrupt,
800 irq_flag, ndev->name, ndev);
801 if (ret) {
802 netdev_err(ndev, "unable to get IRQ %d (errno=%d).\n",
803 ndev->irq, ret);
804 return ret;
805 }
806
807 mutex_lock(&ax_local->spi_lock);
808
809 ret = ax88796c_soft_reset(ax_local);
810 if (ret < 0) {
811 free_irq(ndev->irq, ndev);
812 mutex_unlock(&ax_local->spi_lock);
813 return ret;
814 }
815 ax_local->seq_num = 0x1f;
816
817 ax88796c_set_mac_addr(ndev);
818 ax88796c_set_csums(ax_local);
819
820 /* Disable stuffing packet */
821 t = AX_READ(&ax_local->ax_spi, P1_RXBSPCR);
822 t &= ~RXBSPCR_STUF_ENABLE;
823 AX_WRITE(&ax_local->ax_spi, t, P1_RXBSPCR);
824
825 /* Enable RX packet process */
826 AX_WRITE(&ax_local->ax_spi, RPPER_RXEN, P1_RPPER);
827
828 t = AX_READ(&ax_local->ax_spi, P0_FER);
829 t |= FER_RXEN | FER_TXEN | FER_BSWAP | FER_IRQ_PULL;
830 AX_WRITE(&ax_local->ax_spi, t, P0_FER);
831
832 /* Setup LED mode */
833 AX_WRITE(&ax_local->ax_spi,
834 (LCR_LED0_EN | LCR_LED0_DUPLEX | LCR_LED1_EN |
835 LCR_LED1_100MODE), P2_LCR0);
836 AX_WRITE(&ax_local->ax_spi,
837 (AX_READ(&ax_local->ax_spi, P2_LCR1) & LCR_LED2_MASK) |
838 LCR_LED2_EN | LCR_LED2_LINK, P2_LCR1);
839
840 /* Disable PHY auto-polling */
841 AX_WRITE(&ax_local->ax_spi, PCR_PHYID(AX88796C_PHY_ID), P2_PCR);
842
843 /* Enable MAC interrupts */
844 AX_WRITE(&ax_local->ax_spi, IMR_DEFAULT, P0_IMR);
845
846 mutex_unlock(&ax_local->spi_lock);
847
848 /* Setup flow-control configuration */
849 phy_support_asym_pause(ax_local->phydev);
850
> 851 if (ax_local->phydev->advertising &&
852 (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
853 ax_local->phydev->advertising) ||
854 linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
855 ax_local->phydev->advertising)))
856 fc |= AX_FC_ANEG;
857
858 fc |= linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
859 ax_local->phydev->advertising) ? AX_FC_RX : 0;
860 fc |= (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
861 ax_local->phydev->advertising) !=
862 linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
863 ax_local->phydev->advertising)) ? AX_FC_TX : 0;
864 ax_local->flowctrl = fc;
865
866 phy_start(ax_local->ndev->phydev);
867
868 netif_start_queue(ndev);
869
870 spi_message_init(&ax_local->ax_spi.rx_msg);
871
872 return 0;
873 }
874
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37052 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-27 9:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 9:41 [linux-next:master 10081/11483] drivers/net/ethernet/asix/ax88796c_main.c:851:24: warning: address of array 'ax_local->phydev->advertising' will always evaluate to 'true' kernel test robot
2021-10-27 9:41 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.