Message ID | 20240919043707.206400-1-fujita.tomonori@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: phy: qt2025: Fix warning: unused import DeviceId | expand |
On Thu, Sep 19, 2024 at 6:39 AM FUJITA Tomonori <fujita.tomonori@gmail.com> wrote: > > Fix the following warning when the driver is compiled as built-in: > > >> warning: unused import: `DeviceId` > --> drivers/net/phy/qt2025.rs:18:5 > | > 18 | DeviceId, Driver, > | ^^^^^^^^ > | > = note: `#[warn(unused_imports)]` on by default > > device_table in module_phy_driver macro is defined only when the > driver is built as module. Use an absolute module path in the macro > instead of importing `DeviceId`. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202409190717.i135rfVo-lkp@intel.com/ > Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> It may be nice to change the macro to always use the expression so that this warning doesn't happen again. Anyway, that is a separate issue. Reviewed-by: Alice Ryhl <aliceryhl@google.com>
On Thu, 19 Sep 2024 04:37:07 +0000 FUJITA Tomonori <fujita.tomonori@gmail.com> wrote: > Fix the following warning when the driver is compiled as built-in: > >>> warning: unused import: `DeviceId` > --> drivers/net/phy/qt2025.rs:18:5 > | > 18 | DeviceId, Driver, > | ^^^^^^^^ > | > = note: `#[warn(unused_imports)]` on by default > > device_table in module_phy_driver macro is defined only when the > driver is built as module. Use an absolute module path in the macro > instead of importing `DeviceId`. Oops, the last sentence isn't correct. It should've been something like: Use phy::DeviceId in the macro instead of importing `DeviceId` since `phy` is always used.
diff --git a/drivers/net/phy/qt2025.rs b/drivers/net/phy/qt2025.rs index 28d8981f410b..1ab065798175 100644 --- a/drivers/net/phy/qt2025.rs +++ b/drivers/net/phy/qt2025.rs @@ -15,7 +15,7 @@ use kernel::net::phy::{ self, reg::{Mmd, C45}, - DeviceId, Driver, + Driver, }; use kernel::prelude::*; use kernel::sizes::{SZ_16K, SZ_8K}; @@ -23,7 +23,7 @@ kernel::module_phy_driver! { drivers: [PhyQT2025], device_table: [ - DeviceId::new_with_driver::<PhyQT2025>(), + phy::DeviceId::new_with_driver::<PhyQT2025>(), ], name: "qt2025_phy", author: "FUJITA Tomonori <fujita.tomonori@gmail.com>",