From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 CE800378D92 for ; Fri, 7 Aug 2026 18:32:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786127549; cv=none; b=X0qq1ne907iruKIuRqaKtXtNIgByvK+jHsP3enEGd8RQHj9s6ubgCCn+yxrY5YI0xsusGzWih/KBOQ1sg/CdAHDnu6mG/l1x+XxSo2n1VFHA9wSXc3YbkjS21orl9Y5KcFNfLxiSEHpqyxJNFowVvdK1Iw4LC4wX3si60MK3hH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786127549; c=relaxed/simple; bh=LVRpvRWQSaxHfSgYe3MtbFfNAnOMtlsZRIWS10Dv0GE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k7+VDbhPXHwfNZpPS1YUsxV2v+IlwupBZUIgNEL7CXgjiWU+KL2WicTjL7ByB4yJj9fXoWd/WRF60tifBwtQOVEJmhfsJuGYvKKcUdJzjCP+6H1r/i+SZFFwaTMkpUgKIGBiTwJZwun0a8+Oufilb8jWyScKU0cmXHjS/cez0QU= 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=Odgy0yVA; arc=none smtp.client-ip=209.85.160.180 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="Odgy0yVA" Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-529a1ee0e62so25461991cf.2 for ; Fri, 07 Aug 2026 11:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786127547; x=1786732347; 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=rCdCLUuBP8/CkfxUK6b74oN1gwbSsaQEa9gHG9eOXxo=; b=Odgy0yVAwz1f6T3u3e6D5aLzpKR0SEszq4Ybvk6ObUU2mm2Sz57aPamD6C7rMrk0hD CHS+0uO6eil35GKH9+tCdcaS33dREJ9EGdwj1oId3uNifKKlmHi/0TYetDGGd9s841pm VZIuGYlLaetZuD0e9kjLobf0s/UD2gSxIPAx8c1RLM4f9hlBkvGTzYhg1K8SqevQbEl/ I/NNYRiWJHt4kT6u71v9eybwr1dOfa1KAZuA1ZqTqyO4eCzWFZEsT/Dn2T2nZXNAiB4Q ByMY7h39Xydh710GiBRwYVBsOOQoFfh4IFsWiYAgLsLpUe2oy9N6FePWwGkN8oToTMNN Veew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786127547; x=1786732347; 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=rCdCLUuBP8/CkfxUK6b74oN1gwbSsaQEa9gHG9eOXxo=; b=IJoZOpbI/Vl6lgO2G5OFAsvCv+uuXoEfVaQmMSPWtuwvg0JWzX3X2VdxdkmwLstmAT Blp+Dxd4ZVqUdZDDZYUVZSs2dFH4/5o3i3lp84Md0pjaEeWInG/XmJ+2ch0mYUel3jGy 2IiIXTolsxxA+dZo3bBg9VioD/rWVMYNcukxM4QGuQjjqLHzH9qcwiz2vOzVsPiKj8Bx p8FmzUy6piIVfYJSkt3E/6Fel9cEc94W22XUvuLFzUFmqsQf2cDa3oEt9K7yp++Z6yJJ siZ++fwCmtr5UoF8UlzlmTraQLIzmyE0wzVns1d0OXI9qlcKLO2HAbf5BIr7xE8Qf4l0 2mHA== X-Forwarded-Encrypted: i=1; AHgh+RouvgeXHJKVDbFnfOisns3Yb0pYFBThsUfiNsLxJhWbRreAJbf2OCVeUXKPTrMfnhmOarowDjhK+OMBAG0=@vger.kernel.org X-Gm-Message-State: AOJu0YzXdTmB0xjlyJT63t4j0TwhovDKrwlbjtYnuWILlAgkYCbvyCIr oap/jJLYLPl+za2CABs9exFuTIzsptiV9zZGFlRIMK16CRJZ5QcbXyM2 X-Gm-Gg: AR+sD13rIJA1zKf3s6vlJcqLnFccUXb/zo0RfoiZXBD0J24SKqGx6QmpCkV8UFP79Ip SvyZRix+bLNE1Xkd3UI+Wl/T3XuyQuQorGNClNEfkHmjZtsskQGLAGOmxf3pU23rf2TWsE2DlVy VcHnoOmpGOmI9q2qBl2rewfZPzcxMqad8DusCCODFl3uYQL0XomwbaDb9oj7lXN6pzrgcpaEu+m K9VHBxGDYD3eJjBLvPGIMGQQk5E8hujNMMkhA8rdFQxQMRUE2ad7pvIfhjhCicz6VIluFdrawvw xVG5Ks8o8vH7wLVxb0/HmT5PKVW8IbKNDuSm3mkRcuBqYFLYJInH/beUZ45Eb5MTIvqhs6FvNts FtiBGWPAN1DQRKkJAqs3vwScU446QUvVDilk/y8QZtOXUAsoiv1TUAN171JGjyzVIuG3lDGvOwJ tNZqrNNjwkryVnpSxXQtWXR1KAM6XyVIb7hAEKBEkY+YcFLTL0PR1b/4S4o8xHnxUHFXEWNzLWs g== X-Received: by 2002:a05:622a:1487:b0:516:dff5:68c4 with SMTP id d75a77b69052e-52ce5f449d4mr258294841cf.7.1786127546775; Fri, 07 Aug 2026 11:32:26 -0700 (PDT) Received: from louisarchdesktop ([2601:184:417f:5ad5:c570:9008:5a2b:8db7]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-52d1637f4a1sm17779741cf.9.2026.08.07.11.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 11:32:24 -0700 (PDT) Date: Fri, 7 Aug 2026 14:32:20 -0400 From: Louis Adamian To: Andy Shevchenko Cc: Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] iio: pressure: ms5637: Add variant specific temperature compensation Message-ID: <20260807143220.409fe4ec@louisarchdesktop> In-Reply-To: References: <20260610020458.104818-1-adamianlouis@gmail.com> <20260610020458.104818-3-adamianlouis@gmail.com> <20260611151026.4abf8804@louisarchdesktop> <20260805130651.4aceb71f@louisarchdesktop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) 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 Fri, 7 Aug 2026 00:27:30 +0300 Andy Shevchenko wrote: > On Wed, Aug 05, 2026 at 01:06:51PM -0400, Louis Adamian wrote: > > On Thu, 11 Jun 2026 22:32:02 +0300 > > Andy Shevchenko wrote: > > > On Thu, Jun 11, 2026 at 03:10:26PM -0400, Louis Adamian wrote: > > > > On Wed, 10 Jun 2026 21:37:58 +0300 > > > > Andy Shevchenko wrote: > > > > > On Tue, Jun 09, 2026 at 10:04:58PM -0400, Louis Adamian > > > > > wrote: > > ... > > > > > > > struct ms_tp_dev { > > > > > > struct i2c_client *client; > > > > > > [...] > > > > > > > > > > Please, check with `pahole` if this is the best layout. > > > > > > > > I will correct the packing on this per pahole's finding. > [...] > > > > > > > > > > Can this be simply embedded into ms_tp_dev (and copied there > > > > > if required)? > > > > > > > > Copying in ms_tp_comp_consts provides no benefit over > > > > referencing the pointer; the values are per-descriptor, not > > > > per-instance and never modified. I'll keep the pointer (same as > > > > ms_tp_hw_data). > > > > > > Okay, let me ask differently then: Can we use the same data type > > > in ms_tp_dev instead of adding basically the same fields as in > > > ms_tp_data? > > > > > Sorry for the very slow reply. Yes, for v3 ms_tp_dev will hold a > > single const ms_tp_data *data instead of its own hw and > > comp_consts. This drops the duplicated hw that predates this > > series. > > > > One thing worth noting before I do that: ms_tp_data is currently > > private to ms5637.c and will need to be moved to ms_sensors_i2c.h > > for ms_tp_dev to point to it. I don't think this is a problem; it > > matches how ms_tp_hw_data is defined now, but let me know if you > > would like to avoid it. > > The pointer may be opaque, in that case it's not needed to be exposed. > ms_sensors_i2c.c dereferences both ->hw->prom_len in ms_sensors_tp_read_prom and ->comp_consts in ms_sensors_read_temp_and_pressure, so an opaque ms_tp_data would require passing both pointers as parameters. I plan on moving ms_tp_data into ms_sensors_i2c.h, dropping the original duplicate hw, unless you prefer otherwise. -- Thanks, Louis From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 1538D2C21F4 for ; Fri, 7 Aug 2026 18:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786127587; cv=none; b=my1Y9Lpd7maViXs+zgBH3MTPFSmLHyDx8iLEochYoD4sj43uD42fLbhAiW+7NriodJusbt+5q59R5x2enUJNdKRFfAFW0hsYXlNz4j9esukCJx3mMHPbAW5zkyoEMFkHToJo8SkjFDVHj6zf2jthUQ7A3CDNIaiHl+46VnL4PpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786127587; c=relaxed/simple; bh=LVRpvRWQSaxHfSgYe3MtbFfNAnOMtlsZRIWS10Dv0GE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bo5OAjX4ZzvDIGqRI+L51C8xWq8j539UaJG6PJhcOQnslCQHbnm+x0XCcX3UH+2e2IfWylOb4p021DS35Et0bu4PKKx7V+GmohU/DQPYRzN//uLFaZ/2r22/fIWMIAItAgK2ipaTZ8W1PKDSdyJA5DazSNVeMqWar3tHszjJin8= 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=ZXQxGHOA; arc=none smtp.client-ip=209.85.222.172 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="ZXQxGHOA" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-92e5b048375so189604385a.1 for ; Fri, 07 Aug 2026 11:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786127585; x=1786732385; 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=rCdCLUuBP8/CkfxUK6b74oN1gwbSsaQEa9gHG9eOXxo=; b=ZXQxGHOAbmMIHVU/Yu7D4PNpE+Ee56ASOWUid5PZeXt2kis9luGCXXULW6gHNYSqap 9f/fI3A9q7/MGwWOwAFk2ojXbbCU/uGVDBi6fIfoROv89Qm6f5Ibq5hULAlMAwAtxFtn B5O16ktooqjyYXKgiiEQGe5sY/vhfbg0csKGHJX4ijtRcchdgerYNY8C39Aj3plGA3Qz vCdoDrB8Y7o5P9ZW//zB12pv8LSk1iFBfm0zTLJgosY+K/2HqFfT747ArhhMBcG2e/w9 bB6TeCWaLesmdd6kbb5OHQOr5V8CFOLtzPx+iAZTcq4KNVxq63mRrNtFD20q8WGDK6p9 jz2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786127585; x=1786732385; 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=rCdCLUuBP8/CkfxUK6b74oN1gwbSsaQEa9gHG9eOXxo=; b=pBsdgub52GkL6XMgtVYkm2VRbqa2L7tXHIeyddrwMfZuOqI2jb83RA0d58gR3Qezzh ZvHd3+UmD5hssx6ZJZCezRnrNWonBkWYwm8Nc1KEnQYQXBSdUyFrE7EvosgjtnGfvJPN azdsDlUk0Vf3MVDcasFlRvxX3C9dNHopiZrE+tRaOrvdUnUrHwQhc+RDEmPeN2I1HgNU sB4apBnJoTHGFAZJzP4M23s3ERXJPvS/s5gQXedcaa9vkw9JcUoVom6NP5WqJzYf26/i 8dlX2perLjOzXpi/J/PK+ttV1iXz8lnkulOrg9qh7ANbobKJlf0Fjv6PXBPyI4FlD//c bEMg== X-Forwarded-Encrypted: i=1; AHgh+RpON+tO1w0o/hkbKCyq+7m3y0vrnaWuYy3r80kUvz/hDpE8NaU/2ygxGjJN5SRYu3DT3Ux5/+JRtxI9Z+U=@vger.kernel.org X-Gm-Message-State: AOJu0YyoJYYC9QKYsPrZeMplg53u+zLMq7PEbtDA4dCitqMutJQ78acq UExt+QEBReUZw8Uw+zWbYjXzYXQtDtY4Ghgds5fHSaB7YOBo6FE807CiNpUzkZ2L X-Gm-Gg: AR+sD11TAieIFMaxlMxLhamDGtAT7vLhuSkd6c1QLkoOWR7OGjOVPrzvGZKvgBpufmz CkNinVpQiGBuxe/7KPNKsp3GeoWih6c6DDf6OYxBkBAGFGVU0tMR8rERLjh3SEQyjIj0oF2y+fw yqlWD1hxrsh6oHpcHQJSJQ/iQ8RZh7xNoQLHhA3U8QX8fttWZa1kwxoS29WUUipLh09mnteiDZN KNn0VvHDQBBcisnuR995ErS3pB4MVVryD7HTpqc8yF+h/FTAKBLtXpNgM21m9fYAL7eB2egRkMu gUU6QRBQZW3Nq4/qsGjrE7I/ciS70RLmRlkC+JFS0Q366/OhNlVOfGlyDXEYnHVjMUDzsOIqucs f0K5mFrhYrpUhFdod31uoBcoyr/3QiKz7ePwMRX/mLsev2qBy9KMKAi4Cnm2BKYj4woJ42kaeV6 ZCFaDlicwNDqKu72VeK6orvGXAeok7y4ol7lfM3ywhVU3RSnIn+iZob8IdcjwpEAunVhfdEyOGH A== X-Received: by 2002:a05:620a:2614:b0:932:deb4:7788 with SMTP id af79cd13be357-93648fc7072mr2802915985a.2.1786127584946; Fri, 07 Aug 2026 11:33:04 -0700 (PDT) Received: from louisarchdesktop ([2601:184:417f:5ad5:c570:9008:5a2b:8db7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9366e229853sm206057085a.28.2026.08.07.11.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 11:33:04 -0700 (PDT) Date: Fri, 7 Aug 2026 14:33:01 -0400 From: Louis Adamian To: Andy Shevchenko Cc: Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] iio: pressure: ms5637: Add variant specific temperature compensation Message-ID: <20260807143220.409fe4ec@louisarchdesktop> In-Reply-To: References: <20260610020458.104818-1-adamianlouis@gmail.com> <20260610020458.104818-3-adamianlouis@gmail.com> <20260611151026.4abf8804@louisarchdesktop> <20260805130651.4aceb71f@louisarchdesktop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) 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 Message-ID: <20260807183301.jojTkoO7qAdG4ooOhaI6oqPjKBj8ters_AwSWjZQZt4@z> On Fri, 7 Aug 2026 00:27:30 +0300 Andy Shevchenko wrote: > On Wed, Aug 05, 2026 at 01:06:51PM -0400, Louis Adamian wrote: > > On Thu, 11 Jun 2026 22:32:02 +0300 > > Andy Shevchenko wrote: > > > On Thu, Jun 11, 2026 at 03:10:26PM -0400, Louis Adamian wrote: > > > > On Wed, 10 Jun 2026 21:37:58 +0300 > > > > Andy Shevchenko wrote: > > > > > On Tue, Jun 09, 2026 at 10:04:58PM -0400, Louis Adamian > > > > > wrote: > > ... > > > > > > > struct ms_tp_dev { > > > > > > struct i2c_client *client; > > > > > > [...] > > > > > > > > > > Please, check with `pahole` if this is the best layout. > > > > > > > > I will correct the packing on this per pahole's finding. > [...] > > > > > > > > > > Can this be simply embedded into ms_tp_dev (and copied there > > > > > if required)? > > > > > > > > Copying in ms_tp_comp_consts provides no benefit over > > > > referencing the pointer; the values are per-descriptor, not > > > > per-instance and never modified. I'll keep the pointer (same as > > > > ms_tp_hw_data). > > > > > > Okay, let me ask differently then: Can we use the same data type > > > in ms_tp_dev instead of adding basically the same fields as in > > > ms_tp_data? > > > > > Sorry for the very slow reply. Yes, for v3 ms_tp_dev will hold a > > single const ms_tp_data *data instead of its own hw and > > comp_consts. This drops the duplicated hw that predates this > > series. > > > > One thing worth noting before I do that: ms_tp_data is currently > > private to ms5637.c and will need to be moved to ms_sensors_i2c.h > > for ms_tp_dev to point to it. I don't think this is a problem; it > > matches how ms_tp_hw_data is defined now, but let me know if you > > would like to avoid it. > > The pointer may be opaque, in that case it's not needed to be exposed. > ms_sensors_i2c.c dereferences both ->hw->prom_len in ms_sensors_tp_read_prom and ->comp_consts in ms_sensors_read_temp_and_pressure, so an opaque ms_tp_data would require passing both pointers as parameters. I plan on moving ms_tp_data into ms_sensors_i2c.h, dropping the original duplicate hw, unless you prefer otherwise. -- Thanks, Louis