Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp308167rdb; Thu, 30 Nov 2023 05:33:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvxGS1hk+gyRT+QWfTnZasUePtrH1ZjV86H85I8U8q/3YBSEqKlnePVEuOJ0oWHONUA14n X-Received: by 2002:a05:6a20:6a2a:b0:18c:b464:ec5b with SMTP id p42-20020a056a206a2a00b0018cb464ec5bmr14396723pzk.61.1701351201507; Thu, 30 Nov 2023 05:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701351201; cv=none; d=google.com; s=arc-20160816; b=fE0RoIfYWEDr1R4NERc9ZI/6rU+9uA6rmi3ih0c8i2IOsJvOC2oqsiukzf+lHxwqfz hsPWiReC3gN7Ki/qHt3WgN+fvYtcah1tK7nb5qVLWJtbZB3O4rAeu7kzHfMBgQICC6T/ f6X/g7vi8l0P2vAzWntrLKMwuW8hjpe9yIhTqW6Ilp/a4iz9FhgMNRtFTqmqPeDH7VkA OTHmi89GDS47G0SV+ID32iq+lcyYWdImcKLq7BbJE7rid826fJqbrUK6WkZQ7FkrjX1j xDxSNxxchTK30wawrGD48jcgqZet30ibHAXEYOcu++y+lxncWjlpT6uD8jC4nVgUJBXf Di1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KfBqvXLSz19lMdy4wKjLt9dk1PtmZ9uzEVmUEeyUCzc=; fh=NLsHMCkW9oUPGVAUwi4YjxY06qY4Y90bV6UHFXN6ohE=; b=coZYFnDlwBwpBMNPcwChEg3yXY3lN3W7szbLf1imG1h10x9eg/Wr/FW8G5inV4ETU4 ogy54NZX+mojpYQ++EPj3aYwo1TaYl+RevyqDgy6UhIHNY1Ex2bXQWPqMBsID27Fi9iw p0nygz+/D/6T+W25tfoC86NsGgqTXAKVcs7wbGDwuXmf8o42Tcj1kGZjN8Nw1Yh92C+I fQs336UJkBbLeTd/JaRAunKqDOw7bcJpl4baP7ruPqQLKn9vkmDpjUJC9hL5DJKFPJW9 dpcelM6N21cOGfj80DAjeVn6wmSbBKSWCXyUEs4s9W92AxCJJSVD6p0cT4/dhJpgKIAh /n/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i10DJW9T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t7-20020a63f347000000b005c5fe289ec1si1339354pgj.783.2023.11.30.05.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 05:33:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i10DJW9T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A38E980CC127; Thu, 30 Nov 2023 05:33:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345526AbjK3NdD (ORCPT + 99 others); Thu, 30 Nov 2023 08:33:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232100AbjK3NdC (ORCPT ); Thu, 30 Nov 2023 08:33:02 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB8ED6C; Thu, 30 Nov 2023 05:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701351189; x=1732887189; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=Y9xAE4jnRRyfj1G4wW1Lotwm4gpNjAn2zAYETZeXOaw=; b=i10DJW9TSl22/CNbIINoSGvsnU1vKerow5s1ScjGckrYdV2tx7CrJXUS +1JEpa7xToNyIhRRMCvM0kYmzhYcN5c1Ax2hEcLx6ew49vDgglb7G+g2z D1QFEE7V1L8B0vNaOmlHB5K36n9PamfSvAmqmtYTKoCpYFMK6EVfiRgVx PQpx7+MyqbFcnXU7shVZhatDfOu+CQOKKbkMx6DaPG8tWVHrvrlRfWJf0 YR8NEvytO/5m/6kU58oizP5hQiYf4avDDINGBRbOTNsdnpdkwzmQA3ILZ sPkv8MNjDdxSC/RWoDWB6unuG+CgO2UA6QQEDp6RTnHHMNWOEwBOeW+Y+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="424472104" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="424472104" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 05:33:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="769309024" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="769309024" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 05:33:06 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1r8hA7-00000000hwz-003K; Thu, 30 Nov 2023 15:33:03 +0200 Date: Thu, 30 Nov 2023 15:33:02 +0200 From: Andy Shevchenko To: Petre Rodan Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen , Angel Iglesias , Matti Vaittinen , Andreas Klinger , Rob Herring , Krzysztof Kozlowski Subject: Re: [PATCH v6 2/2] iio: pressure: driver for Honeywell HSC/SSC series Message-ID: References: <20231129170425.3562-1-petre.rodan@subdimension.ro> <20231129170425.3562-2-petre.rodan@subdimension.ro> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 05:33:18 -0800 (PST) On Wed, Nov 29, 2023 at 09:12:52PM +0200, Petre Rodan wrote: > On Wed, Nov 29, 2023 at 07:24:31PM +0200, Andy Shevchenko wrote: > > On Wed, Nov 29, 2023 at 07:04:12PM +0200, Petre Rodan wrote: ... > > > v6: modifications based on Andy's review > > > - use str_has_prefix(), match_string() instead of strncmp() > > > > And why not using the respective property API for that case where > > match_string() is used? > > I'm lost again. > > 437: ret = device_property_read_string(dev, "honeywell,pressure-triplet", > &triplet); > [..] > 455: ret = match_string(hsc_triplet_variants, HSC_VARIANTS_MAX, > triplet); > if (ret < 0) > return dev_err_probe(dev, -EINVAL, > "honeywell,pressure-triplet is invalid\n"); > > hsc->pmin = hsc_range_config[ret].pmin; > hsc->pmax = hsc_range_config[ret].pmax; > > triplet is got via device_property_read_string(), is there some other property > function I should be using? I think I mentioned that API, but for your convenience device_property_match_property_string(). ... > > > + tmp = div_s64(((s64)(hsc->pmax - hsc->pmin)) * MICRO, > > > + hsc->outmax - hsc->outmin); > > > + hsc->p_scale = div_s64_rem(tmp, NANO, &hsc->p_scale_dec); > > > + tmp = div_s64(((s64)hsc->pmin * (s64)(hsc->outmax - hsc->outmin)) * > > > + MICRO, hsc->pmax - hsc->pmin); > > > > Why not put MICRO on the previous line? > > oh well, from the review I understood you were asking for the replacement of > NANO with MICRO on the previous instruction and it did not make much sense ( > units are in pascal and we need a kilopascal output to userland) > > now I understood it's an indentation request. however moving MICRO will cross > the 80 column rule. but if there will be yet another modification request > I'll move it. I understand that it breaks the 80 character rule, but my point is to have consistency between two divisions (see quoted context) along with the logical split — line split on argument list split. -- With Best Regards, Andy Shevchenko