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 DCAC1C46467 for ; Sat, 14 Jan 2023 11:16:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbjANLQu (ORCPT ); Sat, 14 Jan 2023 06:16:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjANLQt (ORCPT ); Sat, 14 Jan 2023 06:16:49 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF955B83 for ; Sat, 14 Jan 2023 03:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673695008; x=1705231008; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=AtkgXgt5j16NKe0K+x8e8+yyT45kTDI1lTzq4iI1vL0=; b=YOvzdWvM/QrFGy5OI8PhIUIvjdnjx2ywEC9gm0l5Wjk6t6Of8DD3VJo2 rqqzvy5v9OBtRUfBWrTztlR4SulXJfn3bJzeVbt6xAA6X6MVA5yDEje/B at/LZLnkWbaPS/sXHLUSNJ4NE/i6yteB7txq9q2zTUrG30mq/JEQD+FPf R+Xbi/RWX5U/D70GIFlEJVlKFtXGgn7Pl4Ko+Yn/H1rvXmVdReu6d9aUz DTZBFmG1zZX1FRWj2KJxafsvyJeIPwtI/OqjnZCsDrcwKtHBumXATwToe j8t8mg0xyESdgp4sXtvnSXiQ658T35LX6X/bcyNrYMnXIFpoRwx5Hl7AZ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="303881619" X-IronPort-AV: E=Sophos;i="5.97,216,1669104000"; d="scan'208";a="303881619" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2023 03:16:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="800881902" X-IronPort-AV: E=Sophos;i="5.97,216,1669104000"; d="scan'208";a="800881902" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 14 Jan 2023 03:16:46 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pGeWj-0097hv-0I; Sat, 14 Jan 2023 13:16:45 +0200 Date: Sat, 14 Jan 2023 13:16:44 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Kent Gibson , Linus Walleij , Viresh Kumar , linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: Re: [libgpiod][PATCH 02/16] tests: avoid shadowing local variables with common names in macros Message-ID: References: <20230113215210.616812-1-brgl@bgdev.pl> <20230113215210.616812-3-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113215210.616812-3-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Fri, Jan 13, 2023 at 10:51:56PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > The name 'ret' if very common for local variables so change it to _ret > in test helper macros to avoid potential shadowing. Makes sense! Reviewed-by: Andy Shevchenko > Signed-off-by: Bartosz Golaszewski > --- > tests/gpiod-test-helpers.h | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/tests/gpiod-test-helpers.h b/tests/gpiod-test-helpers.h > index 2d86345..b40b820 100644 > --- a/tests/gpiod-test-helpers.h > +++ b/tests/gpiod-test-helpers.h > @@ -118,11 +118,11 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(struct_gpiod_edge_event_buffer, > #define gpiod_test_line_config_add_line_settings_or_fail(_line_cfg, _offsets, \ > _num_offsets, _settings) \ > do { \ > - gint ret = gpiod_line_config_add_line_settings(_line_cfg, \ > - _offsets, \ > - _num_offsets, \ > - _settings); \ > - g_assert_cmpint(ret, ==, 0); \ > + gint _ret = gpiod_line_config_add_line_settings(_line_cfg, \ > + _offsets, \ > + _num_offsets, \ > + _settings); \ > + g_assert_cmpint(_ret, ==, 0); \ > gpiod_test_return_if_failed(); \ > } while (0) > > @@ -147,9 +147,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(struct_gpiod_edge_event_buffer, > > #define gpiod_test_reconfigure_lines_or_fail(_request, _line_cfg) \ > do { \ > - gint ret = gpiod_line_request_reconfigure_lines(_request, \ > - _line_cfg); \ > - g_assert_cmpint(ret, ==, 0); \ > + gint _ret = gpiod_line_request_reconfigure_lines(_request, \ > + _line_cfg); \ > + g_assert_cmpint(_ret, ==, 0); \ > gpiod_test_return_if_failed(); \ > } while (0) > > -- > 2.37.2 > -- With Best Regards, Andy Shevchenko