From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 2A86238BF6A for ; Wed, 19 Aug 2026 05:11:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787116311; cv=none; b=O+j82KbEUT51Vl/kNYo9w1mkLr8ZPEYRx2L7lhiBSAFWhYQUdYmD0C7+mKOv+lS/4HlKj7EDVqIJ7hwmklJocw7jGJOa4oBGP2+Ab25df1PWJtOCGbiS3oFo7Yyu4fuyZOPVhP0IWMuvGTGlJsbQXbwlVQ6NLcXtsUj0Wu4aTzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787116311; c=relaxed/simple; bh=+IB8gqdGZ0JYzzVYCdgm2UYJqdaxyEEi0fEhPwDIam0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WGgxfLSzgE82JuTgFTJvHJPxijivUlQUgf7QcaMbG6PYH8bJZ0BTGdyw7CvzaXKNDc1exzYuLJBcIB1m+I2ZE3inJpxtQBM53iGaVgm+kCqHEbCEGS8ONhZn5cjaeNNp2c01Ddf++nSuBhnqXUz1kulzNE+PlFUznaODBxQ9m2M= 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=KtqR/qnM; arc=none smtp.client-ip=209.85.167.43 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="KtqR/qnM" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5b00d083818so1722874e87.1 for ; Tue, 18 Aug 2026 22:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787116308; x=1787721108; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Xg/g0kI4FzGMX+GmBiCP3Ec5mfFhfZ7kmnQpf3eCjV0=; b=KtqR/qnMuC/QFdcwBbxwG17NwwTYx5GUcORLAF7N7kOwVpPZXIQsNFHfkPnCm2qFAX BCi92AYG2VaiVkrt8zRphGbCpy6pvKeYUYaByjhSMOI6rMlLgbbJ0dzniJM5Bb3g0sjv 5HmfYjjwWcPcbJvFapZUewwJ5JbXn92i66VGno3E4CyTP0oxKGeLTX3h9iHJIlS/cy2w S+auxjpmLh7yRM5LYFsNhQRWKOEqwzBXvEeIgV7lqG/2NzMkhhGiogRszd+I2umAzaS5 IuRtAygfberWrJujQg8Yhvrth/M87Y1kRgE8UiErbwCPWV7/8BY9R2UdrEWY4riPvfvL CnUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787116308; x=1787721108; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Xg/g0kI4FzGMX+GmBiCP3Ec5mfFhfZ7kmnQpf3eCjV0=; b=EDOSYtJDCZ4+mbOI9W4LUWwfkrXgAGzpOg40Kb3cbnvpQ6V9zk8n/vJLCvSV1nnfxb QBg3B70E7kclG9maV6QWuBXKwWHcGwOdNp8vxG3DhaX3PcIaezQhnszU22q/ANDecsrE nJpXPsmeNGMcr9kPDPBn/dmgRZAF9fUFS3gz+FPTenLwPb1im7drBOxsGfEVCiKlbumM an63qnzPlpLCYzmwNE++LG+6faadGtMH/7iUMY5G1MOf9P/wY/GcqFiF0/1Wie/UqR71 gfPqkohAX6ia8a9Nm8uDAWl6U4aIVu4+M8EozcSCwfINefzKM5NF5litR1P4rPXGI6yf eBFA== X-Forwarded-Encrypted: i=1; AHgh+RrkoTEOEaBEuQexTxtOcyvP516cRdrXmCYVO3X1jnKimWTtVXNbBxengmhDg4KZ/aKklUBnycoHGWKoNos=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6/sztrQNBAhEfIrffi7SgRMJ2c4uu1zyx8rptX47epR9QNjMR N2wHLxvIFEBl3n5V1yB9mPGlU1PONeixiK6QyhchOYBCq93rPBB3YXre X-Gm-Gg: AR+sD119bh2td/LMP65Ve/UPn4KimaEUwJxzch2a3i2LHDrq4Tj/JOgg0xFToHiXxhq sGaPRG0vpMEIlA6lGrJfAyn82X6DDWr8ufCtZZfotMXfxXr/9nwcjwGc+El8atGr6OQ6PVMdZxp faZoF+wKwdhe5r6hQIliy5T4xiom2UFp0ZoJfbODux+m9SwFVZZxlU4/iQXz9oNxZZq+S7RqRBy DdnSPVGCP3V+ISYbXQyfvJcBD1l/Q8FlHJ932bLZ0SuyeHUgsdD71UV5v/9ub+BGXF4rqRpF38o B8PuQicJ540GuWkGII8zgRsOVKbkF/sg9N0YgkTGb1lJmSoCiS2c9Nb5JcoK+qhLMymeeF2N63P 2mg3GAtgMlMJRUypfkkU9S4YTFT21dTaAylWRAbGhlaRIn4ypyyLiqWQ3N2DdAt/5Gyzghhv65J whUUosur9gfVwYncVC1UNqhs6R6rXwGYX+JxnFVI0xvS02iOjej4udWnonBJ2/BVbQueiws6F04 9mKyEOR1zrwKA/YuNDnirxEeFeTuH0KEWn4fDvTWv3h X-Received: by 2002:a05:6512:6404:b0:5b2:aa5d:9ce7 with SMTP id 2adb3069b0e04-5b47868b81bmr396488e87.10.1787116307910; Tue, 18 Aug 2026 22:11:47 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b478853ac7sm232490e87.7.2026.08.18.22.11.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2026 22:11:46 -0700 (PDT) Message-ID: Date: Wed, 19 Aug 2026 08:11:45 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts() To: Gabriel Rondon , Jonathan Cameron Cc: David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260818215122.52715-1-grondon@gmail.com> <20260818215122.52715-3-grondon@gmail.com> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: <20260818215122.52715-3-grondon@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/08/2026 00:51, Gabriel Rondon wrote: > Replace the deprecated iio_push_to_buffers_with_timestamp() with > iio_push_to_buffers_with_ts(), which takes the destination buffer size > and checks it against scan_bytes at runtime. > > Both push sites now use data->scan ({ __le16 channels[3]; aligned_s64 > ts; }, IIO_DMA_MINALIGN aligned), which is 16 bytes and matches > scan_bytes for the 3-axis plus s64 timestamp layout used by all > supported variants, so pass sizeof(data->scan). Eh, what is this explanation above? As far as I understand, the iio_push_to_buffers_with_ts() has a safety mechanism of checking the passed buffer size. So, size of the buffer must be passed, no matter what the buffer is designed to contain. By the way, to my eye the commit message looks AI generated, which is perfectly fine. But AFAICS, AI generated patches should be tagged as AI generated. Hence, if you use AI to do the changes, please ask the AI to check the docs and also add necessary tags :) > Signed-off-by: Gabriel Rondon Other than the commit message: Reviewed-by: Matti Vaittinen > --- > drivers/iio/accel/kionix-kx022a.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > index cf2cb751b4e8..86f17431aa23 100644 > --- a/drivers/iio/accel/kionix-kx022a.c > +++ b/drivers/iio/accel/kionix-kx022a.c > @@ -863,7 +863,8 @@ static int __kx022a_fifo_flush(struct iio_dev *idev, unsigned int samples, > for_each_set_bit(bit, idev->active_scan_mask, AXIS_MAX) > chs[bit] = sam[bit]; > > - iio_push_to_buffers_with_timestamp(idev, &data->scan, tstamp); > + iio_push_to_buffers_with_ts(idev, &data->scan, > + sizeof(data->scan), tstamp); > > tstamp += sample_period; > } > @@ -1033,7 +1034,8 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p) > if (ret < 0) > goto err_read; > > - iio_push_to_buffers_with_timestamp(idev, &data->scan, data->timestamp); > + iio_push_to_buffers_with_ts(idev, &data->scan, sizeof(data->scan), > + data->timestamp); > err_read: > iio_trigger_notify_done(idev->trig); > -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~