rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manas via B4 Relay <devnull+manas18244.iiitd.ac.in@kernel.org>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>,
	 Trevor Gross <tmgross@umich.edu>, Andrew Lunn <andrew@lunn.ch>,
	 Heiner Kallweit <hkallweit1@gmail.com>,
	 Russell King <linux@armlinux.org.uk>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	 Anup Sharma <anupnewsmail@gmail.com>,
	netdev@vger.kernel.org,  rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org,  Miguel Ojeda <ojeda@kernel.org>,
	Manas <manas18244@iiitd.ac.in>
Subject: [PATCH net-next v2] net: phy: qt2025: simplify Result<()> in probe return
Date: Mon, 18 Nov 2024 20:00:36 +0530	[thread overview]
Message-ID: <20241118-simplify-result-qt2025-v2-1-af1bcff5d101@iiitd.ac.in> (raw)

From: Manas <manas18244@iiitd.ac.in>

probe returns a `Result<()>` type, which can be simplified as `Result`,
due to default type parameters being unit `()` and `Error` types. This
maintains a consistent usage of `Result` throughout codebase.

Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1128
Signed-off-by: Manas <manas18244@iiitd.ac.in>
---
Changes in v2:
- Add Link: and Suggested-by: tags
- Link to v1: https://lore.kernel.org/r/20241118-simplify-result-qt2025-v1-1-f2d9cef17fca@iiitd.ac.in
---
 drivers/net/phy/qt2025.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/qt2025.rs b/drivers/net/phy/qt2025.rs
index 1ab065798175b4f54c5f2fd6c871ba2942c48bf1..25c12a02baa255d3d5952e729a890b3ccfe78606 100644
--- a/drivers/net/phy/qt2025.rs
+++ b/drivers/net/phy/qt2025.rs
@@ -39,7 +39,7 @@ impl Driver for PhyQT2025 {
     const NAME: &'static CStr = c_str!("QT2025 10Gpbs SFP+");
     const PHY_DEVICE_ID: phy::DeviceId = phy::DeviceId::new_with_exact_mask(0x0043a400);
 
-    fn probe(dev: &mut phy::Device) -> Result<()> {
+    fn probe(dev: &mut phy::Device) -> Result {
         // Check the hardware revision code.
         // Only 0x3b works with this driver and firmware.
         let hw_rev = dev.read(C45::new(Mmd::PMAPMD, 0xd001))?;

---
base-commit: 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b
change-id: 20241118-simplify-result-qt2025-1bb99d8e53ec

Best regards,
-- 
Manas <manas18244@iiitd.ac.in>



             reply	other threads:[~2024-11-18 14:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 14:30 Manas via B4 Relay [this message]
2024-11-18 16:05 ` [PATCH net-next v2] net: phy: qt2025: simplify Result<()> in probe return Miguel Ojeda
2024-11-19  3:06 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241118-simplify-result-qt2025-v2-1-af1bcff5d101@iiitd.ac.in \
    --to=devnull+manas18244.iiitd.ac.in@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=anupnewsmail@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=manas18244@iiitd.ac.in \
    --cc=netdev@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).