From: Bart Van Assche <bvanassche@acm.org>
To: Nitin Rawat <quic_nitirawa@quicinc.com>,
mani@kernel.org, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, avri.altman@wdc.com,
ebiggers@google.com, neil.armstrong@linaro.org,
konrad.dybcio@oss.qualcomm.com
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH V2 2/3] scsi: ufs: core: Add ufshcd_dme_rmw to modify DME attributes
Date: Mon, 7 Jul 2025 14:09:30 -0700 [thread overview]
Message-ID: <39018410-4208-4ab6-bf74-7dbd32bdd10a@acm.org> (raw)
In-Reply-To: <20250707210300.561-3-quic_nitirawa@quicinc.com>
On 7/7/25 2:02 PM, Nitin Rawat wrote:
> +/**
> + * ufshcd_dme_rmw - get modify set a dme attribute
> + * @hba - per adapter instance
> + * @mask - mask to apply on read value
> + * @val - actual value to write
> + * @attr - dme attribute
> + */
> +static inline int ufshcd_dme_rmw(struct ufs_hba *hba, u32 mask,
> + u32 val, u32 attr)
> +{
> + u32 cfg = 0;
> + int err = 0;
I don't think that it is necessary to zero-initialize 'err' because the
next statement overwrites the value of 'err'.
> +
> + err = ufshcd_dme_get(hba, UIC_ARG_MIB(attr), &cfg);
> + if (err)
> + goto out;
> +
> + cfg &= ~mask;
> + cfg |= (val & mask);
> +
> + err = ufshcd_dme_set(hba, UIC_ARG_MIB(attr), cfg);
> +
> +out:
> + return err;
> +}
Since this code is not performance-critical, please move the function
definition into source file ufshcd.c.
Thanks,
Bart.
next prev parent reply other threads:[~2025-07-07 21:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 21:02 [PATCH V2 0/3] scsi: ufs: qcom: Align programming sequence as per HW spec Nitin Rawat
2025-07-07 21:02 ` [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6 Nitin Rawat
2025-07-08 7:51 ` Manivannan Sadhasivam
2025-07-08 7:53 ` Manivannan Sadhasivam
2025-07-08 16:18 ` Bart Van Assche
2025-07-14 17:25 ` Martin K. Petersen
2025-07-14 17:28 ` Bart Van Assche
2025-07-14 17:35 ` Martin K. Petersen
2025-07-07 21:02 ` [PATCH V2 2/3] scsi: ufs: core: Add ufshcd_dme_rmw to modify DME attributes Nitin Rawat
2025-07-07 21:09 ` Bart Van Assche [this message]
2025-07-08 7:59 ` Manivannan Sadhasivam
2025-07-07 21:03 ` [PATCH V2 3/3] scsi: ufs: qcom: Enable QUnipro Internal Clock Gating Nitin Rawat
2025-07-08 8:03 ` Manivannan Sadhasivam
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=39018410-4208-4ab6-bf74-7dbd32bdd10a@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=avri.altman@wdc.com \
--cc=ebiggers@google.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=neil.armstrong@linaro.org \
--cc=quic_nitirawa@quicinc.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
all inboxes | Powered by JetHome®