All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Junyang Han <han.junyang@zte.com.cn>, netdev@vger.kernel.org
Cc: davem@davemloft.net, andrew+netdev@lunn.ch, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, ran.ming@zte.com.cn,
	han.chengfei@zte.com.cn, zhang.yanze@zte.com.cn
Subject: Re: [PATCH net-next v2 3/3] net/ethernet/zte/dinghai: add hardware register access and PCI capability scanning
Date: Wed, 22 Apr 2026 22:54:46 +0100	[thread overview]
Message-ID: <e4e4b73c-3a0d-4245-9671-304bea0a50ca@linux.dev> (raw)
In-Reply-To: <20260422144901.2403456-4-han.junyang@zte.com.cn>

On 22.04.2026 15:49, Junyang Han wrote:
> Implement PCI configuration space access, BAR mapping, capability
> scanning (common/notify/device), and hardware queue register
> definitions for DingHai PF device.
> 
> Signed-off-by: Junyang Han <han.junyang@zte.com.cn>

[...]

> +
> +void __iomem *zxdh_pf_map_capability(struct dh_core_dev *dh_dev, int32_t off,
> +				     size_t minlen, uint32_t align,
> +				     uint32_t start, uint32_t size,
> +				     size_t *len, resource_size_t *pa,
> +				     uint32_t *bar_off)
> +{
> +	struct pci_dev *pdev = dh_dev->pdev;
> +	uint8_t bar = 0;
> +	uint32_t offset = 0;
> +	uint32_t length = 0;
> +	void __iomem *p = NULL;

Even though the changelog says that variable declaration ordering is fixed, this
patch (as some others in the series) still has the problem.

Also, please avoid using user-space fixed size types, kernel space uses short
type names, like u32/u8 etc.

Try to avoid meaningless initialization as well.

These comments apply to the whole series, not only to this single patch

> +
> +	pci_read_config_byte(pdev, off + offsetof(struct zxdh_pf_pci_cap, bar), &bar);
> +	pci_read_config_dword(pdev, off + offsetof(struct zxdh_pf_pci_cap, offset), &offset);
> +	pci_read_config_dword(pdev, off + offsetof(struct zxdh_pf_pci_cap, length), &length);
> +
> +	if (bar_off)
> +		*bar_off = offset;
> +

  reply	other threads:[~2026-04-22 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 14:48 [PATCH net-next v2 0/3] Add ZTE DingHai Ethernet PF driver Junyang Han
2026-04-22 14:48 ` [PATCH net-next v2 1/3] net/ethernet: add ZTE network driver support Junyang Han
2026-04-22 16:24   ` Andrew Lunn
2026-04-22 14:49 ` [PATCH net-next v2 2/3] net/ethernet/zte/dinghai: add logging infrastructure Junyang Han
2026-04-22 14:49 ` [PATCH net-next v2 3/3] net/ethernet/zte/dinghai: add hardware register access and PCI capability scanning Junyang Han
2026-04-22 21:54   ` Vadim Fedorenko [this message]
2026-04-22 16:19 ` [PATCH net-next v2 0/3] Add ZTE DingHai Ethernet PF driver Andrew Lunn
2026-04-24  7:26   ` han.junyang
2026-04-24  7:34   ` han.junyang

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=e4e4b73c-3a0d-4245-9671-304bea0a50ca@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=han.chengfei@zte.com.cn \
    --cc=han.junyang@zte.com.cn \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ran.ming@zte.com.cn \
    --cc=zhang.yanze@zte.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.