linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: MD Danish Anwar <danishanwar@ti.com>
To: Yibo Dong <dong100@mucse.com>, "Anwar, Md Danish" <a0501179@ti.com>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<horms@kernel.org>, <corbet@lwn.net>, <gur.stavi@huawei.com>,
	<maddy@linux.ibm.com>, <mpe@ellerman.id.au>, <lee@trager.us>,
	<gongfan1@huawei.com>, <lorenzo@kernel.org>,
	<geert+renesas@glider.be>, <Parthiban.Veerasooran@microchip.com>,
	<lukas.bulwahn@redhat.com>, <alexanderduyck@fb.com>,
	<richardcochran@gmail.com>, <netdev@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/5] net: rnpgbe: Add build support for rnpgbe
Date: Wed, 13 Aug 2025 13:21:26 +0530	[thread overview]
Message-ID: <d0c2fcb1-578d-443c-949f-860c94824ac9@ti.com> (raw)
In-Reply-To: <F9D5358C994A229C+20250813064441.GB944516@nic-Precision-5820-Tower>



On 13/08/25 12:14 pm, Yibo Dong wrote:
> On Tue, Aug 12, 2025 at 09:48:07PM +0530, Anwar, Md Danish wrote:
>> On 8/12/2025 3:09 PM, Dong Yibo wrote:
>>> Add build options and doc for mucse.
>>> Initialize pci device access for MUCSE devices.
>>>
>>> Signed-off-by: Dong Yibo <dong100@mucse.com>
>>> ---
>>>  .../device_drivers/ethernet/index.rst         |   1 +
>>>  .../device_drivers/ethernet/mucse/rnpgbe.rst  |  21 +++
>>>  MAINTAINERS                                   |   8 +
>>>  drivers/net/ethernet/Kconfig                  |   1 +
>>>  drivers/net/ethernet/Makefile                 |   1 +
>>>  drivers/net/ethernet/mucse/Kconfig            |  34 ++++
>>>  drivers/net/ethernet/mucse/Makefile           |   7 +
>>>  drivers/net/ethernet/mucse/rnpgbe/Makefile    |   8 +
>>>  drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h    |  25 +++
>>>  .../net/ethernet/mucse/rnpgbe/rnpgbe_main.c   | 161 ++++++++++++++++++
>>>  10 files changed, 267 insertions(+)
>>>  create mode 100644 Documentation/networking/device_drivers/ethernet/mucse/rnpgbe.rst
>>>  create mode 100644 drivers/net/ethernet/mucse/Kconfig
>>>  create mode 100644 drivers/net/ethernet/mucse/Makefile
>>>  create mode 100644 drivers/net/ethernet/mucse/rnpgbe/Makefile
>>>  create mode 100644 drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h
>>>  create mode 100644 drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
>>
>> [ ... ]
>>
>>> + **/
>>> +static int __init rnpgbe_init_module(void)
>>> +{
>>> +	int ret;
>>> +
>>> +	ret = pci_register_driver(&rnpgbe_driver);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	return 0;
>>> +}
>>
>> Unnecessary code - can be simplified to just `return
>> pci_register_driver(&rnpgbe_driver);`
>>
> 
> Yes, but if I add some new codes which need some free after
> pci_register_driver failed, the new patch will be like this:
> 
> -return pci_register_driver(&rnpgbe_driver);
> +int ret:
> +wq = create_singlethread_workqueue(rnpgbe_driver_name);
> +ret = pci_register_driver(&rnpgbe_driver);
> +if (ret) {
> +	destroy_workqueue(wq);
> +	return ret;
> +}
> +return 0;
> 
> Is this ok? Maybe not good to delete code for adding new feature?
> This is what Andrew suggested not to do.
> 

In this patch series you are not modifying rnpgbe_init_module() again.
If you define a function as something in one patch and in later patches
you change it to something else - That is not encouraged, you should not
remove the code that you added in previous patches.

However here throughout your series you are not modifying this function.
Now the diff that you are showing, I don't know when you plan to post
that but as far as this series is concerned this diff is not part of the
series.

static int __init rnpgbe_init_module(void)
{
	int ret;

	ret = pci_register_driver(&rnpgbe_driver);
	if (ret)
		return ret;

	return 0;
}

This to me just seems unnecessary. You can just return
pci_register_driver() now and in future whenever you add other code you
can modify the function.

It would have  made sense for you to keep it as it is if some later
patch in your series would have modified it.

>>> +
>>> +module_init(rnpgbe_init_module);
>>> +
>>> +/**
>>> + * rnpgbe_exit_module - Driver remove routine
>>> + *
>>> + * rnpgbe_exit_module is called when driver is removed
>>> + **/
>>> +static void __exit rnpgbe_exit_module(void)
>>> +{
>>> +	pci_unregister_driver(&rnpgbe_driver);
>>> +}
>>> +
>>> +module_exit(rnpgbe_exit_module);
>>> +
>>> +MODULE_DEVICE_TABLE(pci, rnpgbe_pci_tbl);
>>> +MODULE_AUTHOR("Mucse Corporation, <techsupport@mucse.com>");
>>> +MODULE_DESCRIPTION("Mucse(R) 1 Gigabit PCI Express Network Driver");
>>> +MODULE_LICENSE("GPL");
>>
>> -- 
>> Thanks and Regards,
>> Md Danish Anwar
>>
>>
> 
> Thanks for your feedback.

-- 
Thanks and Regards,
Danish


  reply	other threads:[~2025-08-13  7:52 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12  9:39 [PATCH v3 0/5] Add driver for 1Gbe network chips from MUCSE Dong Yibo
2025-08-12  9:39 ` [PATCH v3 1/5] net: rnpgbe: Add build support for rnpgbe Dong Yibo
2025-08-12 15:37   ` Vadim Fedorenko
2025-08-13  6:18     ` Yibo Dong
2025-08-12 16:18   ` Anwar, Md Danish
2025-08-13  6:44     ` Yibo Dong
2025-08-13  7:51       ` MD Danish Anwar [this message]
2025-08-13  8:00         ` Yibo Dong
2025-08-12  9:39 ` [PATCH v3 2/5] net: rnpgbe: Add n500/n210 chip support Dong Yibo
2025-08-12 15:49   ` Vadim Fedorenko
2025-08-13  7:01     ` Yibo Dong
2025-08-12 16:25   ` Anwar, Md Danish
2025-08-13  7:07     ` Yibo Dong
2025-08-12  9:39 ` [PATCH v3 3/5] net: rnpgbe: Add basic mbx ops support Dong Yibo
2025-08-12 16:07   ` Vadim Fedorenko
2025-08-12 16:30   ` Anwar, Md Danish
2025-08-13  7:46     ` Yibo Dong
2025-08-14 23:55   ` Andrew Lunn
2025-08-15  1:31     ` Yibo Dong
2025-08-15  4:07       ` Andrew Lunn
2025-08-12  9:39 ` [PATCH v3 4/5] net: rnpgbe: Add basic mbx_fw support Dong Yibo
2025-08-12 16:14   ` Vadim Fedorenko
2025-08-13  8:12     ` Yibo Dong
2025-08-13  9:52     ` Yibo Dong
2025-08-13 11:05       ` Geert Uytterhoeven
2025-08-13 21:32         ` Jakub Kicinski
2025-08-13 13:33       ` Vadim Fedorenko
2025-08-14  1:53         ` Yibo Dong
2025-08-15  0:04       ` Andrew Lunn
2025-08-15  1:36         ` Yibo Dong
2025-08-13  8:20   ` MD Danish Anwar
2025-08-13  9:24     ` Yibo Dong
2025-08-12  9:39 ` [PATCH v3 5/5] net: rnpgbe: Add register_netdev Dong Yibo
2025-08-12 15:32   ` Vadim Fedorenko
2025-08-13  9:04     ` Yibo Dong
2025-08-13 12:50       ` Vadim Fedorenko
2025-08-14  1:52         ` Yibo Dong
2025-08-13  8:26   ` MD Danish Anwar
2025-08-13  9:49     ` Yibo Dong

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=d0c2fcb1-578d-443c-949f-860c94824ac9@ti.com \
    --to=danishanwar@ti.com \
    --cc=Parthiban.Veerasooran@microchip.com \
    --cc=a0501179@ti.com \
    --cc=alexanderduyck@fb.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dong100@mucse.com \
    --cc=edumazet@google.com \
    --cc=geert+renesas@glider.be \
    --cc=gongfan1@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=lukas.bulwahn@redhat.com \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    /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).