Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Wang Jianzheng <wangjianzheng@vivo.com>,
	Jens Axboe <axboe@kernel.dk>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Peter Wang <peter.wang@mediatek.com>,
	Bean Huo <beanhuo@micron.com>,
	"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 3/3] scsi: ufs: core: Add support for frequency PM QoS tuning
Date: Mon, 15 Sep 2025 14:20:09 -0700	[thread overview]
Message-ID: <dd78b859-5f1b-499c-9578-03b8a18418cc@acm.org> (raw)
In-Reply-To: <20250914114549.650671-4-wangjianzheng@vivo.com>

On 9/14/25 4:45 AM, Wang Jianzheng wrote:
> +	if (!shost)
> +		return;

Please remove the above if-statement and make sure that the
initialization order guarantees that hba->host is set before
ufshcd_pm_qos_freq_read_value() can be called.

> +	shost_for_each_device(sdev, shost) {

Why a loop over all logical units? Isn't it sufficient to check the
WLUN?

> +		if (!sdev)
> +			continue;
> +
> +		q = sdev->request_queue;
> +		if (IS_ERR_OR_NULL(q))
> +			continue;
> +
> +		if (q->disk && !IS_ERR_OR_NULL(q->dev)) {

The above three if-statements are not necessary. Please remove these
three if-statements to improve code clarity.

Thanks,

Bart.

  reply	other threads:[~2025-09-15 21:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-14 11:45 [PATCH 0/3] block: device frequency PM QoS tuning Wang Jianzheng
2025-09-14 11:45 ` [PATCH 1/3] block/genhd: add sysfs knobs for the device frequency PM QoS Wang Jianzheng
2025-09-15 21:15   ` Bart Van Assche
2025-09-14 11:45 ` [PATCH 2/3] block: add support for device frequency PM QoS tuning Wang Jianzheng
2025-09-15 21:26   ` Bart Van Assche
2025-09-14 11:45 ` [PATCH 3/3] scsi: ufs: core: Add support for " Wang Jianzheng
2025-09-15 21:20   ` Bart Van Assche [this message]
2025-09-15 21:13 ` [PATCH 0/3] block: device " Bart Van Assche

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=dd78b859-5f1b-499c-9578-03b8a18418cc@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=wangjianzheng@vivo.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