From patchwork Mon Jun 26 10:51:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 697555 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 5F1C5EB64DC for ; Mon, 26 Jun 2023 10:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229616AbjFZKwA (ORCPT ); Mon, 26 Jun 2023 06:52:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbjFZKv6 (ORCPT ); Mon, 26 Jun 2023 06:51:58 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D1BAD3 for ; Mon, 26 Jun 2023 03:51:48 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fa9850bfebso5621365e9.1 for ; Mon, 26 Jun 2023 03:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687776707; x=1690368707; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SPTIIF/hwEMUUMUeXHyd9tiQHSmtCBdvtrIZzvn0+X8=; b=0uijI9LAqtx+ijFwrhOc4S+NYzZwmPki4bBInpjqFF8uM1YcXrbgy3DkrKX4RxFtdg 1+2ixSXdnEZbWXITmEHA5nIN+SZmWrtEi+h5ZKVJCVnopKa9coW25Rd5Calks+j6KjVl qTnqKuqiSwGIAfXeWcnx4Lj0n4Twl3hCghm3rrmtyN/pabAnk80tl6h9XyT6WY4OJit7 +hjBlwpwGCKD5jR3LDlPdYuRz1axLhbytSHhngXumWqGN4M3pFFKdn2XYf1c1KfX5fph +RLgWSQxcTDOIsTamqcEB4CO6VU0E+/FUZwcL4JpfJ85mnU9tl1CovlSMuLSM1gF9jpo 2EbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687776707; x=1690368707; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SPTIIF/hwEMUUMUeXHyd9tiQHSmtCBdvtrIZzvn0+X8=; b=MkP+N1o5F2dC9giRnwPmstMWm5NtVyNcrkYSSTTmo89c91UUhm602u1C9kJdPI/8A4 FfEefkdKKFU1+GoZ4104anCCcX9ja1DeWjRNwB1FUqv85o7PAM5MIoAomoqhp4EvHcVt 4gatAxUBNmiu3320EiKur770WH+iholR9oJzsDM90KPiYxWNYAg2Vo2DxVuhnD/lZkjA gpNo2wQwvrVK5UlMA+uP3xO+24HogDncKe/uS1D3to9FZ0K/S1LGtIGc5OmrqQ3vvTxC f7GJKAMT/Ou/+HyufCnWjDnKK8HGjz0dSaZkwbEWPB90JnFqj1ZTSYoHOJKAP7sJ/3oH OCnQ== X-Gm-Message-State: AC+VfDzi/6CQdgOxemgp1zj/p1DcS7syyQ587ZjjAxa4F/sVP8yZwf64 gQ4e9oWJqTE0qGldSxUpR5G0+A== X-Google-Smtp-Source: ACHHUZ6AvcD4sFRxDaHzcR8yBjJ+tscfRD8sZN0GeXH6xAXR8GiO4Cqo3oUHUz9XxLg3IHoiVIMlcw== X-Received: by 2002:a05:600c:2204:b0:3fa:8db4:91ec with SMTP id z4-20020a05600c220400b003fa8db491ecmr2231911wml.10.1687776706810; Mon, 26 Jun 2023 03:51:46 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:35b3:b235:7c12:5f36]) by smtp.gmail.com with ESMTPSA id t1-20020adfe101000000b0030fb828511csm6948824wrz.100.2023.06.26.03.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 03:51:46 -0700 (PDT) From: Bartosz Golaszewski To: Kent Gibson , Linus Walleij Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/2] bindings: cxx: examples: consistently use () for functions taking no args Date: Mon, 26 Jun 2023 12:51:43 +0200 Message-Id: <20230626105144.242168-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski While () and (void) are synonymous in C++, we use () everywhere else so stick to that pattern in examples. Signed-off-by: Bartosz Golaszewski --- bindings/cxx/examples/async_watch_line_value.cpp | 2 +- bindings/cxx/examples/find_line_by_name.cpp | 2 +- bindings/cxx/examples/get_chip_info.cpp | 2 +- bindings/cxx/examples/get_line_info.cpp | 2 +- bindings/cxx/examples/get_line_value.cpp | 2 +- bindings/cxx/examples/get_multiple_line_values.cpp | 2 +- bindings/cxx/examples/reconfigure_input_to_output.cpp | 2 +- bindings/cxx/examples/toggle_line_value.cpp | 2 +- bindings/cxx/examples/toggle_multiple_line_values.cpp | 2 +- bindings/cxx/examples/watch_line_info.cpp | 2 +- bindings/cxx/examples/watch_line_rising.cpp | 2 +- bindings/cxx/examples/watch_line_value.cpp | 2 +- bindings/cxx/examples/watch_multiple_line_values.cpp | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bindings/cxx/examples/async_watch_line_value.cpp b/bindings/cxx/examples/async_watch_line_value.cpp index d8317a5..9ea9763 100644 --- a/bindings/cxx/examples/async_watch_line_value.cpp +++ b/bindings/cxx/examples/async_watch_line_value.cpp @@ -31,7 +31,7 @@ const char* edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { /* * Assume a button connecting the pin to ground, so pull it up and diff --git a/bindings/cxx/examples/find_line_by_name.cpp b/bindings/cxx/examples/find_line_by_name.cpp index 983251a..7b56e69 100644 --- a/bindings/cxx/examples/find_line_by_name.cpp +++ b/bindings/cxx/examples/find_line_by_name.cpp @@ -15,7 +15,7 @@ const ::std::string line_name = "GPIO19"; } /* namespace */ -int main(void) +int main() { /* * Names are not guaranteed unique, so this finds the first line with diff --git a/bindings/cxx/examples/get_chip_info.cpp b/bindings/cxx/examples/get_chip_info.cpp index 073a6c3..2bf26f0 100644 --- a/bindings/cxx/examples/get_chip_info.cpp +++ b/bindings/cxx/examples/get_chip_info.cpp @@ -15,7 +15,7 @@ const ::std::filesystem::path chip_path("/dev/gpiochip0"); } /* namespace */ -int main(void) +int main() { ::gpiod::chip chip(chip_path); auto info = chip.get_info(); diff --git a/bindings/cxx/examples/get_line_info.cpp b/bindings/cxx/examples/get_line_info.cpp index f2f071e..7d517af 100644 --- a/bindings/cxx/examples/get_line_info.cpp +++ b/bindings/cxx/examples/get_line_info.cpp @@ -17,7 +17,7 @@ const ::gpiod::line::offset line_offset = 3; } /* namespace */ -int main(void) +int main() { auto chip = ::gpiod::chip(chip_path); auto info = chip.get_line_info(line_offset); diff --git a/bindings/cxx/examples/get_line_value.cpp b/bindings/cxx/examples/get_line_value.cpp index a14d7e4..fe4f52e 100644 --- a/bindings/cxx/examples/get_line_value.cpp +++ b/bindings/cxx/examples/get_line_value.cpp @@ -16,7 +16,7 @@ const ::gpiod::line::offset line_offset = 5; } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path) .prepare_request() diff --git a/bindings/cxx/examples/get_multiple_line_values.cpp b/bindings/cxx/examples/get_multiple_line_values.cpp index d1f22e7..cbd5395 100644 --- a/bindings/cxx/examples/get_multiple_line_values.cpp +++ b/bindings/cxx/examples/get_multiple_line_values.cpp @@ -15,7 +15,7 @@ const ::gpiod::line::offsets line_offsets = { 5, 3, 7 }; } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path) .prepare_request() diff --git a/bindings/cxx/examples/reconfigure_input_to_output.cpp b/bindings/cxx/examples/reconfigure_input_to_output.cpp index 896c812..d55eaf5 100644 --- a/bindings/cxx/examples/reconfigure_input_to_output.cpp +++ b/bindings/cxx/examples/reconfigure_input_to_output.cpp @@ -19,7 +19,7 @@ const ::gpiod::line::offset line_offset = 5; } /* namespace */ -int main(void) +int main() { /* request the line initially as an input */ auto request = ::gpiod::chip(chip_path) diff --git a/bindings/cxx/examples/toggle_line_value.cpp b/bindings/cxx/examples/toggle_line_value.cpp index a17b43b..3dbdb71 100644 --- a/bindings/cxx/examples/toggle_line_value.cpp +++ b/bindings/cxx/examples/toggle_line_value.cpp @@ -25,7 +25,7 @@ const ::gpiod::line::offset line_offset = 5; } /* namespace */ -int main(void) +int main() { ::gpiod::line::value value = ::gpiod::line::value::ACTIVE; diff --git a/bindings/cxx/examples/toggle_multiple_line_values.cpp b/bindings/cxx/examples/toggle_multiple_line_values.cpp index a5b84bf..df55313 100644 --- a/bindings/cxx/examples/toggle_multiple_line_values.cpp +++ b/bindings/cxx/examples/toggle_multiple_line_values.cpp @@ -37,7 +37,7 @@ void print_values(::gpiod::line::offsets const &offsets, } /* namespace */ -int main(void) +int main() { ::gpiod::line::values values = { ::gpiod::line::value::ACTIVE, ::gpiod::line::value::ACTIVE, diff --git a/bindings/cxx/examples/watch_line_info.cpp b/bindings/cxx/examples/watch_line_info.cpp index 414fb06..6d55500 100644 --- a/bindings/cxx/examples/watch_line_info.cpp +++ b/bindings/cxx/examples/watch_line_info.cpp @@ -30,7 +30,7 @@ const char *event_type(const ::gpiod::info_event &event) } /* namespace */ -int main(void) +int main() { ::gpiod::chip chip(chip_path); diff --git a/bindings/cxx/examples/watch_line_rising.cpp b/bindings/cxx/examples/watch_line_rising.cpp index aa3be9c..33e4f01 100644 --- a/bindings/cxx/examples/watch_line_rising.cpp +++ b/bindings/cxx/examples/watch_line_rising.cpp @@ -29,7 +29,7 @@ const char *edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path) diff --git a/bindings/cxx/examples/watch_line_value.cpp b/bindings/cxx/examples/watch_line_value.cpp index 5055789..ebc7fe7 100644 --- a/bindings/cxx/examples/watch_line_value.cpp +++ b/bindings/cxx/examples/watch_line_value.cpp @@ -29,7 +29,7 @@ const char *edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { /* * Assume a button connecting the pin to ground, so pull it up and diff --git a/bindings/cxx/examples/watch_multiple_line_values.cpp b/bindings/cxx/examples/watch_multiple_line_values.cpp index 42b7213..fb71fb2 100644 --- a/bindings/cxx/examples/watch_multiple_line_values.cpp +++ b/bindings/cxx/examples/watch_multiple_line_values.cpp @@ -28,7 +28,7 @@ const char *edge_event_type_str(const ::gpiod::edge_event &event) } /* namespace */ -int main(void) +int main() { auto request = ::gpiod::chip(chip_path) From patchwork Mon Jun 26 10:51:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 696704 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 2F407EB64D7 for ; Mon, 26 Jun 2023 10:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbjFZKwB (ORCPT ); Mon, 26 Jun 2023 06:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjFZKv7 (ORCPT ); Mon, 26 Jun 2023 06:51:59 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74218E6E for ; Mon, 26 Jun 2023 03:51:49 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fa9850bfd9so6395165e9.0 for ; Mon, 26 Jun 2023 03:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687776708; x=1690368708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1C7/K6UMPeVaKpc2goBpmmg0EXH2ya0lTsBtqVi0Iz4=; b=EyWp5pTsXcQ3RAKuVlxtDdUZaCb2z7h/iHFNEv3ZfNVsKS7JN8IYn/zPINcG+/S5Vt Fvl+p+7VTnD7EnA4CiTVnTyK/7vASQ6AJq3Ou476r9uxHbh6I6CskxksN5pjCJvw8n4t L3H5t7+do4s8gza231MYkTzM+BeEcgomugjcAqPtPtULaTeRmZu/J9QBcDGB8CeLNCK6 9UO2BB7V40iEOvT7gVJh2K4d6W+3vYlF4LgY8r7inO9caS5pJ6zYPAxZbhj5tW887YqA FXVDsi20U4bu6H0D7+nj09I5dw2tdvlZEOkvsPD72ana8k+tsja41cHnptBTK5q54eys VF0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687776708; x=1690368708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1C7/K6UMPeVaKpc2goBpmmg0EXH2ya0lTsBtqVi0Iz4=; b=DYEg2Yeo5dqvNz5p+8tFUxTrJrmUHOQCg+3+GGo307wchhl1YnHTGED3FvGjTqIQrF 86C6wQM8PMoqKCOe2KSv5Q/paxdzXcHV0qh9T/YmZLUC/XwCRMMlLzCyd8jz3CMTsGxx 1qisWDxNTIl01HCFzwsxPnN4Ef1Bxjo8c2AUN0H02RIg4sCRN8diZaompAZKy0GpbpbQ ZJRF7kiFrlLTJ7XbqBcWTnbz+4JDorSXASyPegkSxOxSwvofyKUZhgBlNIrCY2vMj6JC cU6GUGAZNAlL8UpiO6z/aLhOxRNQjBFb8L0D5/N8SY1YUbvg9kksoRfL4qMFBFjhUGKU MVyA== X-Gm-Message-State: AC+VfDzEf4khM74pYGaX1Sczn5+Yz//o/OY+f4fqB+eoGlUe3EMpReJO SSwqWM5LJOtgbGRgOhUyJ++kLg== X-Google-Smtp-Source: ACHHUZ6za9tYr1T7x1BWm/keU55U5xRqJz+VPBVKx5Gr3IiCONro5T6X6jMD0gcapiLRy7G62azY1Q== X-Received: by 2002:a7b:c4ca:0:b0:3fa:8028:3863 with SMTP id g10-20020a7bc4ca000000b003fa80283863mr4551551wmk.8.1687776707653; Mon, 26 Jun 2023 03:51:47 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:35b3:b235:7c12:5f36]) by smtp.gmail.com with ESMTPSA id t1-20020adfe101000000b0030fb828511csm6948824wrz.100.2023.06.26.03.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 03:51:47 -0700 (PDT) From: Bartosz Golaszewski To: Kent Gibson , Linus Walleij Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/2] bindings: cxx: use () instead of (void) in line_settings::reset() Date: Mon, 26 Jun 2023 12:51:44 +0200 Message-Id: <20230626105144.242168-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626105144.242168-1-brgl@bgdev.pl> References: <20230626105144.242168-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski While () and (void) are synonymous in C++, we use () everywhere else so fix the only exception. This DOES NOT change the ABI as the generated symbol is the same (at least as verified on gcc and clang). Signed-off-by: Bartosz Golaszewski --- bindings/cxx/gpiodcxx/line-settings.hpp | 2 +- bindings/cxx/line-settings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/cxx/gpiodcxx/line-settings.hpp b/bindings/cxx/gpiodcxx/line-settings.hpp index b043167..bacf359 100644 --- a/bindings/cxx/gpiodcxx/line-settings.hpp +++ b/bindings/cxx/gpiodcxx/line-settings.hpp @@ -70,7 +70,7 @@ public: * @brief Reset the line settings to default values. * @return Reference to self. */ - line_settings& reset(void) noexcept; + line_settings& reset() noexcept; /** * @brief Set direction. diff --git a/bindings/cxx/line-settings.cpp b/bindings/cxx/line-settings.cpp index 272a848..30d7899 100644 --- a/bindings/cxx/line-settings.cpp +++ b/bindings/cxx/line-settings.cpp @@ -179,7 +179,7 @@ GPIOD_CXX_API line_settings& line_settings::operator=(line_settings&& other) return *this; } -GPIOD_CXX_API line_settings& line_settings::reset(void) noexcept +GPIOD_CXX_API line_settings& line_settings::reset() noexcept { ::gpiod_line_settings_reset(this->_m_priv->settings.get());