From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C857213FFC for ; Fri, 9 Aug 2024 14:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723214205; cv=none; b=PYc8Fl9j9olijQllzgbtqV7ArCYfEAq3yfEBWG4ehIDCcuO6DhEL8lWiibg88FwWn8xzLJWnHLg8X2TW/6BsumBs9YezM9ETEtz/7JVJWkieqiArDZuP0EtJppEvgwDssCo2xM3deeWvpd4xLxZUUg5Y+CFhlkyWTu4OJwfoUks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723214205; c=relaxed/simple; bh=jfeOKs/97i1MZB9mZgQc/1uRPFTjG8+Gzz1wmjHvPLc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q1wwnS8wAvGPS1S4SRbAndPSkFf4sNXMmCjcCdBhuEQ+chpho1CqZgZvBZVO5a48h+uMkLyiWn0XzsXg8JGDqqoCTopbdYx2LdLMey4IvPQkN2e8fWlQY0MgVDkeBYtAaCrdbeB0zAxRn5f5n1Om5Xc5Turzlcgw57aLhp93NTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=lIsAtwFG; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lIsAtwFG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723214204; x=1754750204; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=jfeOKs/97i1MZB9mZgQc/1uRPFTjG8+Gzz1wmjHvPLc=; b=lIsAtwFGP2uekuE/+mH9zGZ32n08VlM8EENVTYVA9I2HgPs801mog1to 5t3iXOa1ZttRDoEnKvHvtWI2zWRZrDu7veHPgCs40iO2Lb5C0ACQEq0vO ozmvg0ol5psNA87aylNJ8apP+EAAOzLOW7XP1IoGoKFNjIL9NNPhWl1dm NtP6ED5+iBp6AV7k1kr7GmZoHnNVg7QBzUTlBMJtk6HRLxoJk0S09ntFc XXK1ae4IieQkyslC3QVaX76qbEyjuUh31dMzki+5O3EfxFh02WYzVc1+V nBdG29ikb28O4KeDw+10IWkWOUwfThXuL/hTbEzb0SaYMjR8hDiEs6UNc A==; X-CSE-ConnectionGUID: 4I9OQmDYQfaTEjiayV2aFg== X-CSE-MsgGUID: a4miK6WRQrqa1NcUgr8tHw== X-IronPort-AV: E=McAfee;i="6700,10204,11159"; a="21532041" X-IronPort-AV: E=Sophos;i="6.09,276,1716274800"; d="scan'208";a="21532041" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2024 07:36:43 -0700 X-CSE-ConnectionGUID: W/40TGxYRI6DXUcx3PHw2g== X-CSE-MsgGUID: 6RIEOof2RXGhCJWAdN5VlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,276,1716274800"; d="scan'208";a="57228455" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2024 07:36:38 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98) (envelope-from ) id 1scQjK-0000000DRau-1e7G; Fri, 09 Aug 2024 17:36:34 +0300 Date: Fri, 9 Aug 2024 17:36:34 +0300 From: Andy Shevchenko To: "Ding, Shenghao" Cc: "broonie@kernel.org" , "lgirdwood@gmail.com" , "perex@perex.cz" , "pierre-louis.bossart@linux.intel.com" , "13916275206@139.com" <13916275206@139.com>, "judyhsiao@google.com" , "alsa-devel@alsa-project.org" , "Salazar, Ivan" , "linux-kernel@vger.kernel.org" , "Chadha, Jasjot Singh" , "liam.r.girdwood@intel.com" , "bard.liao@intel.com" , "yung-chuan.liao@linux.intel.com" , "Rao, Dipa" , "yuhsuan@google.com" , "tiwai@suse.de" , "Xu, Baojun" , "soyer@irl.hu" , "Baojun.Xu@fpt.com" , "Navada Kanyana, Mukund" , "cujomalainey@google.com" , "Kutty, Aanya" , "Mahmud, Nayeem" Subject: Re: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Add Calibration Kcontrols and tas2563 digtial gain for Chromebook Message-ID: References: <20240522112942.994-1-shenghao-ding@ti.com> <6b6a0af1e55241c4b2acde42e9966e3b@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6b6a0af1e55241c4b2acde42e9966e3b@ti.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Jun 24, 2024 at 11:42:11AM +0000, Ding, Shenghao wrote: > > From: Andy Shevchenko > > Sent: Wednesday, May 22, 2024 8:02 PM > > To: Ding, Shenghao > > On Wed, May 22, 2024 at 07: 29: 41PM +0800, Shenghao Ding wrote: > (some comments were not answered, are you agree on all of the points?) ... > > > + 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 Yes, we have devm variant for kcalloc(), why can it be not utilised? > > > + if (!cali_data->data) > > > + return -ENOMEM; -- With Best Regards, Andy Shevchenko