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: <20220620092459.GA37723@mutt>
Date:   Mon, 20 Jun 2022 11:24:59 +0200
From:   Anders Roxell <anders.roxell@...aro.org>
To:     Stanley Chu <stanley.chu@...iatek.com>
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        martin.petersen@...cle.com, avri.altman@....com,
        alim.akhtar@...sung.com, jejb@...ux.ibm.com, bvanassche@....org,
        peter.wang@...iatek.com, chun-hung.wu@...iatek.com,
        alice.chao@...iatek.com, powen.kao@...iatek.com,
        mason.zhang@...iatek.com, qilin.tan@...iatek.com,
        lin.gui@...iatek.com, eddie.huang@...iatek.com,
        tun-yu.yu@...iatek.com, cc.chou@...iatek.com,
        chaotian.jing@...iatek.com, jiajie.hao@...iatek.com
Subject: Re: [PATCH v5 10/11] scsi: ufs-mediatek: Support multiple VCC sources

On 2022-06-16 13:37, Stanley Chu wrote:
> Support multiple VCC source in MediaTek UFS platforms.
> 
> Two options are provided and distinguished by specific
> device tree attributes as below examples,
> 
> [Option 1: By numbering]
> mediatek,ufs-vcc-by-num;
> vcc-opt1-supply = <&mt6373_vbuck4_ufs>;
> vcc-opt2-supply = <&mt6363_vemc>;
> 
> [Option 2: By UFS version]
> mediatek,ufs-vcc-by-ver;
> vcc-ufs3-supply = <&mt6373_vbuck4_ufs>;
> 
> Signed-off-by: Alice Chao <alice.chao@...iatek.com>
> Signed-off-by: Peter Wang <peter.wang@...iatek.com>
> Signed-off-by: Stanley Chu <stanley.chu@...iatek.com>
> ---
>  drivers/ufs/host/ufs-mediatek.c | 46 ++++++++++++++++++++++++++++++++-
>  drivers/ufs/host/ufs-mediatek.h | 14 ++++++++++
>  2 files changed, 59 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index e756aba45acd..34e51c094366 100755
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
> @@ -669,6 +669,49 @@ static u32 ufs_mtk_get_ufs_hci_version(struct ufs_hba *hba)
>  	return hba->ufs_version;
>  }
>  
> +#define MAX_VCC_NAME 30
> +static int ufs_mtk_vreg_fix_vcc(struct ufs_hba *hba)
> +{
> +	struct ufs_vreg_info *info = &hba->vreg_info;
> +	struct device_node *np = hba->dev->of_node;
> +	struct device *dev = hba->dev;
> +	char vcc_name[MAX_VCC_NAME];
> +	struct arm_smccc_res res;
> +	int err, ver;
> +
> +	if (hba->vreg_info.vcc)
> +		return 0;
> +
> +	if (of_property_read_bool(np, "mediatek,ufs-vcc-by-num")) {
> +		ufs_mtk_get_vcc_num(res);
> +		if (res.a1 > UFS_VCC_NONE && res.a1 < UFS_VCC_MAX)
> +			snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);

Building this showes the following build warning/error

drivers/ufs/host/ufs-mediatek.c: In function 'ufs_mtk_vreg_fix_vcc':
drivers/ufs/host/ufs-mediatek.c:688:67: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=]
  688 |                         snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%u", res.a1);
      |                                                                  ~^   ~~~~~~
      |                                                                   |      |
      |                                                                   |      long unsigned int
      |                                                                   unsigned int
      |                                                                  %lu
cc1: all warnings being treated as errors


Cheers,
Anders

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ