Skip to content

Commit 4618245

Browse files
arndbdavem330
authored andcommitted
dsa: ptp: mark dummy helpers as 'inline'
Declaring a static function in a header leads to a warning every time that header gets included without the function being used: In file included from drivers/net/dsa/mv88e6xxx/chip.c:42: drivers/net/dsa/mv88e6xxx/ptp.h:92:13: error: 'mv88e6xxx_hwtstamp_work' defined but not used [-Werror=unused-function] static long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp) In file included from drivers/net/dsa/mv88e6xxx/chip.c:38: drivers/net/dsa/mv88e6xxx/global2.h:355:12: error: 'mv88e6xxx_g2_wait' defined but not used [-Werror=unused-function] static int mv88e6xxx_g2_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask) ^~~~~~~~~~~~~~~~~ drivers/net/dsa/mv88e6xxx/global2.h:350:12: error: 'mv88e6xxx_g2_update' defined but not used [-Werror=unused-function] static int mv88e6xxx_g2_update(struct mv88e6xxx_chip *chip, int reg, u16 update) ^~~~~~~~~~~~~~~~~~~ drivers/net/dsa/mv88e6xxx/global2.h:345:12: error: 'mv88e6xxx_g2_write' defined but not used [-Werror=unused-function] static int mv88e6xxx_g2_write(struct mv88e6xxx_chip *chip, int reg, u16 val) ^~~~~~~~~~~~~~~~~~ drivers/net/dsa/mv88e6xxx/global2.h:340:12: error: 'mv88e6xxx_g2_read' defined but not used [-Werror=unused-function] static int mv88e6xxx_g2_read(struct mv88e6xxx_chip *chip, int reg, u16 *val) This marks all such functions in dsa inline to make sure we don't warn about them. Fixes: c6fe0ad ("net: dsa: mv88e6xxx: add rx/tx timestamping support") Fixes: 0d632c3 ("net: dsa: mv88e6xxx: add accessors for PTP/TAI registers") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8e88262 commit 4618245

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/net/dsa/mv88e6xxx/global2.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,22 +345,22 @@ static inline int mv88e6xxx_g2_require(struct mv88e6xxx_chip *chip)
345345
return 0;
346346
}
347347

348-
static int mv88e6xxx_g2_read(struct mv88e6xxx_chip *chip, int reg, u16 *val)
348+
static inline int mv88e6xxx_g2_read(struct mv88e6xxx_chip *chip, int reg, u16 *val)
349349
{
350350
return -EOPNOTSUPP;
351351
}
352352

353-
static int mv88e6xxx_g2_write(struct mv88e6xxx_chip *chip, int reg, u16 val)
353+
static inline int mv88e6xxx_g2_write(struct mv88e6xxx_chip *chip, int reg, u16 val)
354354
{
355355
return -EOPNOTSUPP;
356356
}
357357

358-
static int mv88e6xxx_g2_update(struct mv88e6xxx_chip *chip, int reg, u16 update)
358+
static inline int mv88e6xxx_g2_update(struct mv88e6xxx_chip *chip, int reg, u16 update)
359359
{
360360
return -EOPNOTSUPP;
361361
}
362362

363-
static int mv88e6xxx_g2_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask)
363+
static inline int mv88e6xxx_g2_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask)
364364
{
365365
return -EOPNOTSUPP;
366366
}

drivers/net/dsa/mv88e6xxx/ptp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void mv88e6xxx_ptp_free(struct mv88e6xxx_chip *chip);
8989

9090
#else /* !CONFIG_NET_DSA_MV88E6XXX_PTP */
9191

92-
static long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp)
92+
static inline long mv88e6xxx_hwtstamp_work(struct ptp_clock_info *ptp)
9393
{
9494
return -1;
9595
}
@@ -99,7 +99,7 @@ static inline int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip)
9999
return 0;
100100
}
101101

102-
static void mv88e6xxx_ptp_free(struct mv88e6xxx_chip *chip)
102+
static inline void mv88e6xxx_ptp_free(struct mv88e6xxx_chip *chip)
103103
{
104104
}
105105

0 commit comments

Comments
 (0)