Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2611934rwb; Mon, 3 Oct 2022 03:29:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xWo6a7ECY+SuD7gLrAeG0ty2HlVNSpTycRgWXAyPP6LxCF0cpV4cYcmfLoOelv6A/xT3a X-Received: by 2002:a63:590a:0:b0:439:6e0c:6381 with SMTP id n10-20020a63590a000000b004396e0c6381mr18215132pgb.141.1664792948874; Mon, 03 Oct 2022 03:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664792948; cv=none; d=google.com; s=arc-20160816; b=HGGFPaGcBtDjtnn2LAGogWoP259UFsbNM4ssakWfT0noSpD5eSdjG6VNeZXHIfqjPH n7zt5+SCgdscwglhJKHlhtUycop6dQoqBPH4OpWjGdO9lle8Joahq41jkATR8fbYxLLa QVSGbbE1T/JJF8Ih3qqFErxXDu0Va+qQzb8x6s9ru5Bzm3LS8XwShJSEkAM0QnNpIgBF cmbrqGGsc7jzxReKwCGMDfqB5xE1WURpGH76Pu4sqnShTehMcOz2ulS5SsuDL0LStVxd /5euUn9dpGHtN0fMARVjiudX/MkMtU5voOld1j2DFx13nm1xQnGWeB6ycgBsXw92fpNO fXQg== 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=R+yyver9ND6+1SM4Ue89zitFxNf+vRdPiH4UFNAP7sw=; b=YSkR4wz5LeAkBX3ydlsePyI6d6OsF6FwCaCjUWVJceuSHQWZW0m5NVC7/7j4ACG3v0 vxDs84EbuKC24HUj1SnU0/5RgfQp4I9JC/+UKmZ3pPA50Ut1rG/QBWz6oslRcJuVDeMC G3Atx+Ffk+L+YVol1/aKdo2bgAvGHmkj0mzOW/Ttau94rRkbAVoRwrl8MqtF79xgUvCb VmOKgzjpd4aicejkcPRa7TLJDxVpDItfrGb24kBUkN3WpX1hMIWJQrSg4vjG0AFOQSLX naH5JzqLRKMeU8fhCnxLdfBq0c5ttW1u9F8PjoYB/oy88MWm4N3JXvYydgrNISyXDbsX IouQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b017ZbEy; 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 206-20020a6302d7000000b0044a82d20079si5660932pgc.526.2022.10.03.03.28.57; Mon, 03 Oct 2022 03:29:08 -0700 (PDT) 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=b017ZbEy; 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 S229854AbiJCJp7 (ORCPT + 99 others); Mon, 3 Oct 2022 05:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiJCJpc (ORCPT ); Mon, 3 Oct 2022 05:45:32 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B079911805; Mon, 3 Oct 2022 02:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664790133; x=1696326133; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=5g0KdDz+yWE3/smCFgpv/AmpQhtjfHFM8QG3/rIgCUE=; b=b017ZbEyIBehpk0Pzx6uWsjY/eKUw0pDURo2m2ii6rNSLsXtF7TVB6Hd uXu0HKJBqXRpqAfByhbAM09C5w2Ii3cgQnxjvx9oEvBv13DUtyX5Q9Z90 hCl2QSr3Z0nUDtn5K7wnOSUmkq+R9UIttymRXnOFudRqa/g42FvK0DAlK WMFElclRvLc7QkMHdB/2+RGhpmK6QqbqTF09mOrgxsqy3MhFE0FzEeuXY k8/JokmOFPiVGS+fW+mrzfX24FSnAt2AuGACllfjyI6D1luij3ggiCKbG jl1VtAIYFXigg0t51GbvJn7eZJ568Tcz1i79J4/pVGwJvOxwOIGTRJU4U Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="366634985" X-IronPort-AV: E=Sophos;i="5.93,365,1654585200"; d="scan'208";a="366634985" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2022 02:42:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="574567543" X-IronPort-AV: E=Sophos;i="5.93,365,1654585200"; d="scan'208";a="574567543" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 03 Oct 2022 02:42:07 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ofHxd-001Rjr-12; Mon, 03 Oct 2022 12:42:05 +0300 Date: Mon, 3 Oct 2022 12:42:05 +0300 From: Andy Shevchenko To: Matti Vaittinen Cc: Matti Vaittinen , Lars-Peter Clausen , Michael Hennerich , Cosmin Tanislav , Jonathan Cameron , Eugen Hristev , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Benson Leung , Guenter Roeck , Alexandru Ardelean , Nathan Chancellor , Miquel Raynal , Miaoqian Lin , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Paul Cercueil , Mihail Chindris , Gwendal Grignou , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev Subject: Re: [RFT PATCH v3 10/10] iio: Don't silently expect attribute types Message-ID: References: <63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com> 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 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, Oct 03, 2022 at 11:58:35AM +0300, Matti Vaittinen wrote: > On 10/3/22 11:43, Andy Shevchenko wrote: > > On Mon, Oct 03, 2022 at 11:13:53AM +0300, Matti Vaittinen wrote: ... > > > + for (i = 0, id_attr = buffer->attrs[i]; > > > + (id_attr = buffer->attrs[i]); i++) > > > > Not sure why we have additional parentheses... > > Because gcc warns about the assignment and suggests adding parenthesis if we > don't. Ah, this is a condition, so that's why compiler wants to have a _result_ of the assignment and not the ambiguous thingy. Btw, have you considered to switch to in-loop iterator definitions as we do in many other places? Also, it might make sense to introduce for_each_... type of macro helper if the loop is used more than once. -- With Best Regards, Andy Shevchenko