Commit c8658e58 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'phy-warn'



Andrew Lunn says:

====================
drivers/net/phy C=1 W=1 fixes

This fixes most of the Sparse and W=1 warnings in drivers/net/phy. The
Cavium code is still not fully clean, but it might actually be the
strange code is confusing Sparse.

v2
--
Added RB, TB, AB.
s/case/cause
Reverse Christmas tree
Module soft dependencies
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5411ca71 791e5f61
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -961,7 +961,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
				PHY_INTERFACE_MODE_MII);

	if (!phydev)
		return -ENODEV;
		return -EPROBE_DEFER;

	return 0;
}
@@ -1554,12 +1554,8 @@ static struct platform_driver octeon_mgmt_driver = {
	.remove		= octeon_mgmt_remove,
};

extern void octeon_mdiobus_force_mod_depencency(void);

static int __init octeon_mgmt_mod_init(void)
{
	/* Force our mdiobus driver module to be loaded first. */
	octeon_mdiobus_force_mod_depencency();
	return platform_driver_register(&octeon_mgmt_driver);
}

@@ -1571,6 +1567,7 @@ static void __exit octeon_mgmt_mod_exit(void)
module_init(octeon_mgmt_mod_init);
module_exit(octeon_mgmt_mod_exit);

MODULE_SOFTDEP("pre: mdio-cavium");
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("David Daney");
MODULE_LICENSE("GPL");
+6 −6
Original line number Diff line number Diff line
@@ -106,8 +106,8 @@

/**
 * struct adin_cfg_reg_map - map a config value to aregister value
 * @cfg		value in device configuration
 * @reg		value in the register
 * @cfg:	value in device configuration
 * @reg:	value in the register
 */
struct adin_cfg_reg_map {
	int cfg;
@@ -135,9 +135,9 @@ static const struct adin_cfg_reg_map adin_rmii_fifo_depths[] = {

/**
 * struct adin_clause45_mmd_map - map to convert Clause 45 regs to Clause 22
 * @devad		device address used in Clause 45 access
 * @cl45_regnum		register address defined by Clause 45
 * @adin_regnum		equivalent register address accessible via Clause 22
 * @devad:		device address used in Clause 45 access
 * @cl45_regnum:	register address defined by Clause 45
 * @adin_regnum:	equivalent register address accessible via Clause 22
 */
struct adin_clause45_mmd_map {
	int devad;
@@ -174,7 +174,7 @@ static const struct adin_hw_stat adin_hw_stats[] = {

/**
 * struct adin_priv - ADIN PHY driver private data
 * stats		statistic counters for the PHY
 * @stats:		statistic counters for the PHY
 */
struct adin_priv {
	u64			stats[ARRAY_SIZE(adin_hw_stats)];
+3 −4
Original line number Diff line number Diff line
@@ -400,8 +400,8 @@ static int at803x_parse_dt(struct phy_device *phydev)
{
	struct device_node *node = phydev->mdio.dev.of_node;
	struct at803x_priv *priv = phydev->priv;
	unsigned int sel, mask;
	u32 freq, strength;
	unsigned int sel;
	int ret;

	if (!IS_ENABLED(CONFIG_OF_MDIO))
@@ -409,7 +409,6 @@ static int at803x_parse_dt(struct phy_device *phydev)

	ret = of_property_read_u32(node, "qca,clk-out-frequency", &freq);
	if (!ret) {
		mask = AT803X_CLK_OUT_MASK;
		switch (freq) {
		case 25000000:
			sel = AT803X_CLK_OUT_25MHZ_XTAL;
@@ -428,8 +427,8 @@ static int at803x_parse_dt(struct phy_device *phydev)
			return -EINVAL;
		}

		priv->clk_25m_reg |= FIELD_PREP(mask, sel);
		priv->clk_25m_mask |= mask;
		priv->clk_25m_reg |= FIELD_PREP(AT803X_CLK_OUT_MASK, sel);
		priv->clk_25m_mask |= AT803X_CLK_OUT_MASK;

		/* Fixup for the AR8030/AR8035. This chip has another mask and
		 * doesn't support the DSP reference. Eg. the lowest bit of the
+3 −2
Original line number Diff line number Diff line
@@ -803,9 +803,10 @@ static int decode_evnt(struct dp83640_private *dp83640,

static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
{
	u16 *seqid, hash;
	unsigned int offset = 0;
	u8 *msgtype, *data = skb_mac_header(skb);
	__be16 *seqid;
	u16 hash;

	/* check sequenceID, messageType, 12 bit hash of offset 20-29 */

@@ -836,7 +837,7 @@ static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
	if (rxts->msgtype != (*msgtype & 0xf))
		return 0;

	seqid = (u16 *)(data + offset + OFF_PTP_SEQUENCE_ID);
	seqid = (__be16 *)(data + offset + OFF_PTP_SEQUENCE_ID);
	if (rxts->seqid != ntohs(*seqid))
		return 0;

+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@ static DEFINE_MUTEX(mdio_board_lock);
/**
 * mdiobus_setup_mdiodev_from_board_info - create and setup MDIO devices
 * from pre-collected board specific MDIO information
 * @mdiodev: MDIO device pointer
 * @bus: Bus the board_info belongs to
 * @cb: Callback to create device on bus
 * Context: can sleep
 */
void mdiobus_setup_mdiodev_from_board_info(struct mii_bus *bus,
Loading