Skip to content

Commit 5921105

Browse files
committed
Merge branch 'vermagic-non-global'
Leon Romanovsky says: ==================== Remove vermagic header from global include folder Changelog: v2: * Changed the implementation of patch #4 to be like Masahiro wants. I personally don't like this implementation and changing it just to move forward this this patchset. v1: https://lore.kernel.org/lkml/[email protected] * Added tags * Updated patch #4 with test results * Changed scripts/mod/modpost.c to create inclusion of vermagic.h from kernel folder and not from general include/linux. This is needed to generate *.mod.c files, while building modules. v0: https://lore.kernel.org/lkml/[email protected] This is followup to the failure reported by Borislav [1] and suggested fix later on [2]. The series removes all includes of linux/vermagic.h, updates hns and nfp to use same kernel versioning scheme (exactly like we did for other drivers in previous cycle) and removes vermagic.h from global include folder. [1] https://lore.kernel.org/lkml/[email protected] [2] https://lore.kernel.org/lkml/[email protected] ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents b6246f4 + 51161bf commit 5921105

File tree

15 files changed

+13
-24
lines changed

15 files changed

+13
-24
lines changed

drivers/net/bonding/bonding_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifndef _BONDING_PRIV_H
1616
#define _BONDING_PRIV_H
17-
#include <linux/vermagic.h>
17+
#include <generated/utsrelease.h>
1818

1919
#define DRV_NAME "bonding"
2020
#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"

drivers/net/ethernet/3com/3c509.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
#include <linux/device.h>
8686
#include <linux/eisa.h>
8787
#include <linux/bitops.h>
88-
#include <linux/vermagic.h>
8988

9089
#include <linux/uaccess.h>
9190
#include <asm/io.h>

drivers/net/ethernet/3com/3c515.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
2323
*/
2424

25-
#include <linux/vermagic.h>
2625
#define DRV_NAME "3c515"
2726

2827
#define CORKSCREW 1

drivers/net/ethernet/adaptec/starfire.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include <asm/processor.h> /* Processor type for cache alignment. */
4646
#include <linux/uaccess.h>
4747
#include <asm/io.h>
48-
#include <linux/vermagic.h>
4948

5049
/*
5150
* The current frame processor firmware fails to checksum a fragment

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/aer.h>
1616
#include <linux/skbuff.h>
1717
#include <linux/sctp.h>
18-
#include <linux/vermagic.h>
1918
#include <net/gre.h>
2019
#include <net/ip6_checksum.h>
2120
#include <net/pkt_cls.h>
@@ -44,7 +43,6 @@ static void hns3_clear_all_ring(struct hnae3_handle *h, bool force);
4443
static void hns3_remove_hw_addr(struct net_device *netdev);
4544

4645
static const char hns3_driver_name[] = "hns3";
47-
const char hns3_driver_version[] = VERMAGIC_STRING;
4846
static const char hns3_driver_string[] =
4947
"Hisilicon Ethernet Network Driver for Hip08 Family";
5048
static const char hns3_copyright[] = "Copyright (c) 2017 Huawei Corporation.";
@@ -4765,4 +4763,3 @@ MODULE_DESCRIPTION("HNS3: Hisilicon Ethernet Driver");
47654763
MODULE_AUTHOR("Huawei Tech. Co., Ltd.");
47664764
MODULE_LICENSE("GPL");
47674765
MODULE_ALIAS("pci:hns-nic");
4768-
MODULE_VERSION(HNS3_MOD_VERSION);

drivers/net/ethernet/hisilicon/hns3/hns3_enet.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
#include "hnae3.h"
1010

11-
#define HNS3_MOD_VERSION "1.0"
12-
13-
extern const char hns3_driver_version[];
14-
1511
enum hns3_nic_state {
1612
HNS3_NIC_STATE_TESTING,
1713
HNS3_NIC_STATE_RESETTING,

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,6 @@ static void hns3_get_drvinfo(struct net_device *netdev,
546546
return;
547547
}
548548

549-
strncpy(drvinfo->version, hns3_driver_version,
550-
sizeof(drvinfo->version));
551-
drvinfo->version[sizeof(drvinfo->version) - 1] = '\0';
552-
553549
strncpy(drvinfo->driver, h->pdev->driver->name,
554550
sizeof(drvinfo->driver));
555551
drvinfo->driver[sizeof(drvinfo->driver) - 1] = '\0';

drivers/net/ethernet/netronome/nfp/nfp_main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/mutex.h>
1515
#include <linux/pci.h>
1616
#include <linux/firmware.h>
17-
#include <linux/vermagic.h>
1817
#include <linux/vmalloc.h>
1918
#include <net/devlink.h>
2019

@@ -31,7 +30,6 @@
3130
#include "nfp_net.h"
3231

3332
static const char nfp_driver_name[] = "nfp";
34-
const char nfp_driver_version[] = VERMAGIC_STRING;
3533

3634
static const struct pci_device_id nfp_pci_device_ids[] = {
3735
{ PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000,
@@ -920,4 +918,3 @@ MODULE_FIRMWARE("netronome/nic_AMDA0099-0001_1x10_1x25.nffw");
920918
MODULE_AUTHOR("Netronome Systems <[email protected]>");
921919
MODULE_LICENSE("GPL");
922920
MODULE_DESCRIPTION("The Netronome Flow Processor (NFP) driver.");
923-
MODULE_VERSION(UTS_RELEASE);

drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ nfp_get_drvinfo(struct nfp_app *app, struct pci_dev *pdev,
203203
char nsp_version[ETHTOOL_FWVERS_LEN] = {};
204204

205205
strlcpy(drvinfo->driver, pdev->driver->name, sizeof(drvinfo->driver));
206-
strlcpy(drvinfo->version, nfp_driver_version, sizeof(drvinfo->version));
207-
208206
nfp_net_get_nspinfo(app, nsp_version);
209207
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
210208
"%s %s %s %s", vnic_version, nsp_version,

drivers/net/ethernet/pensando/ionic/ionic_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <linux/module.h>
77
#include <linux/netdevice.h>
88
#include <linux/utsname.h>
9-
#include <linux/vermagic.h>
9+
#include <generated/utsrelease.h>
1010

1111
#include "ionic.h"
1212
#include "ionic_bus.h"

drivers/power/supply/test_power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <linux/power_supply.h>
1717
#include <linux/errno.h>
1818
#include <linux/delay.h>
19-
#include <linux/vermagic.h>
19+
#include <generated/utsrelease.h>
2020

2121
enum test_power_id {
2222
TEST_AC,

include/linux/vermagic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
#ifndef INCLUDE_VERMAGIC
4+
#error "This header can be included from kernel/module.c or *.mod.c only"
5+
#endif
6+
27
#include <generated/utsrelease.h>
38

49
/* Simply sanity version stamp for modules. */

kernel/module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Copyright (C) 2001 Rusty Russell, 2002, 2010 Rusty Russell IBM.
55
66
*/
7+
8+
#define INCLUDE_VERMAGIC
9+
710
#include <linux/export.h>
811
#include <linux/extable.h>
912
#include <linux/moduleloader.h>

net/ethtool/ioctl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <linux/phy.h>
1818
#include <linux/bitops.h>
1919
#include <linux/uaccess.h>
20-
#include <linux/vermagic.h>
2120
#include <linux/vmalloc.h>
2221
#include <linux/sfp.h>
2322
#include <linux/slab.h>
@@ -28,7 +27,7 @@
2827
#include <net/xdp_sock.h>
2928
#include <net/flow_offload.h>
3029
#include <linux/ethtool_netlink.h>
31-
30+
#include <generated/utsrelease.h>
3231
#include "common.h"
3332

3433
/*

scripts/mod/modpost.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,6 +2251,7 @@ static void add_header(struct buffer *b, struct module *mod)
22512251
* Include build-salt.h after module.h in order to
22522252
* inherit the definitions.
22532253
*/
2254+
buf_printf(b, "#define INCLUDE_VERMAGIC\n");
22542255
buf_printf(b, "#include <linux/build-salt.h>\n");
22552256
buf_printf(b, "#include <linux/vermagic.h>\n");
22562257
buf_printf(b, "#include <linux/compiler.h>\n");

0 commit comments

Comments
 (0)