rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] net: phy: qt2025: Fix warning: unused import DeviceId
@ 2024-09-21  6:25 FUJITA Tomonori
  2024-09-26  9:48 ` Paolo Abeni
  0 siblings, 1 reply; 2+ messages in thread
From: FUJITA Tomonori @ 2024-09-21  6:25 UTC (permalink / raw)
  To: netdev
  Cc: rust-for-linux, andrew, tmgross, aliceryhl, hkallweit1, linux,
	davem, edumazet, kuba, pabeni, kernel test robot

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 a module. Use phy::DeviceId in the macro instead of
importing `DeviceId` since `phy` is always used.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409190717.i135rfVo-lkp@intel.com/
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Trevor Gross <tmgross@umich.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
v2:
 - fix the commit log
 - add Alice and Trevor's Reviewed-by
---
 drivers/net/phy/qt2025.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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>",

base-commit: b5109b60ee4fcb2f2bb24f589575e10cc5283ad4
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v2] net: phy: qt2025: Fix warning: unused import DeviceId
  2024-09-21  6:25 [PATCH net v2] net: phy: qt2025: Fix warning: unused import DeviceId FUJITA Tomonori
@ 2024-09-26  9:48 ` Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2024-09-26  9:48 UTC (permalink / raw)
  To: FUJITA Tomonori, netdev
  Cc: rust-for-linux, andrew, tmgross, aliceryhl, hkallweit1, linux,
	davem, edumazet, kuba, kernel test robot

On 9/21/24 08:25, FUJITA Tomonori 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 a module. Use phy::DeviceId in the macro instead of
> importing `DeviceId` since `phy` is always used.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409190717.i135rfVo-lkp@intel.com/
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Reviewed-by: Trevor Gross <tmgross@umich.edu>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Please additionally include a suitable fixes tag in the tag area, thanks!

Paolo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-26  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-21  6:25 [PATCH net v2] net: phy: qt2025: Fix warning: unused import DeviceId FUJITA Tomonori
2024-09-26  9:48 ` Paolo Abeni

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).