Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/3 v4 net-next] 8390: Miscellaneous cleanups
@ 2020-09-05 17:44 Armin Wolf
2020-09-05 20:22 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Armin Wolf @ 2020-09-05 17:44 UTC (permalink / raw)
To: davem; +Cc: netdev
Replace version string with MODULE_* macros.
Include necessary libraries.
Fix two minor coding-style issues.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/net/ethernet/8390/8390.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/8390/8390.c b/drivers/net/ethernet/8390/8390.c
index 0e0aa4016858..a7937c75d85f 100644
--- a/drivers/net/ethernet/8390/8390.c
+++ b/drivers/net/ethernet/8390/8390.c
@@ -1,11 +1,23 @@
// SPDX-License-Identifier: GPL-2.0-only
-/* 8390 core for usual drivers */
-static const char version[] =
- "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
+#define DRV_NAME "8390"
+#define DRV_DESCRIPTION "8390 core for usual drivers"
+#define DRV_AUTHOR "Donald Becker (becker@cesdis.gsfc.nasa.gov)"
+#define DRV_RELDATE "9/23/1994"
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
#include "lib8390.c"
+MODULE_AUTHOR(DRV_AUTHOR);
+MODULE_DESCRIPTION(DRV_DESCRIPTION);
+
int ei_open(struct net_device *dev)
{
return __ei_open(dev);
@@ -64,7 +76,7 @@ const struct net_device_ops ei_netdev_ops = {
.ndo_get_stats = ei_get_stats,
.ndo_set_rx_mode = ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = eth_mac_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ei_poll,
#endif
@@ -74,6 +86,7 @@ EXPORT_SYMBOL(ei_netdev_ops);
struct net_device *__alloc_ei_netdev(int size)
{
struct net_device *dev = ____alloc_ei_netdev(size);
+
if (dev)
dev->netdev_ops = &ei_netdev_ops;
return dev;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3 v4 net-next] 8390: Miscellaneous cleanups
2020-09-05 17:44 [PATCH 2/3 v4 net-next] 8390: Miscellaneous cleanups Armin Wolf
@ 2020-09-05 20:22 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-09-05 20:22 UTC (permalink / raw)
To: Armin Wolf; +Cc: davem, netdev
On Sat, 5 Sep 2020 19:44:11 +0200 Armin Wolf wrote:
> Replace version string with MODULE_* macros.
>
> Include necessary libraries.
>
> Fix two minor coding-style issues.
These 3 may be better as separate commits.
> diff --git a/drivers/net/ethernet/8390/8390.c b/drivers/net/ethernet/8390/8390.c
> index 0e0aa4016858..a7937c75d85f 100644
> --- a/drivers/net/ethernet/8390/8390.c
> +++ b/drivers/net/ethernet/8390/8390.c
> @@ -1,11 +1,23 @@
> // SPDX-License-Identifier: GPL-2.0-only
> -/* 8390 core for usual drivers */
>
> -static const char version[] =
> - "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
> +#define DRV_NAME "8390"
> +#define DRV_DESCRIPTION "8390 core for usual drivers"
> +#define DRV_AUTHOR "Donald Becker (becker@cesdis.gsfc.nasa.gov)"
> +#define DRV_RELDATE "9/23/1994"
I don't quite get why you define DRV_NAME and DRV_RELDATE.
If you want to preserve the version information you can add it as a
comment, but honestly I'm not really sure if it's worth preserving.
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/export.h>
> +
No need for the empty line here IMHO.
> +#include <linux/netdevice.h>
> +#include <linux/etherdevice.h>
Sort the includes alphabetically.
> #include "lib8390.c"
>
> +MODULE_AUTHOR(DRV_AUTHOR);
> +MODULE_DESCRIPTION(DRV_DESCRIPTION);
> +
> int ei_open(struct net_device *dev)
> {
> return __ei_open(dev);
> @@ -64,7 +76,7 @@ const struct net_device_ops ei_netdev_ops = {
> .ndo_get_stats = ei_get_stats,
> .ndo_set_rx_mode = ei_set_multicast_list,
> .ndo_validate_addr = eth_validate_addr,
> - .ndo_set_mac_address = eth_mac_addr,
> + .ndo_set_mac_address = eth_mac_addr,
> #ifdef CONFIG_NET_POLL_CONTROLLER
> .ndo_poll_controller = ei_poll,
> #endif
> @@ -74,6 +86,7 @@ EXPORT_SYMBOL(ei_netdev_ops);
> struct net_device *__alloc_ei_netdev(int size)
> {
> struct net_device *dev = ____alloc_ei_netdev(size);
> +
> if (dev)
> dev->netdev_ops = &ei_netdev_ops;
> return dev;
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-05 20:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-05 17:44 [PATCH 2/3 v4 net-next] 8390: Miscellaneous cleanups Armin Wolf
2020-09-05 20:22 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).