Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4488710pxb; Tue, 25 Jan 2022 11:24:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJx83bj3PtoL+k5QEUtDLvJVOuHTYPWguPIHvqoMNFQF2/QfOV8dSHYt5WP+qp1Zkzeq2smJ X-Received: by 2002:a17:907:1b29:: with SMTP id mp41mr18064642ejc.591.1643138679014; Tue, 25 Jan 2022 11:24:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643138679; cv=none; d=google.com; s=arc-20160816; b=IwIgzJQO8HVhmQm1hZ9hp7AusOVMnkYBHv3j8ZiJV8cVsEjiBhXfPXmo3P5I+H0qHp JSrH/PzoNd7OxSIhGLn1EFhu/z4n0RmqI1jHbLO1CMnqa57dQab1Q/Mlp1yjhjwOUcbB xzlIX2WT21TiOvApsSwRZJe6YCwHgfcSl+NcjP5S8Ciqc1HS+qDz+dddx8fofr0x+mLX 91H6WObqt/SHo8cVUzSxedbK3gpPHvjlwftjBi8An2k+fJkTWQlozgtXTt1HUkzxsr35 L99U4/dsfDwjSZRmAPShVrntVm37buiTQJKZpAycle2RmcyqnDnsQ4Fv58fB02EeN8OQ Sfmg== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=uH0jGhf+6tASsTq2g/yvFN9cNuBvNcadwgvlAU5qo9U=; b=dev6dXoOfcdFRLIItHwAOPuZjgKNlbwjJl2kPdg/SHNed311o7RhDEZHIc6lBrLFK4 ObMljFfKQhl5qkNkivJ0hzl/ue4ZpP9q3T8Gi6NnNgrvI3224yiD/DMB4VSqgjpltKuV 9x5mKbm4zCL8pZ5PPWXD5oK7D3LKri5YCsNcOpOrjiPMJHv6HIVbMWx3BMb+Q7OvgkkL /TH1WRNpqBXlLo7DGd+/2dMcMIecyXXfvixcitxWSxSV9tzeMfUBSRkdrPFyGZPmvSY0 1Eg/mta/rV56AeK1q9vF9CAPFAhdLh2MP9JphveLm2Q37X35FJ3P+44ZJdoEvWBfBOEf HkGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="LNqMmM/2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di21si2965380ejc.981.2022.01.25.11.24.10; Tue, 25 Jan 2022 11:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="LNqMmM/2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576806AbiAYN0M (ORCPT + 99 others); Tue, 25 Jan 2022 08:26:12 -0500 Received: from mga02.intel.com ([134.134.136.20]:49181 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1576255AbiAYNS5 (ORCPT ); Tue, 25 Jan 2022 08:18:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643116737; x=1674652737; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=s1cFwXVuWmH1WB6LHxaChd1NCzMYJ5RAUlwC/vLPmuA=; b=LNqMmM/2z9bjR5mLEJG7C1wIwmdFGe4OQPgFs4R0ZgM+KdFSLaUZ5i72 tW7PJ98F7/L8Su432kccOT24jDtsg8LvG/P/GMlYfkjFCusJu9RUPtUDK IoN8UiMQwdMwIBWaZFWypzZeIqxxItQyfJxFXvTIpbQgVU7mJRn40i42y xQOBQty1OyWtPli2kip6OVnwVIBtu+HJvBuSP2M/30TSLAFsjEThC6zEP T64zBA4s2De37WuP1BiKXoHLkJaz1c5loQsf/lwZyJYNKzseZR4VjKFwF /XeuhGhs80wHCdELnEV/2e2ulsvutDvh8G72nonhDhkwqM+MO7cnqVqMC Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="233667539" X-IronPort-AV: E=Sophos;i="5.88,315,1635231600"; d="scan'208";a="233667539" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 05:18:54 -0800 X-IronPort-AV: E=Sophos;i="5.88,315,1635231600"; d="scan'208";a="477099894" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 05:18:51 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nCLhg-00EFxD-FN; Tue, 25 Jan 2022 15:17:44 +0200 Date: Tue, 25 Jan 2022 15:17:44 +0200 From: Andy Shevchenko To: Liam Beguin Cc: Jonathan Cameron , Dmitry Baryshkov , Jonathan Cameron , Andreas Kemnade , linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Gross , Bjorn Andersson , Lars-Peter Clausen , Peter Rosin Subject: Re: [PATCH v2 5/5] iio: afe: iio-rescale: Re-use generic struct s32_fract Message-ID: References: <20220110193104.75225-1-andriy.shevchenko@linux.intel.com> <20220110193104.75225-5-andriy.shevchenko@linux.intel.com> <20220115185203.567780e8@jic23-huawei> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 04:28:09PM -0500, Liam Beguin wrote: > On Mon, Jan 24, 2022 at 05:18:32PM +0200, Andy Shevchenko wrote: > > On Sat, Jan 15, 2022 at 06:52:03PM +0000, Jonathan Cameron wrote: > > > On Mon, 10 Jan 2022 21:31:04 +0200 > > > Andy Shevchenko wrote: > > > > > > > Instead of custom data type re-use generic struct s32_fract. > > > > No changes intended. > > > > > > > > The new member is put to be the first one to avoid additional > > > > pointer arithmetic. Besides that one may switch to use fract > > > > member to perform container_of(), which will be no-op in this > > > > case, to get struct rescale. > > > > > > > > Signed-off-by: Andy Shevchenko > > > > > > I'm not totally sold on this series showing there is a strong case for > > > these macros so interested to hear what others think. > > > > So far no news :-) > > Like I mentioned briefly in the other thread[1], I don't really see the > advantage for the AFE driver given that it's almost just like renaming > the parameters. I tend to disagree, perhaps I wasn't so clear in my points. The change reveals that the layering can be improved. In OOP the object A which is inherited (or encapsulated as we see here) allows to clearly get what kind of data the methods are operating with / on. As you may see the two functions and the method declaration appears to have interest only in the fraction data for rescaling. The cleanup I consider helpful in the terms of layering and OOP. > For the other drivers affected by the change, it drops the definition of > the structure which is nice. So overall, it's a plus IMO :-) Thanks! > [1] https://lore.kernel.org/linux-iio/20220108205319.2046348-1-liambeguin@gmail.com/ -- With Best Regards, Andy Shevchenko