Linux CXL
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Huaisheng Ye <huaisheng.ye@intel.com>,
	<Jonathan.Cameron@huawei.com>, <dan.j.williams@intel.com>,
	<dave.jiang@intel.com>, <ming.li@zohomail.com>
Cc: <pei.p.jia@intel.com>, <linux-cxl@vger.kernel.org>,
	Huaisheng Ye <huaisheng.ye@intel.com>
Subject: Re: [PATCH v5 1/1] cxl/core/regs: Refactor out functions to count regblocks of given type
Date: Wed, 22 Jan 2025 01:14:13 -0800	[thread overview]
Message-ID: <6790b6e5817bf_20fa2942c@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20250115152600.26482-2-huaisheng.ye@intel.com>

Some minor comments that Dave can fixup:

Huaisheng Ye wrote:
> In commit d717d7f3df18494baafd9595fb4bcb9c380d7389, cxl_count_regblock was

When referencing a commit the typical form is 

d717d7f3df18 ("cxl: Add functions to get an instance of / count regblocks of a given type")

...however in this case the commit history does not matter. Typically
commit history is useful for fixes to identify what kernels are
suspectible to the problem. In this case it is just a cleanup.

Also, for what this patch is I think the commit message can afford to be
more concise and just say:

---
cxl_find_regblock_instance() counts the number of instances of a register
block as a side effect of searching through all available register blocks.
cxl_count_regblock() throws away that work and recounts all the register
blocks by asking cxl_find_regblock_instance() to redo work it has
already done until it finally returns an error, that is needlessly wasteful.

Let cxl_count_regblock() leverage the counting that
cxl_find_regblock_instance() already does by passing in a sentinel value
(CXL_INSTANCES_COUNT) that triggers the count to be returned.
---

Otherwise, patch looks good.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

  reply	other threads:[~2025-01-22  9:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15 15:25 [PATCH v5 0/1] cxl/core/regs: Refactor out functions to count regblocks of given type Huaisheng Ye
2025-01-15 15:26 ` [PATCH v5 1/1] " Huaisheng Ye
2025-01-22  9:14   ` Dan Williams [this message]
2025-01-22 12:58     ` Ye, Huaisheng
2025-01-22 16:37     ` Dave Jiang

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=6790b6e5817bf_20fa2942c@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dave.jiang@intel.com \
    --cc=huaisheng.ye@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=pei.p.jia@intel.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