lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201911051131.y3ZkP6Se%lkp@intel.com>
Date:   Tue, 5 Nov 2019 11:30:35 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org
Subject: [net-next:master 89/97]
 drivers/net/ethernet/ibm/emac/core.c:2901:28: error: passing argument 2 of
 'of_get_phy_mode' from incompatible pointer type

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   56c1291ee48b4da2a70aa116098c2afc4a54783b
commit: 0c65b2b90d13c1deaee6449304dd367c5d4eb8ae [89/97] net: of_get_phy_mode: Change API to solve int/unit warnings
config: powerpc-fsp2_defconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 0c65b2b90d13c1deaee6449304dd367c5d4eb8ae
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   drivers/net/ethernet/ibm/emac/core.c: In function 'emac_init_config':
>> drivers/net/ethernet/ibm/emac/core.c:2901:28: error: passing argument 2 of 'of_get_phy_mode' from incompatible pointer type [-Werror=incompatible-pointer-types]
     err = of_get_phy_mode(np, &dev->phy_mode);
                               ^
   In file included from drivers/net/ethernet/ibm/emac/core.c:39:0:
   include/linux/of_net.h:15:12: note: expected 'phy_interface_t * {aka enum <anonymous> *}' but argument is of type 'int *'
    extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
               ^~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/of_get_phy_mode +2901 drivers/net/ethernet/ibm/emac/core.c

  2847	
  2848	static int emac_init_config(struct emac_instance *dev)
  2849	{
  2850		struct device_node *np = dev->ofdev->dev.of_node;
  2851		const void *p;
  2852		int err;
  2853	
  2854		/* Read config from device-tree */
  2855		if (emac_read_uint_prop(np, "mal-device", &dev->mal_ph, 1))
  2856			return -ENXIO;
  2857		if (emac_read_uint_prop(np, "mal-tx-channel", &dev->mal_tx_chan, 1))
  2858			return -ENXIO;
  2859		if (emac_read_uint_prop(np, "mal-rx-channel", &dev->mal_rx_chan, 1))
  2860			return -ENXIO;
  2861		if (emac_read_uint_prop(np, "cell-index", &dev->cell_index, 1))
  2862			return -ENXIO;
  2863		if (emac_read_uint_prop(np, "max-frame-size", &dev->max_mtu, 0))
  2864			dev->max_mtu = ETH_DATA_LEN;
  2865		if (emac_read_uint_prop(np, "rx-fifo-size", &dev->rx_fifo_size, 0))
  2866			dev->rx_fifo_size = 2048;
  2867		if (emac_read_uint_prop(np, "tx-fifo-size", &dev->tx_fifo_size, 0))
  2868			dev->tx_fifo_size = 2048;
  2869		if (emac_read_uint_prop(np, "rx-fifo-size-gige", &dev->rx_fifo_size_gige, 0))
  2870			dev->rx_fifo_size_gige = dev->rx_fifo_size;
  2871		if (emac_read_uint_prop(np, "tx-fifo-size-gige", &dev->tx_fifo_size_gige, 0))
  2872			dev->tx_fifo_size_gige = dev->tx_fifo_size;
  2873		if (emac_read_uint_prop(np, "phy-address", &dev->phy_address, 0))
  2874			dev->phy_address = 0xffffffff;
  2875		if (emac_read_uint_prop(np, "phy-map", &dev->phy_map, 0))
  2876			dev->phy_map = 0xffffffff;
  2877		if (emac_read_uint_prop(np, "gpcs-address", &dev->gpcs_address, 0))
  2878			dev->gpcs_address = 0xffffffff;
  2879		if (emac_read_uint_prop(np->parent, "clock-frequency", &dev->opb_bus_freq, 1))
  2880			return -ENXIO;
  2881		if (emac_read_uint_prop(np, "tah-device", &dev->tah_ph, 0))
  2882			dev->tah_ph = 0;
  2883		if (emac_read_uint_prop(np, "tah-channel", &dev->tah_port, 0))
  2884			dev->tah_port = 0;
  2885		if (emac_read_uint_prop(np, "mdio-device", &dev->mdio_ph, 0))
  2886			dev->mdio_ph = 0;
  2887		if (emac_read_uint_prop(np, "zmii-device", &dev->zmii_ph, 0))
  2888			dev->zmii_ph = 0;
  2889		if (emac_read_uint_prop(np, "zmii-channel", &dev->zmii_port, 0))
  2890			dev->zmii_port = 0xffffffff;
  2891		if (emac_read_uint_prop(np, "rgmii-device", &dev->rgmii_ph, 0))
  2892			dev->rgmii_ph = 0;
  2893		if (emac_read_uint_prop(np, "rgmii-channel", &dev->rgmii_port, 0))
  2894			dev->rgmii_port = 0xffffffff;
  2895		if (emac_read_uint_prop(np, "fifo-entry-size", &dev->fifo_entry_size, 0))
  2896			dev->fifo_entry_size = 16;
  2897		if (emac_read_uint_prop(np, "mal-burst-size", &dev->mal_burst_size, 0))
  2898			dev->mal_burst_size = 256;
  2899	
  2900		/* PHY mode needs some decoding */
> 2901		err = of_get_phy_mode(np, &dev->phy_mode);
  2902		if (err)
  2903			dev->phy_mode = PHY_INTERFACE_MODE_NA;
  2904	
  2905		/* Check EMAC version */
  2906		if (of_device_is_compatible(np, "ibm,emac4sync")) {
  2907			dev->features |= (EMAC_FTR_EMAC4 | EMAC_FTR_EMAC4SYNC);
  2908			if (of_device_is_compatible(np, "ibm,emac-460ex") ||
  2909			    of_device_is_compatible(np, "ibm,emac-460gt"))
  2910				dev->features |= EMAC_FTR_460EX_PHY_CLK_FIX;
  2911			if (of_device_is_compatible(np, "ibm,emac-405ex") ||
  2912			    of_device_is_compatible(np, "ibm,emac-405exr"))
  2913				dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX;
  2914			if (of_device_is_compatible(np, "ibm,emac-apm821xx")) {
  2915				dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE |
  2916						  EMAC_FTR_APM821XX_NO_HALF_DUPLEX |
  2917						  EMAC_FTR_460EX_PHY_CLK_FIX);
  2918			}
  2919		} else if (of_device_is_compatible(np, "ibm,emac4")) {
  2920			dev->features |= EMAC_FTR_EMAC4;
  2921			if (of_device_is_compatible(np, "ibm,emac-440gx"))
  2922				dev->features |= EMAC_FTR_440GX_PHY_CLK_FIX;
  2923		} else {
  2924			if (of_device_is_compatible(np, "ibm,emac-440ep") ||
  2925			    of_device_is_compatible(np, "ibm,emac-440gr"))
  2926				dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX;
  2927			if (of_device_is_compatible(np, "ibm,emac-405ez")) {
  2928	#ifdef CONFIG_IBM_EMAC_NO_FLOW_CTRL
  2929				dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x;
  2930	#else
  2931				printk(KERN_ERR "%pOF: Flow control not disabled!\n",
  2932						np);
  2933				return -ENXIO;
  2934	#endif
  2935			}
  2936	
  2937		}
  2938	
  2939		/* Fixup some feature bits based on the device tree */
  2940		if (of_get_property(np, "has-inverted-stacr-oc", NULL))
  2941			dev->features |= EMAC_FTR_STACR_OC_INVERT;
  2942		if (of_get_property(np, "has-new-stacr-staopc", NULL))
  2943			dev->features |= EMAC_FTR_HAS_NEW_STACR;
  2944	
  2945		/* CAB lacks the appropriate properties */
  2946		if (of_device_is_compatible(np, "ibm,emac-axon"))
  2947			dev->features |= EMAC_FTR_HAS_NEW_STACR |
  2948				EMAC_FTR_STACR_OC_INVERT;
  2949	
  2950		/* Enable TAH/ZMII/RGMII features as found */
  2951		if (dev->tah_ph != 0) {
  2952	#ifdef CONFIG_IBM_EMAC_TAH
  2953			dev->features |= EMAC_FTR_HAS_TAH;
  2954	#else
  2955			printk(KERN_ERR "%pOF: TAH support not enabled !\n", np);
  2956			return -ENXIO;
  2957	#endif
  2958		}
  2959	
  2960		if (dev->zmii_ph != 0) {
  2961	#ifdef CONFIG_IBM_EMAC_ZMII
  2962			dev->features |= EMAC_FTR_HAS_ZMII;
  2963	#else
  2964			printk(KERN_ERR "%pOF: ZMII support not enabled !\n", np);
  2965			return -ENXIO;
  2966	#endif
  2967		}
  2968	
  2969		if (dev->rgmii_ph != 0) {
  2970	#ifdef CONFIG_IBM_EMAC_RGMII
  2971			dev->features |= EMAC_FTR_HAS_RGMII;
  2972	#else
  2973			printk(KERN_ERR "%pOF: RGMII support not enabled !\n", np);
  2974			return -ENXIO;
  2975	#endif
  2976		}
  2977	
  2978		/* Read MAC-address */
  2979		p = of_get_property(np, "local-mac-address", NULL);
  2980		if (p == NULL) {
  2981			printk(KERN_ERR "%pOF: Can't find local-mac-address property\n",
  2982			       np);
  2983			return -ENXIO;
  2984		}
  2985		memcpy(dev->ndev->dev_addr, p, ETH_ALEN);
  2986	
  2987		/* IAHT and GAHT filter parameterization */
  2988		if (emac_has_feature(dev, EMAC_FTR_EMAC4SYNC)) {
  2989			dev->xaht_slots_shift = EMAC4SYNC_XAHT_SLOTS_SHIFT;
  2990			dev->xaht_width_shift = EMAC4SYNC_XAHT_WIDTH_SHIFT;
  2991		} else {
  2992			dev->xaht_slots_shift = EMAC4_XAHT_SLOTS_SHIFT;
  2993			dev->xaht_width_shift = EMAC4_XAHT_WIDTH_SHIFT;
  2994		}
  2995	
  2996		/* This should never happen */
  2997		if (WARN_ON(EMAC_XAHT_REGS(dev) > EMAC_XAHT_MAX_REGS))
  2998			return -ENXIO;
  2999	
  3000		DBG(dev, "features     : 0x%08x / 0x%08x\n", dev->features, EMAC_FTRS_POSSIBLE);
  3001		DBG(dev, "tx_fifo_size : %d (%d gige)\n", dev->tx_fifo_size, dev->tx_fifo_size_gige);
  3002		DBG(dev, "rx_fifo_size : %d (%d gige)\n", dev->rx_fifo_size, dev->rx_fifo_size_gige);
  3003		DBG(dev, "max_mtu      : %d\n", dev->max_mtu);
  3004		DBG(dev, "OPB freq     : %d\n", dev->opb_bus_freq);
  3005	
  3006		return 0;
  3007	}
  3008	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (15286 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ