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: <6b6a0af1e55241c4b2acde42e9966e3b@ti.com>
Date: Mon, 24 Jun 2024 11:42:11 +0000
From: "Ding, Shenghao" <shenghao-ding@...com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: "broonie@...nel.org" <broonie@...nel.org>,
        "lgirdwood@...il.com"
	<lgirdwood@...il.com>,
        "perex@...ex.cz" <perex@...ex.cz>,
        "pierre-louis.bossart@...ux.intel.com"
	<pierre-louis.bossart@...ux.intel.com>,
        "13916275206@....com"
	<13916275206@....com>,
        "judyhsiao@...gle.com" <judyhsiao@...gle.com>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "Salazar, Ivan"
	<i-salazar@...com>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>,
        "Chadha, Jasjot Singh" <j-chadha@...com>,
        "liam.r.girdwood@...el.com" <liam.r.girdwood@...el.com>,
        "bard.liao@...el.com" <bard.liao@...el.com>,
        "yung-chuan.liao@...ux.intel.com" <yung-chuan.liao@...ux.intel.com>,
        "Rao,
 Dipa" <dipa@...com>, "yuhsuan@...gle.com" <yuhsuan@...gle.com>,
        "tiwai@...e.de" <tiwai@...e.de>, "Xu, Baojun" <baojun.xu@...com>,
        "soyer@....hu" <soyer@....hu>, "Baojun.Xu@....com" <Baojun.Xu@....com>,
        "Navada Kanyana, Mukund" <navada@...com>,
        "cujomalainey@...gle.com"
	<cujomalainey@...gle.com>,
        "Kutty, Aanya" <aanya@...com>,
        "Mahmud, Nayeem"
	<nayeem.mahmud@...com>
Subject: RE: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Add Calibration
 Kcontrols and tas2563 digtial gain for Chromebook

Hi Andy
Thanks for your comments. Following are my answers.

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Sent: Wednesday, May 22, 2024 8:02 PM
> To: Ding, Shenghao <shenghao-ding@...com>
> Cc: broonie@...nel.org; lgirdwood@...il.com; perex@...ex.cz; pierre-
> louis.bossart@...ux.intel.com; 13916275206@....com;
> judyhsiao@...gle.com; alsa-devel@...a-project.org; Salazar, Ivan <i-
> salazar@...com>; linux-kernel@...r.kernel.org; Chadha, Jasjot Singh <j-
> chadha@...com>; liam.r.girdwood@...el.com; bard.liao@...el.com; yung-
> chuan.liao@...ux.intel.com; Rao, Dipa <dipa@...com>; Lu, Kevin <kevin-
> lu@...com>; yuhsuan@...gle.com; tiwai@...e.de; Xu, Baojun
> <baojun.xu@...com>; soyer@....hu; Baojun.Xu@....com; Navada Kanyana,
> Mukund <navada@...com>; cujomalainey@...gle.com; Kutty, Aanya
> <aanya@...com>; Mahmud, Nayeem <nayeem.mahmud@...com>
> Subject: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Add Calibration Kcontrols
> and tas2563 digtial gain for Chromebook
> 
> On Wed, May 22, 2024 at 07: 29: 41PM +0800, Shenghao Ding wrote: >
> Calibrated data will be set to default after loading DSP config params, >
> which will cause speaker protection work abnormally. Reload calibrated >
> data after loading ZjQcmQRYFpfptBannerStart This message was sent from
> outside of Texas Instruments.
> Do not click links or open attachments unless you recognize the source of this
> email and know the content is safe. If you wish to report this message to IT
> Security, please forward the message as an attachment to
> phishing@...t.ti.com
> 
........................
> > +	while (r > 1 + l) {
> > +		mid = (l + r) / 2;
> > +		ar_mid = get_unaligned_be32(tas2563_dvc_table[mid]);
> > +		if (target < ar_mid)
> > +			r = mid;
> > +		else
> > +			l = mid;
> > +	}
> 
> Hmm... I'm wondering if bsearch() can be utilised here.
Bsearch is to find out the value, in this function is to find out the member same as or closer to the input value.

> 
> ...
> 
> > +	ucontrol->value.integer.value[0] =
> > +		abs(target - ar_l) <= abs(target - ar_r) ? l : r;
> 
> I don't understand why do you need 'target' to be in this check.
> 
> ...
> 
> > +	uinfo->value.integer.max = (int)tas_priv->ndev - 1;
> 
> Why casting?
> 
> ...
> 
> > +	scnprintf(active_dev_name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
> 
> Why 'c' variant in use? You are ignoring the returned value. Isn't strscpy() you
> want or memtostr() (in both cases 2 parameters variant)?
> 
> > +		"Activate Tasdevice Id");
> 
> Same Q to all scnprintf() calls.
> 
> ...
> 
> > +	cali_data->data = devm_kzalloc(tas_priv->dev, tas_priv->ndev *
> > +		(cali_data->reg_array_sz * 4 + 1), GFP_KERNEL);
> 
> No way. First of all, we have kcalloc(), second, there is an overflow.h that has
> necessary macros to calculate sizes for memory allocations.
Memory allocated with devm_kzalloc is automatically freed on driver detach while kcalloc can’t
> 
> > +	if (!cali_data->data)
> > +		return -ENOMEM;
> 
> ...

BR
Shenghao Ding

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ