From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF579C43217 for ; Mon, 28 Nov 2022 14:06:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232311AbiK1OG2 (ORCPT ); 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 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