From: Avri Altman <Avri.Altman@wdc.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Bean Huo <beanhuo@micron.com>
Subject: RE: [PATCH v5 1/2] scsi: ufs: Probe for temperature notification support
Date: Tue, 14 Sep 2021 20:02:38 +0000 [thread overview]
Message-ID: <DM6PR04MB657572A17D9E6F8FCE3F7A69FCDA9@DM6PR04MB6575.namprd04.prod.outlook.com> (raw)
In-Reply-To: <20210914144706.GA3457579@roeck-us.net>
> > +static int ufs_read_temp_enable(struct ufs_hba *hba, u8 mask, long
> > +*val) {
> > + u32 ee_mask;
> > + int err = 0;
>
> Unnecessary initialization
Done.
>
> > +
> > + err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR,
> QUERY_ATTR_IDN_EE_CONTROL, 0, 0,
> > + &ee_mask);
> > + if (err)
> > + return err;
> > +
> > + *val = (mask & ee_mask & MASK_EE_TOO_HIGH_TEMP) || (mask &
> > + ee_mask & MASK_EE_TOO_LOW_TEMP);
> > +
> > + return 0;
> > +}
> > +
> > +static int ufs_get_temp(struct ufs_hba *hba, enum attr_idn idn, long
> > +*val) {
> > + u32 value;
> > + int err = 0;
Here as well.
> > +
> > + err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_READ_ATTR, idn,
> 0, 0, &value);
> > + if (err)
> > + return err;
> > +
> > + if (value == 0)
> > + return -ENODATA;
> > +
> > + *val = ((long)value - 80) * MILLIDEGREE_PER_DEGREE;
> > +
> > + return 0;
> > +}
> > +
> > +static int ufs_hwmon_read(struct device *dev, enum
> hwmon_sensor_types type, u32 attr, int channel,
> > + long *val)
> > +{
> > + struct ufs_hwmon_data *data = dev_get_drvdata(dev);
> > + struct ufs_hba *hba = data->hba;
> > + int err = 0;
>
> Unnecesaary initialization
Done.
>
> > +
> > + if (type != hwmon_temp)
> > + return 0;
> > +
> > + down(&hba->host_sem);
> > +
> > + if (!ufshcd_is_user_access_allowed(hba)) {
> > + up(&hba->host_sem);
> > + return -EBUSY;
> > + }
> > +
> > + ufshcd_rpm_get_sync(hba);
> > +
> > + switch (attr) {
> > + case hwmon_temp_enable:
> > + err = ufs_read_temp_enable(hba, data->mask, val);
>
> extra space before 'err ='
Done.
next prev parent reply other threads:[~2021-09-14 20:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 6:53 [PATCH v5 0/2] Add temperature notification support Avri Altman
2021-09-14 6:53 ` [PATCH v5 1/2] scsi: ufs: Probe for " Avri Altman
2021-09-14 14:47 ` Guenter Roeck
2021-09-14 20:02 ` Avri Altman [this message]
2021-09-14 6:53 ` [PATCH v5 2/2] scsi: ufs: Add temperature notification exception handling Avri Altman
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=DM6PR04MB657572A17D9E6F8FCE3F7A69FCDA9@DM6PR04MB6575.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=adrian.hunter@intel.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=martin.petersen@oracle.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).