diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2024-09-30 13:40:37 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-10-03 16:42:18 -0700 |
commit | 3ed8d344e061f382069c27705543c1882aca468a (patch) | |
tree | 00aafbfd619f511cf716dda0ee35176b3cb55ef6 /net/ipv6/netfilter | |
parent | 5fad1c1a09accf13abf4c22cf08445c2649c9d69 (diff) |
rust: net::phy always define device_table in module_phy_driver macro
device_table in module_phy_driver macro is defined only when the
driver is built as a module. So a PHY driver imports phy::DeviceId
module in the following way then hits `unused import` warning when
it's compiled as built-in:
use kernel::net::phy::DeviceId;
kernel::module_phy_driver! {
drivers: [PhyQT2025],
device_table: [
DeviceId::new_with_driver::<PhyQT2025>(),
],
Put device_table in a const. It's not included in the kernel image if
unused (when the driver is compiled as built-in), and the compiler
doesn't complain.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20240930134038.1309-1-fujita.tomonori@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/netfilter')
0 files changed, 0 insertions, 0 deletions