mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 12:24:34 +08:00
1851532fd3
The function slcan_set_ethtool_ops() does one thing: populate net_device::ethtool_ops. Instead, it is possible to directly assign this field and remove one function call and slightly reduce the object size. To do so, export slcan_ethtool_ops so it becomes visible to sclan-core.c. This patch reduces the footprint by 14 bytes: | $ ./scripts/bloat-o-meter drivers/net/can/slcan/slcan.{old,new}.o | drivers/net/can/slcan/slcan.o | add/remove: 0/1 grow/shrink: 1/0 up/down: 15/-29 (-14) | Function old new delta | slcan_open 1010 1025 +15 | slcan_set_ethtool_ops 29 - -29 | Total: Before=11115, After=11101, chg -0.13% Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20220727104939.279022-2-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
20 lines
600 B
C
20 lines
600 B
C
/* SPDX-License-Identifier: GPL-2.0
|
|
* slcan.h - serial line CAN interface driver
|
|
*
|
|
* Copyright (C) Laurence Culhane <loz@holmes.demon.co.uk>
|
|
* Copyright (C) Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
|
|
* Copyright (C) Oliver Hartkopp <socketcan@hartkopp.net>
|
|
* Copyright (C) 2022 Amarula Solutions, Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
|
*
|
|
*/
|
|
|
|
#ifndef _SLCAN_H
|
|
#define _SLCAN_H
|
|
|
|
bool slcan_err_rst_on_open(struct net_device *ndev);
|
|
int slcan_enable_err_rst_on_open(struct net_device *ndev, bool on);
|
|
|
|
extern const struct ethtool_ops slcan_ethtool_ops;
|
|
|
|
#endif /* _SLCAN_H */
|