Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14965036rwb; Mon, 28 Nov 2022 06:43:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf62/PBztP3y66kbT3EmKcfaRyFSQrGE8qyBPdBXU+fpANWtyofZbA5iE/X9a+c63cnsGDZB X-Received: by 2002:a17:907:d005:b0:7bf:b628:8306 with SMTP id va5-20020a170907d00500b007bfb6288306mr4832678ejc.698.1669646626849; Mon, 28 Nov 2022 06:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669646626; cv=none; d=google.com; s=arc-20160816; b=l2DCQFIFK2PXT0JdUsN3pUpCZWIi7/jreWQko4KaZjZB7yWhKynlVw8BvA7377ozY5 GQpCPd+IQaTM3b6jfxYQuptOdihkiANkqTqEKrFVu61WHZqRUDjfSV8d91kG9NdroxKK yoW39m4ck3RENw84VV10HaquaRkOaYqHCQTs6ci5VWIEKsed2C1+UFdgf9YBTNVxnAq+ gylRC4BeCIxVCfgJuHbeaBq1aeTYZQDAkLI2jWDrTtBDgf2wn77LfS07ZeXLEh1cVmJI BEUbGR+3nijYOu6vKOolKNh8hfdCItHxQFDzp4sfQrUcQFVSl/G0vqc1ymefN7GDlVsv 2+fw== 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=S9KERcve+P6GzOI08gVn7NOOu2NUSjRLYfzFFc7wnDo=; b=vC3860FfdCOeZOuyCw16sQ+Kmxroe/kylYSAo74+HBV6VwfD1HvOaO0rAzngoY9oka D2OOwfpOCXiZuHIJyvw3aiDobDPuqrDZKnXpphLZ+508fv9y2NkJCuXrhxI8IVmq3aRb LrdYTEpINc4UsRG83OzDCkrEOFk870aOUdAMH6po5jfxyvvOnNNvZnOn+as/ti6oBrAE WxJtZR7PMp8lB4Ut70u4d/AJPi1KcfEA1yHIGSqnApt4fXEJb7jaoAvCPU6DYmRDGk66 dC3yfbAIUeeBvp15J/IcVj8QUjBqfoHMGQqJ77Qn+q1ZWH8p9RCYyMgUi97PhftH8Smv an1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gO1dsKvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh17-20020a1709076e9100b00779f8e7ec5bsi10496607ejc.42.2022.11.28.06.43.26; Mon, 28 Nov 2022 06:43:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gO1dsKvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232361AbiK1OG2 (ORCPT + 84 others); Mon, 28 Nov 2022 09:06:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbiK1OGR (ORCPT ); Mon, 28 Nov 2022 09:06:17 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B406C2124F; Mon, 28 Nov 2022 06:06: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=1669644369; x=1701180369; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=kK1XSdb8aoZkJ8xeQsAIDo4KCW0OUls0hSDk9JxDYEU=; b=gO1dsKvX0Xc/OEnGUxrN8sB5/1HDwKzgj/2JF3OCdd0Ys5fkb8hAS0Fw uQc2Edl1y8p+YAp+69tAjzI+nJkn7FcRsXWe//UzxJqvxGu2wPQnjtsNQ /e+jqBvvIdEU++oBoqh8BlxjE2/72RgW8El4gA6dLZaP7ATpI2s7Crtd9 h3mr4FDC/8IN+i6oRUjXd1oKrfRCFBOlvMhq6LWBfJq3JU2GQkt8Y4vqv /eTZNtdFr2esZNuYIZqgsVv02TivlWhLcAGseajOQ3Eq8ayGTrxF8VchA rB7imVtmZhtYK2cIyJf96uyMfBYZCmlpjDtrmIuRFUpWja0GXzGUP3DqV g==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="379096714" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="379096714" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 06:05:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="785640121" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="785640121" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2022 06:05:13 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ozekx-001AIf-1z; Mon, 28 Nov 2022 16:05:11 +0200 Date: Mon, 28 Nov 2022 16:05:11 +0200 From: Andy Shevchenko To: Michael Riesch Cc: Gerald Loacker , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Jakob Hauser , Linus Walleij , Nikita Yushchenko Subject: Re: [PATCH v3 1/3] iio: add struct declarations for iio types Message-ID: References: <20221125083526.2422900-1-gerald.loacker@wolfvision.net> <20221125083526.2422900-2-gerald.loacker@wolfvision.net> <4d1b0054-efd4-e10e-17a6-d236052afa49@wolfvision.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d1b0054-efd4-e10e-17a6-d236052afa49@wolfvision.net> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 28, 2022 at 02:48:48PM +0100, Michael Riesch wrote: > On 11/28/22 14:27, Andy Shevchenko wrote: > > On Mon, Nov 28, 2022 at 01:18:04PM +0100, Gerald Loacker wrote: > >> Am 25.11.2022 um 12:01 schrieb Andy Shevchenko: ... > > It's a rule to use _t for typedef:s in the kernel. That's why > > I suggested to leave struct definition and only typedef the same structures > > (existing) to new names (if needed). > > Andy, excuse our ignorance but we are not sure how this typedef approach > is supposed to look like... > > >> or > > > >> typedef iio_val_int_plus_micro iio_val_int_plus_micro_db; > > ... because > > #include > > struct iio_val_int_plus_micro { > int integer; > int micro; > }; > > typedef iio_val_int_plus_micro iio_val_int_plus_micro_db; > > int main() > { > struct iio_val_int_plus_micro a = { .integer = 100, .micro = 10, }; > struct iio_val_int_plus_micro_db b = { .integer = 20, .micro = 10, }; > return 0; > } > > won't compile. I see. Thanks for pointing this out. Then the question is why do we need the two same structures with different names? -- With Best Regards, Andy Shevchenko