From: Simon Horman <horms@kernel.org>
To: tianx <tianx@yunsilicon.com>
Cc: netdev@vger.kernel.org, leon@kernel.org, andrew+netdev@lunn.ch,
kuba@kernel.org, pabeni@redhat.com, edumazet@google.com,
davem@davemloft.net, jeff.johnson@oss.qualcomm.com,
przemyslaw.kitszel@intel.com, weihg@yunsilicon.com,
wanry@yunsilicon.com
Subject: Re: [PATCH v3 02/14] net-next/yunsilicon: Enable CMDQ
Date: Fri, 17 Jan 2025 13:33:58 +0000 [thread overview]
Message-ID: <20250117133358.GN6206@kernel.org> (raw)
In-Reply-To: <0ed84d3f-9571-4bd9-831e-7aff64de3eb8@yunsilicon.com>
On Fri, Jan 17, 2025 at 11:42:22AM +0800, tianx wrote:
> On 2025/1/16 21:55, Simon Horman wrote:
> > On Wed, Jan 15, 2025 at 06:22:46PM +0800, Xin Tian wrote:
> >> Enable cmd queue to support driver-firmware communication.
> >> Hardware control will be performed through cmdq mostly.
> >>
> >> Co-developed-by: Honggang Wei <weihg@yunsilicon.com>
> >> Signed-off-by: Honggang Wei <weihg@yunsilicon.com>
> >> Co-developed-by: Lei Yan <jacky@yunsilicon.com>
> >> Signed-off-by: Lei Yan <jacky@yunsilicon.com>
> >> Signed-off-by: Xin Tian <tianx@yunsilicon.com>
> > ...
> >
> >> diff --git a/drivers/net/ethernet/yunsilicon/xsc/pci/cmdq.c b/drivers/net/ethernet/yunsilicon/xsc/pci/cmdq.c
> > ...
> >
> >> +static void cmd_work_handler(struct work_struct *work)
> >> +{
> >> + struct xsc_cmd_work_ent *ent = container_of(work, struct xsc_cmd_work_ent, work);
> >> + struct xsc_cmd *cmd = ent->cmd;
> >> + struct xsc_core_device *xdev = container_of(cmd, struct xsc_core_device, cmd);
> >> + struct xsc_cmd_layout *lay;
> >> + struct semaphore *sem;
> >> + unsigned long flags;
> > Hi Xin Tian,
> >
> > Please consider arranging local variables in reverse xmas tree order -
> > longest line to shortest - as is preferred in Networking code.
> > Separating initialisation from declarations as needed.
> >
> > And also, please consider limiting lines to 80 columns wide or less,
> > where it can be achieved without reducing readability. This is also
> > preferred in Networking code.
> >
> > I think that in this case that both could be achieved like this
> > (completely untested):
> >
> > struct xsc_cmd_work_ent *ent;
> > struct xsc_core_device *xdev;
> > struct xsc_cmd_layout *lay;
> > struct semaphore *sem;
> > struct xsc_cmd *cmd;
> > unsigned long flags;
> >
> > ent = container_of(work, struct xsc_cmd_work_ent, work);
> > cmd = ent->cmd;
> > xdev = container_of(cmd, struct xsc_core_device, cmd);
> >
> > With regards to reverse xmas tree ordering, this tool can be useful:
> > https://github.com/ecree-solarflare/xmastree
> >
> > ...
> Thank you for the tool. I will address the same issue across the entire
> patch set.
Thanks. I forgot to mention that the 80 column preference can
be tested using ./scripts/checkpatch.pl --max-line-length=80
...
next prev parent reply other threads:[~2025-01-17 13:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 10:23 [PATCH v3 00/14] net-next/yunsilicon: ADD Yunsilicon XSC Ethernet Driver Xin Tian
2025-01-15 10:22 ` [PATCH v3 01/14] net-next/yunsilicon: Add xsc driver basic framework Xin Tian
2025-01-15 15:54 ` Simon Horman
2025-01-16 7:03 ` tianx
2025-01-15 16:04 ` Simon Horman
2025-01-16 8:04 ` tianx
2025-01-16 10:53 ` Simon Horman
2025-01-15 10:22 ` [PATCH v3 02/14] net-next/yunsilicon: Enable CMDQ Xin Tian
2025-01-16 10:30 ` Przemek Kitszel
2025-02-13 2:09 ` tianx
2025-01-16 13:55 ` Simon Horman
2025-01-17 3:42 ` tianx
2025-01-17 13:33 ` Simon Horman [this message]
2025-01-15 10:22 ` [PATCH v3 03/14] net-next/yunsilicon: Add hardware setup APIs Xin Tian
2025-01-15 10:22 ` [PATCH v3 04/14] net-next/yunsilicon: Add qp and cq management Xin Tian
2025-01-17 13:45 ` Simon Horman
2025-01-15 10:22 ` [PATCH v3 05/14] net-next/yunsilicon: Add eq and alloc Xin Tian
2025-01-15 10:22 ` [PATCH v3 06/14] net-next/yunsilicon: Add pci irq Xin Tian
2025-01-15 10:22 ` [PATCH v3 07/14] net-next/yunsilicon: Init auxiliary device Xin Tian
2025-01-15 10:23 ` [PATCH v3 08/14] net-next/yunsilicon: Add ethernet interface Xin Tian
2025-01-15 10:23 ` [PATCH v3 09/14] net-next/yunsilicon: Init net device Xin Tian
2025-01-15 10:23 ` [PATCH v3 10/14] net-next/yunsilicon: Add eth needed qp and cq apis Xin Tian
2025-01-15 10:23 ` [PATCH v3 11/14] net-next/yunsilicon: ndo_open and ndo_stop Xin Tian
2025-01-15 10:23 ` [PATCH v3 12/14] net-next/yunsilicon: Add ndo_start_xmit Xin Tian
2025-01-15 10:23 ` [PATCH v3 13/14] net-next/yunsilicon: Add eth rx Xin Tian
2025-01-15 10:23 ` [PATCH v3 14/14] net-next/yunsilicon: add ndo_get_stats64 Xin Tian
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=20250117133358.GN6206@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=tianx@yunsilicon.com \
--cc=wanry@yunsilicon.com \
--cc=weihg@yunsilicon.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).