lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DM6PR04MB657572A17D9E6F8FCE3F7A69FCDA9@DM6PR04MB6575.namprd04.prod.outlook.com>
Date:   Tue, 14 Sep 2021 20:02:38 +0000
From:   Avri Altman <Avri.Altman@....com>
To:     Guenter Roeck <linux@...ck-us.net>
CC:     "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Bart Van Assche <bvanassche@....org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Bean Huo <beanhuo@...ron.com>
Subject: RE: [PATCH v5 1/2] scsi: ufs: Probe for temperature notification
 support

> > +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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ