From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9AB87352FCA; Tue, 26 Aug 2025 13:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216713; cv=none; b=Po/oFUttSBWwJiB8bXz4pr0UES75a81B0uEy39JohEF+ptGL02y7rK/GKYBRGJGC0MtzipWvUql0C3gvdDKxKn8k2VNtVLKMhmcvEr4iPFnXHxUEF3UNb1szNdoUGrlqPL8yfU+XrLOIt20TEPGmEDJO+Bu9y7PBOS+QCZaujUE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216713; c=relaxed/simple; bh=ejCqwMqsuenr8JjJnrCYFCEchmhYY2c/x2eR05YvK4g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i3sYvlNI3WdMBpWML/DL9kgSMfJpIdBB/a+lDmfD3RpGULRXIBYKr65ytryqZYZwHg2loRaK/4eivjq249kwOMnB6RRv0OWxVV5sEf3FI8a+BO4c/8JA7gE527oDXU2DW8COLny3L8M0YKenrel578bwN+AIXRNCQN91hz/hUWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1EGyi24M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1EGyi24M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2491AC4CEF1; Tue, 26 Aug 2025 13:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216713; bh=ejCqwMqsuenr8JjJnrCYFCEchmhYY2c/x2eR05YvK4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1EGyi24MOsVSHu0YCilTFb5zKzp3BrWN2HKq9yrTkPFAn5PI2wfapCyTZE6v54wR7 K/BUFU6LO7Q+JtNV5tvoRaZAIMUMqMI5gPApt+ds1pFEX7uK/ofCNcR+SmckS1cs0k Q1ol2mhXQVXP2UlcUBhlzB2jZwSvYXZyhFYGoQxc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhang Lixu , Srinivas Pandruvada , Jonathan Cameron , Sasha Levin Subject: [PATCH 5.15 516/644] iio: hid-sensor-prox: Fix incorrect OFFSET calculation Date: Tue, 26 Aug 2025 13:10:07 +0200 Message-ID: <20250826110959.294198113@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhang Lixu [ Upstream commit 79dabbd505210e41c88060806c92c052496dd61c ] The OFFSET calculation in the prox_read_raw() was incorrectly using the unit exponent, which is intended for SCALE calculations. Remove the incorrect OFFSET calculation and set it to a fixed value of 0. Cc: stable@vger.kernel.org Fixes: 39a3a0138f61 ("iio: hid-sensors: Added Proximity Sensor Driver") Signed-off-by: Zhang Lixu Acked-by: Srinivas Pandruvada Link: https://patch.msgid.link/20250331055022.1149736-4-lixu.zhang@intel.com Signed-off-by: Jonathan Cameron [ adapted prox_attr array access to single structure member access ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iio/light/hid-sensor-prox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c @@ -103,8 +103,7 @@ static int prox_read_raw(struct iio_dev ret_type = prox_state->scale_precision; break; case IIO_CHAN_INFO_OFFSET: - *val = hid_sensor_convert_exponent( - prox_state->prox_attr.unit_expo); + *val = 0; ret_type = IIO_VAL_INT; break; case IIO_CHAN_INFO_SAMP_FREQ: