lkml.org 
[lkml]   [2021]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH net-next v3 7/9] net: phy: icplus: fix paged register access
    Hi Michael,

    I love your patch! Perhaps something to improve:

    [auto build test WARNING on net-next/master]

    url: https://github.com/0day-ci/linux/commits/Michael-Walle/net-phy-icplus-cleanups-and-new-features/20210211-051702
    base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git de1db4a6ed6241e34cab0e5059d4b56f6bae39b9
    config: powerpc64-randconfig-r004-20210211 (attached as .config)
    compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
    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/0day-ci/linux/commit/07b7c444040f9baff7b28415b4f26be7e7a71e2e
    git remote add linux-review https://github.com/0day-ci/linux
    git fetch --no-tags linux-review Michael-Walle/net-phy-icplus-cleanups-and-new-features/20210211-051702
    git checkout 07b7c444040f9baff7b28415b4f26be7e7a71e2e
    # 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@intel.com>

    All warnings (new ones prefixed by >>):

    __do_insb
    ^
    arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
    #define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
    ~~~~~~~~~~~~~~~~~~~~~^
    In file included from drivers/net/phy/icplus.c:11:
    In file included from include/linux/interrupt.h:11:
    In file included from include/linux/hardirq.h:10:
    In file included from arch/powerpc/include/asm/hardirq.h:6:
    In file included from include/linux/irq.h:20:
    In file included from include/linux/io.h:13:
    In file included from arch/powerpc/include/asm/io.h:619:
    arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
    __do_##name al; \
    ^~~~~~~~~~~~~~
    <scratch space>:139:1: note: expanded from here
    __do_insw
    ^
    arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
    #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
    ~~~~~~~~~~~~~~~~~~~~~^
    In file included from drivers/net/phy/icplus.c:11:
    In file included from include/linux/interrupt.h:11:
    In file included from include/linux/hardirq.h:10:
    In file included from arch/powerpc/include/asm/hardirq.h:6:
    In file included from include/linux/irq.h:20:
    In file included from include/linux/io.h:13:
    In file included from arch/powerpc/include/asm/io.h:619:
    arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
    __do_##name al; \
    ^~~~~~~~~~~~~~
    <scratch space>:141:1: note: expanded from here
    __do_insl
    ^
    arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
    #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
    ~~~~~~~~~~~~~~~~~~~~~^
    In file included from drivers/net/phy/icplus.c:11:
    In file included from include/linux/interrupt.h:11:
    In file included from include/linux/hardirq.h:10:
    In file included from arch/powerpc/include/asm/hardirq.h:6:
    In file included from include/linux/irq.h:20:
    In file included from include/linux/io.h:13:
    In file included from arch/powerpc/include/asm/io.h:619:
    arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
    __do_##name al; \
    ^~~~~~~~~~~~~~
    <scratch space>:143:1: note: expanded from here
    __do_outsb
    ^
    arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
    #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
    ~~~~~~~~~~~~~~~~~~~~~^
    In file included from drivers/net/phy/icplus.c:11:
    In file included from include/linux/interrupt.h:11:
    In file included from include/linux/hardirq.h:10:
    In file included from arch/powerpc/include/asm/hardirq.h:6:
    In file included from include/linux/irq.h:20:
    In file included from include/linux/io.h:13:
    In file included from arch/powerpc/include/asm/io.h:619:
    arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
    __do_##name al; \
    ^~~~~~~~~~~~~~
    <scratch space>:145:1: note: expanded from here
    __do_outsw
    ^
    arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
    #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
    ~~~~~~~~~~~~~~~~~~~~~^
    In file included from drivers/net/phy/icplus.c:11:
    In file included from include/linux/interrupt.h:11:
    In file included from include/linux/hardirq.h:10:
    In file included from arch/powerpc/include/asm/hardirq.h:6:
    In file included from include/linux/irq.h:20:
    In file included from include/linux/io.h:13:
    In file included from arch/powerpc/include/asm/io.h:619:
    arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
    __do_##name al; \
    ^~~~~~~~~~~~~~
    <scratch space>:147:1: note: expanded from here
    __do_outsl
    ^
    arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
    #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
    ~~~~~~~~~~~~~~~~~~~~~^
    >> drivers/net/phy/icplus.c:237:2: warning: variable 'err' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
    default:
    ^~~~~~~
    drivers/net/phy/icplus.c:249:43: note: uninitialized use occurs here
    return phy_restore_page(phydev, oldpage, err);
    ^~~
    drivers/net/phy/icplus.c:216:18: note: initialize the variable 'err' to silence this warning
    int oldpage, err;
    ^
    = 0
    7 warnings generated.


    vim +/err +237 drivers/net/phy/icplus.c

    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 212
    56ff94ca1f47d1 Michael Walle 2021-02-10 213 static int ip101a_g_config_intr_pin(struct phy_device *phydev)
    034289b2d7cf29 Martin Blumenstingl 2018-11-18 214 {
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 215 struct ip101a_g_phy_priv *priv = phydev->priv;
    07b7c444040f9b Michael Walle 2021-02-10 216 int oldpage, err;
    07b7c444040f9b Michael Walle 2021-02-10 217
    07b7c444040f9b Michael Walle 2021-02-10 218 oldpage = phy_select_page(phydev, IP101G_DEFAULT_PAGE);
    034289b2d7cf29 Martin Blumenstingl 2018-11-18 219
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 220 /* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 221 switch (priv->sel_intr32) {
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 222 case IP101GR_SEL_INTR32_RXER:
    07b7c444040f9b Michael Walle 2021-02-10 223 err = __phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 224 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32, 0);
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 225 if (err < 0)
    07b7c444040f9b Michael Walle 2021-02-10 226 goto out;
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 227 break;
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 228
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 229 case IP101GR_SEL_INTR32_INTR:
    07b7c444040f9b Michael Walle 2021-02-10 230 err = __phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 231 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32,
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 232 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32);
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 233 if (err < 0)
    07b7c444040f9b Michael Walle 2021-02-10 234 goto out;
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 235 break;
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 236
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 @237 default:
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 238 /* Don't touch IP101G_DIGITAL_IO_SPEC_CTRL because it's not
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 239 * documented on IP101A and it's not clear whether this would
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 240 * cause problems.
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 241 * For the 32-pin IP101GR we simply keep the SEL_INTR32
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 242 * configuration as set by the bootloader when not configured
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 243 * to one of the special functions.
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 244 */
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 245 break;
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 246 }
    f2f1a847e74f61 Martin Blumenstingl 2018-11-18 247
    07b7c444040f9b Michael Walle 2021-02-10 248 out:
    07b7c444040f9b Michael Walle 2021-02-10 249 return phy_restore_page(phydev, oldpage, err);
    56ff94ca1f47d1 Michael Walle 2021-02-10 250 }
    56ff94ca1f47d1 Michael Walle 2021-02-10 251

    ---
    0-DAY CI Kernel Test Service, Intel Corporation
    https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
    [unhandled content-type:application/gzip]
    \
     
     \ /
      Last update: 2021-02-11 00:25    [W:4.152 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site