From patchwork Fri Nov 1 08:08:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13858889 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 DA3AA156661; Fri, 1 Nov 2024 08:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448735; cv=none; b=QEUx4fW63RfbqLNkbstEx06KiJMOZZhec1E9g3mZVzFRFvznCMvLgYYspnC/YQ3TapL0jjL7SA1DX87AskFoogX0hOkbiErlzNF+trl9dGqrvVYfI3whhKB8Zjgwr41a8yENKMfBVUY/MiIe53YgRSQ3EVGOrAUGu+Ks2A4/8zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448735; c=relaxed/simple; bh=zb/4/bFX10GCalAWVbRwK1NHWuKv704m0q1ZHqlV4MM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YN85nhLZDuywM0ZATxfI9lIszTb9N+vUdlEM2k93xXPiyN7T5GzWTEJdb3N9P+3W28jVE4f6hI527t9/CuxuXb8oTaCvvIhdzFTCkywH+zLnJ+YwCdKarEQ7+Q8M3UpJzj3srSpwnB97rSoYDVSgvUdTXNn9SWyS9ryJpj59a3A= 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=A1EPJMqw; arc=none smtp.client-ip=192.198.163.8 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="A1EPJMqw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730448734; x=1761984734; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zb/4/bFX10GCalAWVbRwK1NHWuKv704m0q1ZHqlV4MM=; b=A1EPJMqwwKUccZ8wAiINgHQ9EwUvAXON8TpHieWxeHaDBuOFOu3qOTvq 7NO77o8zQoW9SQ7FYLjt/yHCEyg45M/8YtlJFCcrQ1xhLpoJnoRqS5/q+ +VcuCwc2rveyZ4Wy6eYn5AlSEmi5TFB3hDpe7x/634DzMBqR8vtfqp4Uz SQrPFx5ep4xOcC3dqwpUVwnl1xfNdrMFWxBQ0z6HuwxGJs7b2d7LerLHn 51G3YeuQvPAn3AowC4ZMfs3omrMmn9OWmwTv+8u9XN0ULUuBBF4Tauzqn 6xTdFo4Hw7eNaS2hvP2zjcznvtgQSO7JnplUR9qSvzfNqbkDpeZG/g/6r g==; X-CSE-ConnectionGUID: ix3muR/HSTOUvXb74byJxw== X-CSE-MsgGUID: N1d7PKDLQHGKsIWrgbfNig== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="47698432" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="47698432" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 01:12:11 -0700 X-CSE-ConnectionGUID: BjMOWp+XTr27ON0JFU63ew== X-CSE-MsgGUID: bkxN9cATQKWm1iQKsiMYKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="87712822" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa005.jf.intel.com with ESMTP; 01 Nov 2024 01:12:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 01C8B1AC; Fri, 01 Nov 2024 10:12:07 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Dan Carpenter Subject: [PATCH v2 1/4] iio: light: ltr501: Assing ddata to NULL Date: Fri, 1 Nov 2024 10:08:26 +0200 Message-ID: <20241101081203.3360421-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> References: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When iio_get_acpi_device_name_and_data() fails, the ddata may be left uninitialised. Initialise it to NULL. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/54fac4a7-b601-40ce-8c00-d94807f5e214@stanley.mountain Fixes: 61da460b813d ("iio: light: ltr501: Replace a variant of iio_get_acpi_device_name_and_data()") Signed-off-by: Andy Shevchenko --- drivers/iio/light/ltr501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 7228611d4c59..616dc6921702 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1424,8 +1424,8 @@ static int ltr501_probe(struct i2c_client *client) struct ltr501_data *data; struct iio_dev *indio_dev; struct regmap *regmap; + const void *ddata = NULL; int partid, chip_idx; - const void *ddata; const char *name; int ret; From patchwork Fri Nov 1 08:08:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13858887 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 DA4F0150994; Fri, 1 Nov 2024 08:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448733; cv=none; b=YMV+HIj10Gev2BgvKW+MiuDj4d4SAzDe6ScQ9NtrHb+Pm3CZmbJfz5AVziyUnYzGGsPWEweJuncOJzdcbiO2y0eQoFdkqTe7jciIDpcAUXULMGWjNgqNgxIR3r75jKDM1kqAbcCoocPCKGBmG8QoXxU+Iciup0vLDOOBiHYouwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448733; c=relaxed/simple; bh=dju4LAP4QTdsPDNP1GHQ1R4Awpczpb0FwVCmmtIPoE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=klZaewxWQSn3RE4dBVdqx7TrqrHytZ0JyMpoy/Y4+E9UZcvMh4X8hiJUHVD3y0dsG5We2CyZhRn9+IVwSTEcTEXc+YSQ9k6ldF6mWuxeqFiC/J9dBcoGJDM0ox/2eoT2iLUWO/mBkQquK/vf2jHtBaNHwF7aUgPpdPQlEa27bos= 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=ShzGbSbj; arc=none smtp.client-ip=192.198.163.8 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="ShzGbSbj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730448732; x=1761984732; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dju4LAP4QTdsPDNP1GHQ1R4Awpczpb0FwVCmmtIPoE0=; b=ShzGbSbjMCnIzM6m2lSioax1szVojB1DQH6IjPdaHhLHaNZDNu7uXW8A zDgvnnDrCS0/AQq8W4OxiKyzDbV7TC0EwjnZRPQy9W/k4/yFrlKUyFQ7R Q9LbKKdvc+iTbCoJ5+uHwABM3P1hnYuwQcGHk14KP+JyaUrySan5ckiOi uvjuau/dSvnoEOfjzKFf2j0J7FAOhUttXSLJXBhJpGHmP3XqqORw89ZEp KinbRw0h1f237cvb6wErthkYWvyJNT/JmgDk4WXcR0mcKJELSU1NTmYAR SMCrqpy+IsxjZRqAztFtyM0ZCgjok/HccOUzNoFS8xFnkVy3zrJKBAl2c w==; X-CSE-ConnectionGUID: gxe9z1T/QrGtK9DUzrPInA== X-CSE-MsgGUID: GFSAnR0aRFqzeTLncYGUaA== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="47698425" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="47698425" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 01:12:11 -0700 X-CSE-ConnectionGUID: dy0lpUUeRM2xIfZV7ikaPg== X-CSE-MsgGUID: 1LK6GdKmQpS6MexyDHNopw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="87712820" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa005.jf.intel.com with ESMTP; 01 Nov 2024 01:12:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 14836357; Fri, 01 Nov 2024 10:12:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Dan Carpenter Subject: [PATCH v2 2/4] iio: light: isl29018: Assing ddata to NULL Date: Fri, 1 Nov 2024 10:08:27 +0200 Message-ID: <20241101081203.3360421-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> References: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When iio_get_acpi_device_name_and_data() fails, the ddata may be left uninitialised. Initialise it to NULL. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/54fac4a7-b601-40ce-8c00-d94807f5e214@stanley.mountain Fixes: 14686836fb69 ("iio: light: isl29018: Replace a variant of iio_get_acpi_device_name_and_data()") Signed-off-by: Andy Shevchenko --- drivers/iio/light/isl29018.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index cbe34026bda6..201eae1c4589 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -703,7 +703,7 @@ static int isl29018_probe(struct i2c_client *client) const struct i2c_device_id *id = i2c_client_get_device_id(client); struct isl29018_chip *chip; struct iio_dev *indio_dev; - const void *ddata; + const void *ddata = NULL; const char *name; int dev_id; int err; From patchwork Fri Nov 1 08:08:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13858888 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 7E4C015531A; Fri, 1 Nov 2024 08:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448735; cv=none; b=etiXtUG+gf9QhM7RGvc1u8V0Mz9njf/PQdh4MugqqbElD2V2rn8zjePDR/acetPBXi/qyRcFTBeulqD03sD04IL4WIWAHlwIixX7+YuKvXWZ1hOiwsdfooP5/2acoERgtm1gtKfyX/8N3vEGqjpzuqcvmRSlw9kBI6TShiVEvAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448735; c=relaxed/simple; bh=SUeyM5D/YyQIEWJIw/juo3qb1rym0zBMgsApAOnHHbU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jcHZOU/MqsWQBGdkZtJrSViiLNMIss7qPTbmJ5LY9sZu3dSgWPfbr7rfYcXrFCJ2iUWYELCe2r2LejPXHJ9MaIP+qWZNo1IhrGqhWbpcqjX3+vsNACqU0pP5/r5MGWhKto6dpj9xg6ObQcAa195dxdyfBOp6suWXFdI78ms6hdo= 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=W3VsPmuW; arc=none smtp.client-ip=192.198.163.7 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="W3VsPmuW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730448734; x=1761984734; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SUeyM5D/YyQIEWJIw/juo3qb1rym0zBMgsApAOnHHbU=; b=W3VsPmuWqGgEbS/iStpZPfooBRtQx6ApjzrHlJBuED87AZkV40cbDDrZ h8iwLpXvWk5DsyBL5LpOowd3cCiajYrt4bJ57/HVCLoM7ptgYFEGGeMb7 Hjcze5lJ/bGbRuXYkH0XGl+3EouXiJmfclXvWkvy1XN9Na4kAV+cQ0z+b dUmCENOoXinNkckH2A4BepWsypoaEEqMxPKAd+7VOFg5HjOOw3b+87RKE iMXRlXjSOldjib8c93bW+LGmGS4TGJPYBFN8p3HEOBY+D7QFiSfJIw9/Z TwYGTnNkmcC9hlKOS2ZvMlFnELwyCEltStSNK2h8AqJOvXJKD2E3DepcC w==; X-CSE-ConnectionGUID: IVX2E3jTTxSHNpB1HixJeA== X-CSE-MsgGUID: AWHWeCvqRAWmlObIBPbdPQ== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="55614556" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="55614556" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 01:12:11 -0700 X-CSE-ConnectionGUID: Iak95K5OQ+Wne+YiwQuTyA== X-CSE-MsgGUID: G5HaMvVzQZ6qDSBIG8z6NQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="106234620" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa002.fm.intel.com with ESMTP; 01 Nov 2024 01:12:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1DEB92D3; Fri, 01 Nov 2024 10:12:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v2 3/4] iio: accel: kxcjk-1013: Assing ddata to NULL instead of NULL check Date: Fri, 1 Nov 2024 10:08:28 +0200 Message-ID: <20241101081203.3360421-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> References: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When iio_get_acpi_device_name_and_data() fails, the ddata may be left uninitialised. Initialise it to NULL and drop unneeded NULL check in kxcjk1013_probe() Signed-off-by: Andy Shevchenko --- drivers/iio/accel/kxcjk-1013.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 28ed0e09d099..753ec2f71a9a 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1462,7 +1462,7 @@ static int kxcjk1013_probe(struct i2c_client *client) struct kxcjk1013_data *data; struct iio_dev *indio_dev; struct kxcjk_1013_platform_data *pdata; - const void *ddata; + const void *ddata = NULL; const char *name; int ret; @@ -1507,8 +1507,7 @@ static int kxcjk1013_probe(struct i2c_client *client) data->info = (const struct kx_chipset_info *)(id->driver_data); } else { name = iio_get_acpi_device_name_and_data(&client->dev, &ddata); - if (name) - data->info = ddata; + data->info = ddata; if (data->info == &kxcj91008_kiox010a_info) indio_dev->label = "accel-display"; else if (data->info == &kxcj91008_kiox020a_info) From patchwork Fri Nov 1 08:08:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13858890 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 4F60815697A; Fri, 1 Nov 2024 08:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448736; cv=none; b=av7cp4XkuEjhn3u8xCz6RYQUllAlEDHiCElHkbNhMtmi5HtvHQuVIRRTxfkg/8aEc3oVp/91hFAoZSLq6BoErrxk9GbKZRuPWGivik+p0tdF7+D0QQXuFA2ne22GU16rk1l4I6cIkGEwt8YmE+UXgYLpN59xel7CezZDmGUhT+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730448736; c=relaxed/simple; bh=fBv79w3eKoOjs9m//MWJ8cMaBmRaNg6AHgoFuopBHP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KZ83pobfCdboGizEOGTEXuycSqEkMk0SqE86MZNQ+zRE+jXaIBXQzIYxe84QqYkM2ikPoC+gffpprSktx6TUQNc+M/Q5kWF675xPKsJzfbklKG2uf228l/hNAoxEb/wCA27kY1BQvijZ+0oMi0CNMb5xPsqHRKYxfLCdWp38XyU= 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=cQSIudXM; arc=none smtp.client-ip=192.198.163.8 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="cQSIudXM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730448734; x=1761984734; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fBv79w3eKoOjs9m//MWJ8cMaBmRaNg6AHgoFuopBHP4=; b=cQSIudXMxfMYr+IWber6IRHgukCG1NJNwmU8QTlpCyJfGlBwOuLX2kYS xrasQdH9/kAjIUtmB8188nzXUS9Z8R+SjYE7ZmchsYdi5hOb0xw+/d7yz O7xya6TkuwaLWWDTT7veQQizGO+iuvMWp0f3a1nKAatfXvNpv0xT2BiHT J6CkXs9x9LHMUoAjCXNGG+cJkSZUYHG1uKGBLAE/9Wudc8fsRtGIUdorF 8fVxwoYDgEFFEaG60osSuqnChVphelRK4zYh49QtdbRiq0pEEuj43DgdB 2xvoIJxU71zapjweWVF9Goj6/AeiKFuSy5GVtJ5Ovuh9GJvzf6nbk14Yy Q==; X-CSE-ConnectionGUID: z9p8vRgDSaeQJj37F/2dRw== X-CSE-MsgGUID: cJMJjyNrRRyLAhlh5kVbJQ== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="47698435" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="47698435" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 01:12:11 -0700 X-CSE-ConnectionGUID: Y4Bg4QaqRqu2v99qxk7ofA== X-CSE-MsgGUID: KZL/9SQSSvaeFF9OXYJRsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="87712824" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa005.jf.intel.com with ESMTP; 01 Nov 2024 01:12:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3113944B; Fri, 01 Nov 2024 10:12:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v2 4/4] iio: accel: kxcjk-1013: Deduplicate ODR startup time array Date: Fri, 1 Nov 2024 10:08:29 +0200 Message-ID: <20241101081203.3360421-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> References: <20241101081203.3360421-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The content of kxcj91008_odr_start_up_times and kxcjk1013_odr_start_up_times is identical, deduplicate it. Signed-off-by: Andy Shevchenko --- drivers/iio/accel/kxcjk-1013.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 753ec2f71a9a..f65fde06f2c1 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -193,23 +193,6 @@ static const struct kx_odr_start_up_time kxcjk1013_odr_start_up_times[] = { { } }; -/* KXCJ9-1008 */ -static const struct kx_odr_start_up_time kxcj91008_odr_start_up_times[] = { - { 0x08, 100000 }, - { 0x09, 100000 }, - { 0x0A, 100000 }, - { 0x0B, 100000 }, - { 0x00, 80000 }, - { 0x01, 41000 }, - { 0x02, 21000 }, - { 0x03, 11000 }, - { 0x04, 6400 }, - { 0x05, 3900 }, - { 0x06, 2700 }, - { 0x07, 2100 }, - { } -}; - /* KXCTJ2-1009 */ static const struct kx_odr_start_up_time kxtj21009_odr_start_up_times[] = { { 0x08, 1240000 }, @@ -325,24 +308,24 @@ static const struct kx_chipset_info kxcjk1013_info = { static const struct kx_chipset_info kxcj91008_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), }; static const struct kx_chipset_info kxcj91008_kiox010a_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type = ACPI_KIOX010A, }; static const struct kx_chipset_info kxcj91008_kiox020a_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type = ACPI_GENERIC, }; static const struct kx_chipset_info kxcj91008_smo8500_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type = ACPI_SMO8500, };