From: 王颢 <howard_wang@realsil.com.cn>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Andre Muezerie <andremue@linux.microsoft.com>,
"dev@dpdk.org" <dev@dpdk.org>,
Bruce Richardson <bruce.richardson@intel.com>,
David Marchand <david.marchand@redhat.com>
Subject: 答复: [PATCH v3 2/3] drivers/net: remove use of non-standard array range initialization
Date: Wed, 18 Jun 2025 09:37:33 +0000 [thread overview]
Message-ID: <1d5377af85fe4025badbf8b717a8a877@realsil.com.cn> (raw)
In-Reply-To: <5034944.6M6d0yLqnL@thomas>
Dear Thomas,
OK, I will update this part in the next code refactoring.
By the way, I would like to ask how to resolve this error. From what I can see, it does not seem to be related to the patches I uploaded.
https://mails.dpdk.org/archives/test-report/2025-June/886815.html
Thanks!
Howard Wang
-----邮件原件-----
发件人: Thomas Monjalon <thomas@monjalon.net>
发送时间: 2025年6月18日 17:25
收件人: 王颢 <howard_wang@realsil.com.cn>
抄送: Andre Muezerie <andremue@linux.microsoft.com>; dev@dpdk.org; Bruce Richardson <bruce.richardson@intel.com>; David Marchand <david.marchand@redhat.com>
主题: Re: [PATCH v3 2/3] drivers/net: remove use of non-standard array range initialization
External mail : This email originated from outside the organization. Do not reply, click links, or open attachments unless you recognize the sender and know the content is safe.
16/06/2025 09:37, David Marchand:
> On Thu, Jun 12, 2025 at 4:18 PM Andre Muezerie
> <andremue@linux.microsoft.com> wrote:
> > diff --git a/drivers/net/r8169/base/rtl8125a_mcu.c
> > b/drivers/net/r8169/base/rtl8125a_mcu.c
> > index 5a69b3e094..c9bf5fc6ad 100644
> > --- a/drivers/net/r8169/base/rtl8125a_mcu.c
> > +++ b/drivers/net/r8169/base/rtl8125a_mcu.c
> > @@ -162,7 +162,13 @@ static void
> > rtl_release_phy_mcu_patch_key_lock(struct rtl_hw *hw) {
> > switch (hw->mcfg) {
> > - case CFG_METHOD_48 ... CFG_METHOD_53:
> > + /* CFG_METHOD_48 ... CFG_METHOD_53 */
> > + case CFG_METHOD_48:
> > + case CFG_METHOD_49:
> > + case CFG_METHOD_50:
> > + case CFG_METHOD_51:
> > + case CFG_METHOD_52:
> > + case CFG_METHOD_53:
> > rtl_mdio_direct_write_phy_ocp(hw, 0xA436, 0x0000);
> > rtl_mdio_direct_write_phy_ocp(hw, 0xA438, 0x0000);
> > rtl_clear_eth_phy_ocp_bit(hw, 0xB82E, BIT_0);
>
> I don't have a strong opinion against this change.
> The driver maintainer already acked this change.
>
> So just some comment, on the form.
> switch() here does not seem well suited since this driver code is
> validating a range of values.
> if (hw->mcfg >= CFG_METHOD_48 && hw->mcfg <= CFG_METHOD_53) seems more
> robust and is easier to read.
Yes I agree with David.
Please could you fix this code to have simpler code with some "if"?
next prev parent reply other threads:[~2025-06-18 9:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 20:11 [PATCH 0/2] " Andre Muezerie
2024-12-26 20:11 ` [PATCH 1/2] app/test: " Andre Muezerie
2024-12-26 20:11 ` [PATCH 2/2] drivers/net: " Andre Muezerie
2025-03-05 16:06 ` [PATCH v2 0/2] " Andre Muezerie
2025-03-05 16:06 ` [PATCH v2 1/2] app/test: " Andre Muezerie
2025-03-05 16:06 ` [PATCH v2 2/2] drivers/net: " Andre Muezerie
2025-03-06 3:00 ` Patrick Robb
2025-03-07 8:07 ` Howard Wang
2025-06-12 14:17 ` [PATCH v3 0/3] enable drivers to be compiled with MSVC Andre Muezerie
2025-06-12 14:17 ` [PATCH v3 1/3] app/test: remove use of non-standard array range initialization Andre Muezerie
2025-06-12 15:03 ` Bruce Richardson
2025-06-16 7:23 ` David Marchand
2025-06-12 14:17 ` [PATCH v3 2/3] drivers/net: " Andre Muezerie
2025-06-16 7:37 ` David Marchand
2025-06-18 9:25 ` Thomas Monjalon
2025-06-18 9:37 ` 王颢 [this message]
2025-06-18 10:04 ` 答复: " Thomas Monjalon
2025-06-12 14:17 ` [PATCH v3 3/3] drivers: enable drivers to be compiled with MSVC Andre Muezerie
2025-06-13 18:55 ` Patrick Robb
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=1d5377af85fe4025badbf8b717a8a877@realsil.com.cn \
--to=howard_wang@realsil.com.cn \
--cc=andremue@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/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).