From patchwork Tue Nov 26 17:22:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 13886240 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 06BF11DB55D; Tue, 26 Nov 2024 17:22:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641776; cv=none; b=GKwRrInfsadnD8zeiHgTRHw9FGjTuX6nBxZ5IQs37NToeJo2mz2Mil9IgEmlCWFPPFFGwI+joaUrMZS59w1IzQ3UOKgWy9Cs311f0+GbEvqX0oLH/RoXiw+6DbCXfyGR8kOhIB3n9Rgpd8B5PdBvAmsmpDDI0aSpZQJY6+hQLAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641776; c=relaxed/simple; bh=3IQcjMblj2yCRZU9dvH09xLKCFiwJsfsSgS7pL6cJjo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HO9kecvJM126DeaI/QwhSz/pyQMTtw9KKaMTmJYRfGfjt40CUqLjcEmhbW26kYLUjYTSFw/O/PxCljyKolOVY4ypm09cr2dHC07D/8o9N8uSccuilALq8OYj/wKpRUTFrXcdyDEJ0YKRXHW8ZTBtPY5WsfZThyGJiKg338O7t1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OZEEogFQ; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OZEEogFQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732641775; x=1764177775; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3IQcjMblj2yCRZU9dvH09xLKCFiwJsfsSgS7pL6cJjo=; b=OZEEogFQtw/3zBLxbIY2C/Dvx8Ja7AAGLJUPSEkspklUZspOFtLCDVxH Q1ZLKMFx6OBf7ymPAEu2oKBdSj4B6ugvUOvO7BgxiIg2mN6AOnsuO9cbt ZnMVYLVVmKyEWEnp2x5LJKVeKFuh1eVH7I6fTVLj1g1Xc2S+c5wgt1n0h nAbjWOTPI7imivFNNCBYxifAqYyEU3QJSIfTRfCem1GM2JYTkdUtCxkGQ 9IoQJeoYtqVMBALeU9RZTLTkOQ3bGXboxWmczP4ansuY563vR4ztxBRwP o4nKXhpRjX2Es86oXu3aeIKKnZnmmGGdpFGOP5pBvprX1IAr2or0U3AUq w==; X-CSE-ConnectionGUID: ncMm/PfgS5eZGP35Swwo5Q== X-CSE-MsgGUID: pVuldOv/RuyeOYBmQaATvA== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43312924" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="43312924" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 09:22:52 -0800 X-CSE-ConnectionGUID: ILtK8wUHRVasgPR84RT3Kg== X-CSE-MsgGUID: On4ox8MWSqSP5O18pa1RJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="96730554" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 26 Nov 2024 09:22:49 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 38C8C1CAD6; Tue, 26 Nov 2024 22:52:48 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 3615B160011C; Tue, 26 Nov 2024 22:52:48 +0530 (IST) From: Raag Jadav To: gregkh@linuxfoundation.org, linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.dev Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-sound@vger.kernel.org, Raag Jadav Subject: [PATCH v2 1/6] devres: Introduce devm_kmemdup_array() Date: Tue, 26 Nov 2024 22:52:35 +0530 Message-Id: <20241126172240.6044-2-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com> References: <20241126172240.6044-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Introduce '_array' variant of devm_kmemdup() which is more robust and consistent with alloc family of helpers. Suggested-by: Andy Shevchenko Signed-off-by: Raag Jadav --- include/linux/device.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index b4bde8d22697..c2032aab1586 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -358,6 +358,11 @@ char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc; const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp); void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp) __realloc_size(3); +static inline void *devm_kmemdup_array(struct device *dev, const void *src, + size_t n, size_t size, gfp_t flags) +{ + return devm_kmemdup(dev, src, size_mul(size, n), flags); +} unsigned long devm_get_free_pages(struct device *dev, gfp_t gfp_mask, unsigned int order); From patchwork Tue Nov 26 17:22:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 13886238 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 15DEC1AC8A6; Tue, 26 Nov 2024 17:22:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641774; cv=none; b=chtUWXHjidHR7nF6ZjaWWAyiVHJHDTZW2DI3c2iHPrzMpTGYYGG0PD+K2liUyAEq9DDpDai1UqmosMvgRrHORAXIz0WJXKYlFZ+O0FJwXHsqILb21i4gaNdSCMgaS01hCjzcQ8Ax3CzBh7rE5P6xFqEv1JAS0Nvk+qSc7sShEQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641774; c=relaxed/simple; bh=6Tidakgtdfgzj7ArIO1jYC1ie3c1/PQNJd0mdhYzvBc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aGoQMnOpAehaCNxLRzvEHHnYzy1xkSR8dX+0Zw08r9KM0gdtIW8LQIJJDT4s8/plysQ/8QAbheTxcK1YAonlR15SulgR7/S6ZW05qsep2O2b75EyJFkXB9mjnjE4u7f/hW5OAx5n9EspBU6aXMYqm+iD4nPh0uLKvB/GCbeaVdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=n3lPOEly; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n3lPOEly" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732641773; x=1764177773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6Tidakgtdfgzj7ArIO1jYC1ie3c1/PQNJd0mdhYzvBc=; b=n3lPOElyiE6wLCUlNdo36XQGV0es/uSoqC+U+XwURTcPx1qbVjI3TZzZ W3RBBQGKjymNFrteTA7oQTPk777HpyHhOfVvnNMzO28tQGnjbZx1a7Npn fzznQqom1NPv4PuKzsnaZ4U4IODKbfuRqUlimGZe+EU6XUWmR4+bbfPMV I+tyS5hPv8otllRAScv77AUcjJe7WNTyXg4S3fwjP2oKo94pu5Xk2Wb7j rVmVZ/fV7iUVeYIMN7FihqVqu3JhgM5sSVR+4NQzGjXxTc1z7/GZd8GlM RztXb7w1MS/0L4LRYA7KcYjl7zOyx7Wa8w89BSlR7x86aHW0KxNWVwu4K A==; X-CSE-ConnectionGUID: GffJNyGISWq3cTudwjrI7w== X-CSE-MsgGUID: XZopSM0iQsqdT+ucQNErug== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43312937" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="43312937" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 09:22:53 -0800 X-CSE-ConnectionGUID: gIkcqG14SgyFOerpmhkkkQ== X-CSE-MsgGUID: FiJf5ZuJTju7+iTxJB69Gw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="96730555" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 26 Nov 2024 09:22:49 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 3A1FD1CADA; Tue, 26 Nov 2024 22:52:48 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 3676F160011E; Tue, 26 Nov 2024 22:52:48 +0530 (IST) From: Raag Jadav To: gregkh@linuxfoundation.org, linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.dev Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-sound@vger.kernel.org, Raag Jadav Subject: [PATCH v2 2/6] pinctrl: intel: copy communities using devm_kmemdup_array() Date: Tue, 26 Nov 2024 22:52:36 +0530 Message-Id: <20241126172240.6044-3-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com> References: <20241126172240.6044-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Copy communities using devm_kmemdup_array() instead of doing it manually. Signed-off-by: Raag Jadav --- drivers/pinctrl/intel/pinctrl-intel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 04b438f63ccb..e165bd5b5811 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1577,8 +1577,8 @@ int intel_pinctrl_probe(struct platform_device *pdev, * to the registers. */ pctrl->ncommunities = pctrl->soc->ncommunities; - pctrl->communities = devm_kcalloc(dev, pctrl->ncommunities, - sizeof(*pctrl->communities), GFP_KERNEL); + pctrl->communities = devm_kmemdup_array(dev, pctrl->soc->communities, pctrl->ncommunities, + sizeof(*pctrl->communities), GFP_KERNEL); if (!pctrl->communities) return -ENOMEM; @@ -1588,8 +1588,6 @@ int intel_pinctrl_probe(struct platform_device *pdev, u32 offset; u32 value; - *community = pctrl->soc->communities[i]; - regs = devm_platform_ioremap_resource(pdev, community->barno); if (IS_ERR(regs)) return PTR_ERR(regs); From patchwork Tue Nov 26 17:22:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 13886243 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 90A0F1DC720; Tue, 26 Nov 2024 17:22:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641778; cv=none; b=qLhACSBQ3mY7lkwm1C2MmO/HkvHSLuw9Xe2ko/sOTpHlJ8+oZ4ZsBS43uSX/x4/cHW3qJ1r3jmJ+cFpfVEU1se5UUg96oVskC20dLlnZEHiOqmK+kt8javxhm8vbMTJkRDb4kqLbKYeyFNaN69R5fEgffhao6ma2gaR+R4EoeuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641778; c=relaxed/simple; bh=9qSDs2DhXJtTEGGKgTgmjQhtxSNlD5ksC3zvH9JONfk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JxyvtoM12NFwF7n0muTdJ2YT5iTeI50LI+wRPswiINTmWhsasyb3Xa38c29Buu5Z2zTbQwAASd8XxlBRZGPIB/acWwoYEbV03m1D8GcykYLfRYfB1DKMrH2uNPiYik3E2kfEQ3Ivm9wxpUFw+deijw/GfjpdpcAK6ONocvDLaBo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dSIZi8RI; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dSIZi8RI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732641777; x=1764177777; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9qSDs2DhXJtTEGGKgTgmjQhtxSNlD5ksC3zvH9JONfk=; b=dSIZi8RIYvjgVBNgkKTkorDOvjNH1r+waM/W1YzvQJVC0mHzLCkJ6acT J8j7cjHQJk+NU+KbenA3vMIz82o9HBkeJn12IYbDtUMG6oPPjWR//9pU+ qBo3Vr6Ft9DmXhkbZGL9mT7T4VwiRHJ8xA2y3q5Y5DyOh8tjXTuQk89Bg 2n1fQkkz+A3aSFXYq6BrpPkkuzWZQcHQx8tJZ/0euAUTJvxZrUuimbAsd hVp2ZZmDgPlUDFKeKX7yPwYzT6NQ6Jgie0NVwVGpIEbN31Sy/353gRQ4E lP5N+LBhTwdsBIvpRGDQhL2A1LfUoZG3QDC9QKiV0q2jPOfyg/PfBJbGH w==; X-CSE-ConnectionGUID: DIuoBMgNTeacDM7kf3jn6w== X-CSE-MsgGUID: Hru7lU/eTLWAG5vSpoPQDQ== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43312970" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="43312970" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 09:22:56 -0800 X-CSE-ConnectionGUID: U0NSgnahTAig5s/BYIjRSQ== X-CSE-MsgGUID: 8RHzaKPXS1ylxZP+cJGspg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="96730577" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 26 Nov 2024 09:22:52 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 3E7101CADD; Tue, 26 Nov 2024 22:52:48 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 36CCD1600124; Tue, 26 Nov 2024 22:52:48 +0530 (IST) From: Raag Jadav To: gregkh@linuxfoundation.org, linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.dev Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-sound@vger.kernel.org, Raag Jadav Subject: [PATCH v2 3/6] pinctrl: tangier: use devm_kmemdup_array() Date: Tue, 26 Nov 2024 22:52:37 +0530 Message-Id: <20241126172240.6044-4-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com> References: <20241126172240.6044-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav --- drivers/pinctrl/intel/pinctrl-tangier.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-tangier.c b/drivers/pinctrl/intel/pinctrl-tangier.c index 2cb0b4758269..305547100baa 100644 --- a/drivers/pinctrl/intel/pinctrl-tangier.c +++ b/drivers/pinctrl/intel/pinctrl-tangier.c @@ -524,7 +524,6 @@ static int tng_pinctrl_probe(struct platform_device *pdev, struct device *dev = &pdev->dev; struct tng_family *families; struct tng_pinctrl *tp; - size_t families_len; void __iomem *regs; unsigned int i; @@ -543,8 +542,8 @@ static int tng_pinctrl_probe(struct platform_device *pdev, * Make a copy of the families which we can use to hold pointers * to the registers. */ - families_len = size_mul(sizeof(*families), tp->nfamilies); - families = devm_kmemdup(dev, tp->families, families_len, GFP_KERNEL); + families = devm_kmemdup_array(dev, tp->families, tp->nfamilies, + sizeof(*families), GFP_KERNEL); if (!families) return -ENOMEM; From patchwork Tue Nov 26 17:22:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 13886241 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 2E1241DC04B; Tue, 26 Nov 2024 17:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641777; cv=none; b=V1mhw7xypDQjVRaHf70awcl9zDSI+sy4ykEZ8eAndxiH9shd8zTrNAUffx1BVL+9kqyiylVJlnV0pLSAfgoBCR7hmlvUU2fFkfCNzEJPmTUk7bRzB7jntCvdvqXLqXdyKN6JdQfEANY+jehPHEUE0TyE6wCe/7NEhbQHygq3bgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641777; c=relaxed/simple; bh=UMESgxlu6dg0rI3zXwf63L7oJ9xxwpAQqZvdoZhqkuE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dF7t3qk7BFxlzmpv5y+R4e6upkwBmcCvWK8AMQSjD/UVpQgIgPEz3oAQQ+Gq+glve6YuISwOdIC5yM7Lx7fjP2qr4yljtbBTTBFk0glYlEqmCaO2Hh3d7ynog8myUp3LyCUWm41REwolQ6JtBinDY4ANaHf4X1ORURZW3/XMMPY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aiGV+7tF; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aiGV+7tF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732641777; x=1764177777; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UMESgxlu6dg0rI3zXwf63L7oJ9xxwpAQqZvdoZhqkuE=; b=aiGV+7tFu1M62WnbgPemblIu9+u/Fy6PBHvpihRJy0ex8nmewbOpp+sZ ApEYJYvdMQd8bYujh1Dt7Zw68hBCWb1OpJ7J/n//bLXeZsyPN5qredVTH QV5A15lXDYp4oq7xQjLywyb7SuD1kFY/JH5n5sHipNEM4bhNKmvpqNXoY rMtSZODAQrY0fmdaJ6BrRKkdBBaKJhL9ySEaxjcZznQ4/b/ww7N5j7kfX sQDTpgtM+48aRssB/FsyblhnauyETvKbBzEbEiUD7vCqWlV1hUJbRFjNm M2ZWpDqqON9GKGri6Hew9QVV/DtxUyhYxzk65pbBnRMd6kDn/5ZI2dSLA A==; X-CSE-ConnectionGUID: IR2mzrG1SAGGOxZuChk1iQ== X-CSE-MsgGUID: cv2Fu/E6QqCIr3JP6jJAcA== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43312951" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="43312951" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 09:22:53 -0800 X-CSE-ConnectionGUID: sEbO+bYwR7mQgRtJkql7+w== X-CSE-MsgGUID: Kg/OWGVOTYWPG7nSCrJgpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="96730559" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 26 Nov 2024 09:22:49 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 3C80C1CADC; Tue, 26 Nov 2024 22:52:48 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 378BA1600125; Tue, 26 Nov 2024 22:52:48 +0530 (IST) From: Raag Jadav To: gregkh@linuxfoundation.org, linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.dev Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-sound@vger.kernel.org, Raag Jadav Subject: [PATCH v2 4/6] pinctrl: pxa2xx: use devm_kmemdup_array() Date: Tue, 26 Nov 2024 22:52:38 +0530 Message-Id: <20241126172240.6044-5-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com> References: <20241126172240.6044-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav --- drivers/pinctrl/pxa/pinctrl-pxa2xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c index 9e34b92ff5f2..9fd7a8fb2bc4 100644 --- a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c +++ b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c @@ -281,9 +281,8 @@ static int pxa2xx_build_functions(struct pxa_pinctrl *pctl) for (df = pctl->ppins[i].functions; df->name; df++) if (!pxa2xx_find_function(pctl, df->name, functions)) (functions + pctl->nfuncs++)->name = df->name; - pctl->functions = devm_kmemdup(pctl->dev, functions, - pctl->nfuncs * sizeof(*functions), - GFP_KERNEL); + pctl->functions = devm_kmemdup_array(pctl->dev, functions, pctl->nfuncs, + sizeof(*functions), GFP_KERNEL); if (!pctl->functions) return -ENOMEM; @@ -314,7 +313,8 @@ static int pxa2xx_build_groups(struct pxa_pinctrl *pctl) pctl->ppins[j].pin.name; func = pctl->functions + i; func->ngroups = ngroups; - func->groups = devm_kmemdup(pctl->dev, gtmp, ngroups * sizeof(*gtmp), GFP_KERNEL); + func->groups = devm_kmemdup_array(pctl->dev, gtmp, ngroups, + sizeof(*gtmp), GFP_KERNEL); if (!func->groups) return -ENOMEM; } From patchwork Tue Nov 26 17:22:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 13886244 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 B3D9E1DDA1B; Tue, 26 Nov 2024 17:22:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641779; cv=none; b=Zl2sVAJVNxUcKXDo37djk6Lr/XG1JOXn9wRF/B5SoWEa7fqDlkAvbc8jnZrFPBPA2+0DPztFN6K9utqRMOv6krzVYKhTXLZ7wqo4HHd+ejOXNT/Gw1WeY4Ua0D+eCRU8y168PIp52SXix0J4WOCjNSbH6Lz0efL9n7+SASu9S6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641779; c=relaxed/simple; bh=3EIXoatjneQZ2uqGx9N3SU/Mn6t64EkwXr6y2DKjDv4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TrXZUlep3QwLXEQ5WJ2EpRzbgscy9ULd+qrWBJSF+60qj/cq8zOP8BNpUHUD5N54+CFrXAIWVitYoenVIkrc+lC17wZ/fjb62aGYJr0Xm/ToudTpNeStmC3tGpqOqFCVfjuwcwdPjtw1Vi+c8rFqhamTmH1W4ZSaHPOrKCGh7aU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NCNGWPyE; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NCNGWPyE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732641778; x=1764177778; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3EIXoatjneQZ2uqGx9N3SU/Mn6t64EkwXr6y2DKjDv4=; b=NCNGWPyEZTv8ITQaQPhYxTYKY5hNRKu891DiqXVnsmusbR1SPVBT8m+B 05n/+f1vNvqZf+L/EafRm8v3VJgyNfT/TW2NTJgxgyiED+8ksdEuNkTcz vEbhDC/8RjuxuiNs8FsNp7gT6KqbrpeXzFpwF91lTmy57Z1a9seB3sn4f Uoa9VGRB//gsJXBMEzuLbcf3t56kd74TJpzrAuLVj1UnIzWEfoC/+vi/S yXtiLEyfFzc/U1nJ9vo0pjekhz/5mRB244iSLYrv0NVNVyWWY9p73l4nE 7bSgdb5tTVrGwGJ703XRyHweHn07+b+BSgg7ibUQoA5Z4RGj+iZCDeLK5 Q==; X-CSE-ConnectionGUID: /FT7ZCVQSseb9YOTCAGFtg== X-CSE-MsgGUID: pcf5zJSsR5+4cgS1VFqk4Q== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43312976" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="43312976" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 09:22:56 -0800 X-CSE-ConnectionGUID: 0AGLVF9FTmys5JSAxrF+KQ== X-CSE-MsgGUID: I7KIcx31R+qnTqmzkYEmvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="96730579" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 26 Nov 2024 09:22:52 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 4AEF11CAE2; Tue, 26 Nov 2024 22:52:48 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 3A8061600131; Tue, 26 Nov 2024 22:52:48 +0530 (IST) From: Raag Jadav To: gregkh@linuxfoundation.org, linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.dev Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-sound@vger.kernel.org, Raag Jadav Subject: [PATCH v2 5/6] input: sparse-keymap: use devm_kmemdup_array() Date: Tue, 26 Nov 2024 22:52:39 +0530 Message-Id: <20241126172240.6044-6-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com> References: <20241126172240.6044-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav --- drivers/input/sparse-keymap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c index 25bf8be6e711..5ec3b9ebcac5 100644 --- a/drivers/input/sparse-keymap.c +++ b/drivers/input/sparse-keymap.c @@ -176,8 +176,7 @@ int sparse_keymap_setup(struct input_dev *dev, for (e = keymap; e->type != KE_END; e++) map_size++; - map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map), - GFP_KERNEL); + map = devm_kmemdup_array(&dev->dev, keymap, map_size, sizeof(*map), GFP_KERNEL); if (!map) return -ENOMEM; From patchwork Tue Nov 26 17:22:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 13886242 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 2B0EC1DC04A; Tue, 26 Nov 2024 17:22:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641777; cv=none; b=jAWXG76IP7rDtX5C0AlmXA2pZATvrwX5007cAHNFEA6+OXYwycHGmDKrlacLgIcjb30VidaTJfqAJi5tcqCRIki1VJbhSs0sl1i3YBAOBmSPhuygn7jq5YmxWzTbNqo8a8+ixTnI44p96A742EZVi6gsUIyATQBugqn5GDowd2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732641777; c=relaxed/simple; bh=g+K6g2+C+56PC91YCpejfEXqfjjG6DRnO5EU3AxJo4s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gJK+juJI8cYIVRhauqmD1s+MnCZAFWw1GzK10TstiJ5o6h8T6ul8ksE9zVCXYF+Hd0VAryPccm6t6YM4o4aVJOvQwQTIJghO38ZPrGOZ7eXbN4DqN62WOy2NfPbDb8PniWfTrFzh29wfu41/iZRf/JzqyRSnv7ZWZooLnkvw/mk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=none smtp.mailfrom=ecsmtp.iind.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Rq/rMQGf; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ecsmtp.iind.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Rq/rMQGf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732641777; x=1764177777; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g+K6g2+C+56PC91YCpejfEXqfjjG6DRnO5EU3AxJo4s=; b=Rq/rMQGf5Nev+dfJt4jLBBMqkrPliC31t7259qU5JuTuST+Jikz9GmR+ m6YKDp+fN1KNiSoKsrLpI/JfPLitp/Lx/Y49+uvZ3lKxxsa5tm+gR/4fH 5oY9ZzMlge9pt7v4qZql8ntgM6eYMKRdp1lWZogWBOF2axQfPYk95o7v6 if3+ixaR4ZJOU2Hf98O266eo1+qJ+4lxsz5gsf+SfVQPR+ZawxzxIb+hK 7VLYDIECHg+TmKqpCXr0bZIOSv7smulncuf9Ro+4GtDTPzZRY/kHJmzw2 oNagQKLLl24k49sim/4fA5hWQzJL1vZ2Wlf4eqS3aDVn0LWo2bJCElyPn w==; X-CSE-ConnectionGUID: H3daPEiCQv6qzyo5YBYAUw== X-CSE-MsgGUID: xiOjqys2QOeATaRdtwdauw== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43312953" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="43312953" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 09:22:53 -0800 X-CSE-ConnectionGUID: LAsf38AWTz6XoAszamDHIg== X-CSE-MsgGUID: h6l7CKbzSTm6khIu2tgLlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="96730562" Received: from inesxmail01.iind.intel.com ([10.223.57.40]) by orviesa003.jf.intel.com with ESMTP; 26 Nov 2024 09:22:49 -0800 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 3E7A51CAE1; Tue, 26 Nov 2024 22:52:48 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 3D7CE160011B; Tue, 26 Nov 2024 22:52:48 +0530 (IST) From: Raag Jadav To: gregkh@linuxfoundation.org, linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.dev Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-sound@vger.kernel.org, Raag Jadav Subject: [PATCH v2 6/6] ASoC: Intel: avs: use devm_kmemdup_array() Date: Tue, 26 Nov 2024 22:52:40 +0530 Message-Id: <20241126172240.6044-7-raag.jadav@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com> References: <20241126172240.6044-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav Acked-by: Mark Brown --- sound/soc/intel/avs/boards/da7219.c | 3 ++- sound/soc/intel/avs/boards/es8336.c | 3 ++- sound/soc/intel/avs/boards/nau8825.c | 3 ++- sound/soc/intel/avs/boards/rt274.c | 3 ++- sound/soc/intel/avs/boards/rt286.c | 3 ++- sound/soc/intel/avs/boards/rt298.c | 3 ++- sound/soc/intel/avs/boards/rt5663.c | 3 ++- sound/soc/intel/avs/boards/rt5682.c | 2 +- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/sound/soc/intel/avs/boards/da7219.c b/sound/soc/intel/avs/boards/da7219.c index 80c0a1a95654..1b8f58b611a4 100644 --- a/sound/soc/intel/avs/boards/da7219.c +++ b/sound/soc/intel/avs/boards/da7219.c @@ -113,7 +113,8 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime) } num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/es8336.c b/sound/soc/intel/avs/boards/es8336.c index c8522e2430f8..8103e539e08a 100644 --- a/sound/soc/intel/avs/boards/es8336.c +++ b/sound/soc/intel/avs/boards/es8336.c @@ -109,7 +109,8 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime) data = snd_soc_card_get_drvdata(card); num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/nau8825.c b/sound/soc/intel/avs/boards/nau8825.c index 6ea9058fdb2a..0945a539b364 100644 --- a/sound/soc/intel/avs/boards/nau8825.c +++ b/sound/soc/intel/avs/boards/nau8825.c @@ -88,7 +88,8 @@ static int avs_nau8825_codec_init(struct snd_soc_pcm_runtime *runtime) jack = snd_soc_card_get_drvdata(card); num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/rt274.c b/sound/soc/intel/avs/boards/rt274.c index 9fcce86c6eb4..bdf36c7c744a 100644 --- a/sound/soc/intel/avs/boards/rt274.c +++ b/sound/soc/intel/avs/boards/rt274.c @@ -98,7 +98,8 @@ static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime) jack = snd_soc_card_get_drvdata(card); num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/rt286.c b/sound/soc/intel/avs/boards/rt286.c index f157f2d19efb..f94382389430 100644 --- a/sound/soc/intel/avs/boards/rt286.c +++ b/sound/soc/intel/avs/boards/rt286.c @@ -59,7 +59,8 @@ static int avs_rt286_codec_init(struct snd_soc_pcm_runtime *runtime) jack = snd_soc_card_get_drvdata(card); num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/rt298.c b/sound/soc/intel/avs/boards/rt298.c index 1e85242c8dd2..985bfa977edb 100644 --- a/sound/soc/intel/avs/boards/rt298.c +++ b/sound/soc/intel/avs/boards/rt298.c @@ -70,7 +70,8 @@ static int avs_rt298_codec_init(struct snd_soc_pcm_runtime *runtime) jack = snd_soc_card_get_drvdata(card); num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/rt5663.c b/sound/soc/intel/avs/boards/rt5663.c index 44f857e90969..fd8b0c915efa 100644 --- a/sound/soc/intel/avs/boards/rt5663.c +++ b/sound/soc/intel/avs/boards/rt5663.c @@ -65,7 +65,8 @@ static int avs_rt5663_codec_init(struct snd_soc_pcm_runtime *runtime) jack = &priv->jack; num_pins = ARRAY_SIZE(card_headset_pins); - pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_headset_pins, num_pins, + sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM; diff --git a/sound/soc/intel/avs/boards/rt5682.c b/sound/soc/intel/avs/boards/rt5682.c index 0dcc6392a0cc..6d7022707ca7 100644 --- a/sound/soc/intel/avs/boards/rt5682.c +++ b/sound/soc/intel/avs/boards/rt5682.c @@ -102,7 +102,7 @@ static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime) jack = snd_soc_card_get_drvdata(card); num_pins = ARRAY_SIZE(card_jack_pins); - pins = devm_kmemdup(card->dev, card_jack_pins, sizeof(*pins) * num_pins, GFP_KERNEL); + pins = devm_kmemdup_array(card->dev, card_jack_pins, num_pins, sizeof(*pins), GFP_KERNEL); if (!pins) return -ENOMEM;