From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (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 97CE548BD28 for ; Mon, 18 May 2026 14:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779114893; cv=none; b=C2TSyb9ZkTkpFPfzCk7I5ydrs0CkYhN648cq/OefV6b0z4fvCRg+13MWhADm76UrmDFrMiIk49q9TpIdbieCPRIsygPZcgR6MelBg4g6DxDob+LncwWNw1tX4b1UKHkzLcOLPPkm1KvgOoZFmiE9PmsGVypMtlGy9bhaV30QEUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779114893; c=relaxed/simple; bh=RHou1NZeZQJ2nBNPN4Aw2D1HXZfghIJsey4jXHsv5xk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pYNhDq7/Cmmv0b2xXBa74lmj24nwIdWhxMNfp0/S4c0YTsfck9H9OpMBk05Ui4IQQokEx+gapReoD1kkRW5tBdN29UVcNTx2zhFNPxGouZ+T5gp/g2WB3p1ef0rJje+N8xCZlyI65tUhG83pgIIIy33h8XIZNGw4wYQkmgxTSX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=fKsXV2jL; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="fKsXV2jL" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-7dbec19732eso2917390a34.3 for ; Mon, 18 May 2026 07:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1779114890; x=1779719690; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=R76EEUUYziDn4rTNwghYF5TGd9QqSpO9um+ZkcmBhtY=; b=fKsXV2jLOL811+xvlkYGS1r7FZs45Yb/wHJ0BVwZxAOnH+bVbnffG+bRcizN/XZAI5 bbEHiMtopvGf3WJSDjQmVxFkyjb60ENu1p/rqWfGLVXvAfdxwjcZc8965SMeG1/VSdH5 EfYkvIdfoIvED/t7PBiQQrHy+8Ac+AUGtgeplZfJO3h8g6XBd0ElD9JTqYMnvc0hwzD5 lAusEgg8tcJxq6eGDKtI4xba204nE3yRG/IU9djquaa4ZyZB4wBHCLm7Wnb+M69GH0kY QW1XTX/qf1Mr6+hE7Wr9KWMR44Wf4QdOkRiwLtvM2T2lcIe6LvzlvpduaM4dgdZpbyqj YGtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779114890; x=1779719690; h=content-transfer-encoding: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; bh=R76EEUUYziDn4rTNwghYF5TGd9QqSpO9um+ZkcmBhtY=; b=cuO42ui4pqw2VbOy247ms4972EiTQhuFAbVovCRIEYoUeeFmiPow/Os6kixsQTB9wS Q69LQtQBjOQjtIH68IXndoJgE58TEoxEIjLBmtV/RisK1k+Rj6F6zjS7UH7l1wH9roBR PUXVGDOAdUrvZ4joRL+XsFAGaweeKMZzMTrlPGiUmAYCBXJNvwrEsrc4ZN3gaXxfQILz 8+uB2tjKlu6vsy2k694NLjc08piUnGvUHKt4cwDtCmdu2tnnE1ioPyCMu2W8bc/bm6uX orUZuY4DY2x3bT+zyoZypKLaR7t4UROs/NQhPQ5POcgRhmaLEPo2AQIK9jYSt+VNQ3qE DCrA== X-Forwarded-Encrypted: i=1; AFNElJ/yjJxnfOIztTIASVMnklg+iCPgRll7AS2pjGQO9GtrAwAYwJ74UmJEXcjK0uuI9NlUxYVaA7fRJdaoR34=@vger.kernel.org X-Gm-Message-State: AOJu0YwZY9wXkBPwwBWeAw8rpwHfBvd7d8Y4r6AP2I6Au9lLoQ9WRpVY Ahvze/kGAGOpECnypSwI/8J1Wi2qzfvOxOpK52mE10Jxwq26Xqr8Otkf3IdR80WDXr4= X-Gm-Gg: Acq92OFjVlqbd1YEgqI+lIMeZjhWNSr4y1zhCHODmSGAJ8EYwvnfsOjQtTLMmf3bluL CKX2izCWoGKfcCFHyYhnIA8TGwKQBFPbfF/jPAl2OJL9NWjm2uZ2YJPXhVx1fQ7ZqZaXTqnY7mU bzZMa3BudKB1fP9iPbToh93yBFV+lrReUSWawnwmJQce8due7+wh1YitnZiO38N0sSt0MHpXt+2 hIL3vuZoIYHt65+oIkJ5M1CVok+ZZe5n1zHLzy9Cl7TGNo3QjkJ1/RKCowQZQ6Ud7QcQqp+87uv ppMwKZoOuYuqmsvw7qfwnKJ6wr+be5n6k6is1sOBdj0hlykShcU27H6giPSlE6u+Jphyzc+AuNc DF+Nqisqd2QjUylF8xZxvyXt/PvMYodgq13zyqDijzEiNEHHBNl5vgZmWnI813UqOisTryl1HPl XysH4NQ8/lxxfxW+2zJXKgI/28O+NZ5krEx3Wo2qVBI6Med5m1hi1w1ZsYRv7ispvTS5tfEc0Iv A== X-Received: by 2002:a05:6820:1746:b0:688:2480:7fa8 with SMTP id 006d021491bc7-69c942dac4dmr10442247eaf.21.1779114890563; Mon, 18 May 2026 07:34:50 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:3be6:1187:fed4:378b? ([2600:8803:e7e4:500:3be6:1187:fed4:378b]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-69d049384f6sm5675126eaf.14.2026.05.18.07.34.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2026 07:34:50 -0700 (PDT) Message-ID: <41c0317d-2ce8-412c-818a-4a84201fce29@baylibre.com> Date: Mon, 18 May 2026 09:34:48 -0500 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 0/8] iio: timestamp declaration cleanup To: Andy Shevchenko Cc: Jyoti Bhayana , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Maxime Coquelin , Alexandre Torgue , Benson Leung , Guenter Roeck , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, chrome-platform@lists.linux.dev References: <20260517-iio-timestamp-cleanup-v1-0-61fb908c11c7@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/18/26 2:14 AM, Andy Shevchenko wrote: > On Mon, May 18, 2026 at 10:09:48AM +0300, Andy Shevchenko wrote: >> On Sun, May 17, 2026 at 01:17:17PM -0500, David Lechner wrote: >>> While looking around the code, I noticed that there are a lot of places >>> were we are manually filling all of the fields of an IIO timestamp. >>> >>> This is error-prone (as seen in the first patch) and more verbose than >>> it needs to be. >>> >>> I went with the approach of using the existing IIO_CHAN_SOFT_TIMESTAMP() >>> macro for doing a struct assignment. This does require a cast, which >> >> No, it's *not* a cast. It's a compound literal. And instead of doing this in >> every driver, add it to the macro (in a separate patch). Oh, let me just cook >> it for you (I added that to several cases in the past). > > 20260518071349.469748-1-andriy.shevchenko@linux.intel.com Nice, thanks. I agree this will be the cleanest solution. > >>> makes it a bit more verbose, but we were already doing that in to >>> drivers, so I went with it anyway. >> >>> If we want to consider alternatives, we could make a iio helper function >>> or macro like the first and second patches did. >