From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 D176739D3DA for ; Mon, 27 Jul 2026 15:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785166097; cv=none; b=LYfjTzYvKFbbWGKSrIUS37lM0wGyMv7hCI/r8pAAUptCc9GoYCFH3bGa02GEDAV6MGE0SF0DI/kZJua6GHekI6PReSb5RzXUBoI4QgKUVNPEyaRudHUfijHwBw/LRhDhq934zZxpjmkhDy84qN+DxGV8ORIJZGoX6uG+Jw8Wjd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785166097; c=relaxed/simple; bh=vtEm4JI6cjFLLzN4umB1w++w6VHuV6TmavJBIOK9aoM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UPAby2HjpxdHozUxUsnmTsveUYeDvv8Ljtv2EffKGIUzRwJGbIkYsGQ0q8ytpht+2cyxXQzWneq893Iu3JbnyEd3/7Q1wfMUhSdc/qHN2oDnkcBYWlWa9t7Tc0iiL1RZqIGCNimmoBHz4586DC4RXvmzxZJ8RmwJ274C99uECWk= 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=fCpYu+Fn; arc=none smtp.client-ip=209.85.221.51 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="fCpYu+Fn" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-47f9ab7ee38so1384744f8f.2 for ; Mon, 27 Jul 2026 08:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785166093; x=1785770893; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=z6nWJwpGrsa+oinARzLimkZHubU2TI+0Gk5gRgKi39k=; b=fCpYu+Fn3Jm9c1OgvG7CiuFsbkswj/M9qKT2dbof9VMdQxy1qUPKIlMty3HPUEqmTo 6PS8tvp14rk7vwtGBDZYOBOiAwvw8W9O3eYt2+LUnU9fDO9SwDidUlpJJ4QVyzxTw7kO 1FQSjWXM1e2LdtyNttrY1IiYIiYN05wXnDYqCkvftuy/y5bAB8/s8IvLF6V3lmkzosdL rCn1+osKvmbk4MO/oejunsGTsF2OtioWSHIvmM/zFPktoBz9lBVHbGXoElLbi8eZlBh9 WK0Hl07HQ8hvSVY1AtIO/dtMJHBB6WP2UrMvDHXG3Z6MJc4WT7LMG0xk55Iq/K9XtIhl ox2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785166093; x=1785770893; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=z6nWJwpGrsa+oinARzLimkZHubU2TI+0Gk5gRgKi39k=; b=PdD845WHmZ6GPdtfNdaqr9UDa9tQVfJZYj3V3WglE3WPtEkaQ4GVc6vEWRMw68WayB GZjTAglzfDbLVJ7yhBgJwcdZJKKjFo+vsGke3iT5AlxUi6tvxkxGeQnF1MpgVrE9T7sl 3zwygPq6an3M0fWId73zlemVHvkiQm23W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jA3GEXsSAujyxCcseF/4WYwJTuf7+jCiDI/ kFllB1rYubkxdnoGdPrjziCs= X-Received: by 2002:a05:6000:1a86:b0:47f:97a4:f121 with SMTP id ffacd0b85a97d-47f9feb5316mr10638215f8f.30.1785166092801; Mon, 27 Jul 2026 08:28:12 -0700 (PDT) Received: from localhost (90-182-112-124.rcp.o2.cz. [90.182.112.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85b9a64dsm54329858f8f.1.2026.07.27.08.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 08:28:12 -0700 (PDT) Date: Mon, 27 Jul 2026 17:28:12 +0200 From: Joshua Crofts To: David Lechner Cc: Giorgi Tchankvetadze , jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Giorgi Tchankvetadze Subject: Re: [PATCH] iio: light: veml3328: remove redundant cast in read_avail Message-ID: <20260727172812.00004210@gmail.com> In-Reply-To: <90018da7-8d84-4bfd-b2e1-f832ca03f764@baylibre.com> References: <20260727112726.211344-1-giorgitchankvetadze1997@gmail.com> <90018da7-8d84-4bfd-b2e1-f832ca03f764@baylibre.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.51; x86_64-w64-mingw32) 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 27 Jul 2026 08:15:59 -0500 David Lechner wrote: > On 7/27/26 6:27 AM, Giorgi Tchankvetadze wrote: > > From: Giorgi Tchankvetadze > > > > veml3328_scale_vals is declared as a const int array, so > > veml3328_scale_vals[it_inx] already decays to const int *, > > matching the type of *vals. The explicit (const int *) cast > > is therefore redundant and can be dropped. > > > > No functional change. > > > > Signed-off-by: Giorgi Tchankvetadze > > --- > > drivers/iio/light/veml3328.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/light/veml3328.c b/drivers/iio/light/veml3328.c > > index 7ff1753925c4..a3c49beee93a 100644 > > --- a/drivers/iio/light/veml3328.c > > +++ b/drivers/iio/light/veml3328.c > > @@ -228,7 +228,7 @@ static int veml3328_read_avail(struct iio_dev *indio_dev, > > return -EINVAL; > > > > *length = 8; > > - *vals = (const int *)veml3328_scale_vals[it_inx]; > > + *vals = veml3328_scale_vals[it_inx]; > > *type = IIO_VAL_INT_PLUS_MICRO; > > return IIO_AVAIL_LIST; > > } > > We'll see if there are other opinions (before sending a v2)... > > Usually, we would declare the array like: > > static const int veml3328_scale_vals[4][4][2] ... > > in which case this cast would be needed. > I don't really see a reason to do this... but up to Giorgi to send a new patch or stick with the cast removal, I'm indifferent. -- Kind regards, Joshua Crofts