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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140911074249.GW6600@mwanda>
Date:	Thu, 11 Sep 2014 10:42:49 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	micky_ching@...lsil.com.cn
Cc:	sameo@...ux.intel.com, lee.jones@...aro.org,
	gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
	wei_wang@...lsil.com.cn, rogerable@...ltek.com,
	devel@...uxdriverproject.org
Subject: Re: [PATCH 1/2] mfd: rtsx: fix PM suspend for 5227

On Thu, Sep 11, 2014 at 03:17:52PM +0800, micky_ching@...lsil.com.cn wrote:
> +	/* reset PM_CTRL3 before send buffer cmd */
> +	err = rtsx_pci_write_register(pcr, PM_CTRL3, 0x10, 0x00);
> +	if (err < 0)
> +		return err;
> +
> +	return err;

Just do:
	return rtsx_pci_write_register(pcr, PM_CTRL3, 0x10, 0x00);

> +}
> +
>  static int rts5227_optimize_phy(struct rtsx_pcr *pcr)
>  {
> +	int err;
> +
> +	err = rts5227_pm_reset(pcr);
> +	if (err < 0)
> +		return err;
> +
>  	/* Optimize RX sensitivity */
>  	return rtsx_pci_write_phy_register(pcr, 0x00, 0xBA42);
>  }
> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
> index 74346d5..037fbc5 100644
> --- a/include/linux/mfd/rtsx_pci.h
> +++ b/include/linux/mfd/rtsx_pci.h
> @@ -967,4 +967,17 @@ static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr)
>  	return (u8 *)(pcr->host_cmds_ptr);
>  }
> 
> +static inline int rtsx_pci_update_cfg_byte(struct rtsx_pcr *pcr, int addr,
> +		u8 mask, u8 append)
> +{
> +	int err;
> +	u8 val;
> +
> +	err = pci_read_config_byte(pcr->pci, addr, &val);
> +	if (err)
> +		return err;

Some of these check for "if (err) " and some check for "if (err < 0) ".
What is the significance of that?  I'm a newbie here.  Did you mean for
them to be different?


> +	err = pci_write_config_byte(pcr->pci, addr, (val & mask) | append);
> +	return err;

	return pci_write_config_byte(pcr->pci, addr, (val & mask) | append);

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ