From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E269E33D4E1 for ; Mon, 13 Jul 2026 03:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783915077; cv=none; b=nywJk2DT2V1439anjACCEC4chQ1q3agF2nuEWOrdXf1u3Jn5N+Yauezi3ULS20ewogF2EFlfjid+/pxlx2hUii3nk4v4EyxqVeG22Li1hsS3cc0OJaiPaSOnSylp+gWLX709KYBMENizaR9m9UoS6Yx0324u9zLc2rdkJn17oBI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783915077; c=relaxed/simple; bh=FttQ8RmdF7jMEA9kPV1TdKHVweC3ujH2gsNMi5NimDc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fpOs9Q0fJ7dNeewgBeueanmrs7OLAFoGOrTTkFB0QyBzzXpNKKVuOgKYmqEGZEmxKkT/r0KR0QrYiM+Jk2q8wfqxOktt8BdlrhlWlkKzUo6teIRQDHo3q+/WYxqh2JBvX11tRl3TOpqBeyC7T02wxKLX6UuUFppVFO7OFBfhPeM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VzSJkx/9; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VzSJkx/9" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-c966b9ee9cbso1350951a12.1 for ; Sun, 12 Jul 2026 20:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783915075; x=1784519875; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9u3/eEAOJr6IzOF2yv7lerO2luzOs8+kGo7tSPCV4fA=; b=VzSJkx/9iHOnxZelQlalNFhY0zHE77wJniaHHMrfEG+c4JKXD4l5mbHjGmO6AYId6s 1zMoXVqxwDCCdURQ82FQDAaikL0Oasi3tTTZcoWhYhsguYqK0It7jsXlJFuV2VbH1Xh8 g6D4+R9S6jRsLQvmSt4r+X11dghjvTy6+Fqzhqwq7z6hvVnayWRdp8t+HRpnKM5pqy8Q YsBPwn1nyGcAVVzLlYt4xKBrm99TpwyNOAgJsEB6ED+cpuFz3M0boU4KwCovv36PNPsU RpKVlJ0GoETDqUzqVQeWQ4raYfkYncoSFQ4B+HicF4aGoh2Jqse9jrMv9cSNIlw9aAVz SjTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783915075; x=1784519875; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9u3/eEAOJr6IzOF2yv7lerO2luzOs8+kGo7tSPCV4fA=; b=ma4xLVl1dDpKTixmpTSwBbUICko236hmcPZFb2l+AQUHgkYbKu3QOPiF3rSF8S0c/k 0W2gxUufSPv9+yhJErIqePLmhHRCTr85XT5Yb6aE0cyhVFqpY0e0FSvxY4j0JjfzYBnn 0UkGMzz8xbTKp3Sf6Hf9IKYfe38UiltaBsEs/7/BqIdwlIgelSj3BA4d36tAjs+uSCFj MMED1wC0FcVlKkTCEjv8F1GvwM82LygtUQzGCDFEfknwqktI0JSYEAP2NEReVA4naOjT CRvL8eIQKQFMnlf0hsAilqSI85aaWqKqUbCXj3YUh8dVOL8ItEFgkJ65g3GrnAHe6mw+ S+rQ== X-Forwarded-Encrypted: i=1; AHgh+Ronc/C0XZyJKqFUc5YpRn4OVoCXE3l9Br3WkS8WDzCDIUp5yArHPcH7OQ40W0zbgt6Cgea/v1VSIuQy4KY=@vger.kernel.org X-Gm-Message-State: AOJu0YzD/EpLqDRHIALRE13TBPzz+Bw14rY8sBGMReny9kNxFcjewYM8 pQOzcHb7hl3XXqP9imC8G1Cbjs1WK0buLhHCfSUJd4hZXsumviK6X1E= X-Gm-Gg: AfdE7cl1phTYtER3lT99QM1vztMwOAc+FD5WDiI/bWP7KfUQ1WiJU02wZWa4T78E2pF GJ6CTuCCyUmCwgbu6+ht5oLpVsk9DXCUhsf+hjWtRJ/qvbB3gyW7weV1Y++IzI0KeGYEmNSStsM eyfSM0FEacoTVHJb6tIsR5uNYckVd2wXyPTVIHyfNGhcq/0smNilf4wj742YWQEvYdm+jkLXJJT cHK0MfTGwMRhqRmLLJ4BBy6ZK3waibH/TcF6LIuIhoIMOYcvoPuDkFVD+ZfAWiD1GLm+yK4mtbn QddY17F+CS6oP+m02etT8SHb+WN00mClENSWx7eTTFi9VxESQESylSc7fbtMGuGzvCE1SBRoh8c +PrLXBaBoklgJD/BqPAsIwKtjONUIUhRn21c2H863NxqTaatUJ4/7K08wMdNNX251+Ni7tR2IbM xl7tReox8Vz83iT7aKxoLyYnttvusuwFRNcP8Pnrh573O7LEm/IZ66FAkjf4WKqvM= X-Received: by 2002:a05:6a20:9f8c:b0:3c0:9c19:659c with SMTP id adf61e73a8af0-3c110b7ba39mr7967809637.68.1783915075371; Sun, 12 Jul 2026 20:57:55 -0700 (PDT) Received: from localhost.localdomain ([101.0.63.154]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f5975sm60862704eec.4.2026.07.12.20.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 20:57:54 -0700 (PDT) From: Nikhil Gautam To: Jonathan Cameron Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Nikhil Gautam Subject: [PATCH v2 3/4] iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem() Date: Mon, 13 Jul 2026 09:27:35 +0530 Message-Id: <20260713035736.11346-4-nikhilgtr@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260713035736.11346-1-nikhilgtr@gmail.com> References: <20260713035736.11346-1-nikhilgtr@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit div_u64_rem() takes a u32 * for the remainder but is passed val2, which is an int *. There is no functional impact as int and u32 have the same size and representation on all supported architectures and the remainder is always smaller than the divisor, so it fits in the positive range of int. Fix the type mismatch by using a local u32 for the remainder and assigning the result to *val2. Fixes: 9a9608418292 ("iio: light: Add support for TI OPT4001 light sensor") Signed-off-by: Nikhil Gautam --- drivers/iio/light/opt4001.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/opt4001.c b/drivers/iio/light/opt4001.c index 9ff99c19b6ae..9f877c5798b9 100644 --- a/drivers/iio/light/opt4001.c +++ b/drivers/iio/light/opt4001.c @@ -173,6 +173,7 @@ static int opt4001_read_lux_value(struct iio_dev *indio_dev, u8 crc; u8 calc_crc; u64 lux_raw; + u32 rem; int ret; ret = regmap_read(chip->regmap, OPT4001_LIGHT1_MSB, &light1); @@ -199,8 +200,8 @@ static int opt4001_read_lux_value(struct iio_dev *indio_dev, lux_raw = lux_raw << exp; lux_raw = lux_raw * chip->chip_info->mul; - *val = div_u64_rem(lux_raw, chip->chip_info->div, val2); - *val2 = *val2 * 100; + *val = div_u64_rem(lux_raw, chip->chip_info->div, &rem); + *val2 = rem * 100; return IIO_VAL_INT_PLUS_NANO; } -- 2.39.5