From patchwork Tue May 28 08:25:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 799649 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AD0513AA32 for ; Tue, 28 May 2024 08:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884762; cv=none; b=V7oMa1r8OKRd8cdf8X/ZFPS0ujWEfmem5fkLRD/Wl9xwd58nRcrpN+nw1oEJaxXk5/n1UkwSKtioXFk+6UY3vW5zh0S4Xj2l9eA+bjZsnXjK8Q9/UJRJJGMYyMMROYsIwuslJkNj+i/x7gbP3SzT42OEXPt41OfzFfdRnhOR+Aw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884762; c=relaxed/simple; bh=1GyvaNvfpUaEvNsFHnNWVs/AwwJFUlI35Md9Z/n30BQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Oq5q6RzemRsLIq2OzPztGp0KKe4Q7aRkt3ICtSvBlw8+Y7uzUHYtG++QxGx5D068ejmtTMBxxm2PmLL1z3tbXEHhfKGimAMLsd8ppIXoelrxZ33utDBQuB92FtzOptzs7Sng6vXcjiKqr5fiNmPt8UU9olwv1FYbgI0o9fSDBa4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=hQ4YZ9jO; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="hQ4YZ9jO" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-420180b58c5so3866965e9.3 for ; Tue, 28 May 2024 01:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716884759; x=1717489559; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uKl7FLzd4c1z0RWK+9MURhj1M0dXFZqZSbP25u6zhN0=; b=hQ4YZ9jOhZzZQbBYAkQ0kf8ok/gKZyddnPo0izbklgQ60GmeLqmtLeGapSJZ976Vs3 I4qkwm6cv+iSLOKAiQYBI3OLPulhpWI07bdL1gqQrHHsEroj9prGTa4r4t/e8L5rFVhp Wu1VEOJ532DxRB7mxRNN8J2eg9d5ngNpw9adCacmyLYDhpvfNKnt3ZL83RWTY6LLnHbB XCjYa7SyjQN1CZvbFIeuiMNOVYtWTE16wAz34BhF6zuXMoU1eR6kORrpGLXuYYN9BXhe D2qfNJ2nhF6xLNyACvwlI5KoaPhNKLJ1bmJSGQ7AfHk9dbGyqgZYCaNFCCdc0upUiKXE SwDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716884759; x=1717489559; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uKl7FLzd4c1z0RWK+9MURhj1M0dXFZqZSbP25u6zhN0=; b=Kn2hssLhzkueG5S3lRPG5FUFd9zNRWuYJgjnYy0IbxP4lhelhjXqJxERSJnf6M2NrI aaR547KiznKI3ZXgo8G/ZSWJ7S1CSG1w1sbrA1yF//q76ppvTNmN8Mcnb16rfQe62rDu yRf3kIwWLdkdpv+Yr2jSwPEbU4h3n/PKjs8onB0pJ5vbghOe0/BmhtUcFdGi6JhPoheZ mI4U40zJgGx7/7CtuTpXkFhCr6gsS4exqbQWVxKsC6XfE8b4hCwKfoiAlczMzP53IeYq MNbLwPIBVysX9ebKwrOK9eabKY4fkpCaHgU5wjpN78SzjidZYlK+xlkQQdYXn6Tgpo1E kOog== X-Forwarded-Encrypted: i=1; AJvYcCWAtypYtzrmXe82oIyQnr6HR8rM5CD4hlF93vM7vRAP1hgbRhihAKvruzaaCcodaDUNYNU4/gbrOKlVNETNv35i+UcMQJFnmZXNGA== X-Gm-Message-State: AOJu0YzasajCgtWA6nBgztY8e19coaOORTMx/XODhJic2D8xztqvtmZj Klq7DDJWKZozD7b7jEP79XNUNBsIpcFimpYtp08+PFb2qNNMebqsjNMmshxcEiM= X-Google-Smtp-Source: AGHT+IFQ0U5Ah3+NQHgXg1o1RbDKW2TZVU2vwltIjB7MPXs1e61jRTtVHlg7soGReh/q2xEx704Sig== X-Received: by 2002:a05:600c:5806:b0:421:877:9db7 with SMTP id 5b1f17b1804b1-421089b2232mr83714895e9.2.1716884759386; Tue, 28 May 2024 01:25:59 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:93eb:927a:e851:8a2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fd37d5c0sm96207545e9.1.2024.05.28.01.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 01:25:59 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 28 May 2024 10:25:48 +0200 Subject: [PATCH libgpiod v3 1/4] tools: tests: use tabs for indentation consistently Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240528-fix-bash-tests-v3-1-e9b5be2ba8bf@linaro.org> References: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> In-Reply-To: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> To: Andy Shevchenko , Kent Gibson , Linus Walleij Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1105; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=PHUzz9u14ti8fJ8sk3Q5oiYwXdrwukZ94ljgxiqUlwk=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmVZUV8PAjl5XmZ2Tdr5e1/9L6E28h92/e9MgQq fo17Qk/48aJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlWVFQAKCRARpy6gFHHX crzlD/9hKgUz/+2Gy5fWOzZHshUWzHXHfhjVUzwvA4+rXp3NZrHvBEUUgLDQWtPJ9qgLEiNiFuZ S2nO0H2WkrGsjXr4dFFfUPB/2xdj58n8lyTzexTwL8h0OAgetac/zGJoagBpKkfA5QBw6krz6pf HXuGMIYJj3LdMDStOKCl55BJoHJtd9qaTf6uoI6QLe6m7XfWmOI0QocVi1oBvtLVWHu3MrLwkwn mJyJJSG3qSjH+dzeKQ91VAKuwkg641e32nQnifBuG7/59ui0QjTMxIwBWwHCvWyb6GKCXn5lNRn e5XGJ4UEAWeGX9ilYFT8/y51Zh9Qgb/7JI6B6DOkkR8tiswcUD8wcmHpAl8uHWme8CpOdb4zylg sBvIKKQxtoAPCuQaUnq+ewCWeYP3AHjfjBWvmumEoZ9kSCzCq6Hecd5de3CMeicL91MKQWcoB6n tqb8PkwYJRplrygD5iVROUdAlTHERR9czfBMpKiEAh1uMZ9+suInEC667shDDGgHr9+N30pIolk qA1crUs0RVrJcqxV9rsAPh/8fqMsN5gtcFb1td/EALT5Ut9K3oYQj+j+IN7zWzHh3/CVXBqD4Nr G5zD5mSWK7SNsamu0Md+6Kd7KLqnjMgQ2Y8Xqtk0V5IsXPVJ55OfqY8ltzhxel9ifJqptyb2unl EsV3vQJIOVBzBSw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Replace all spaces used for indentation with tabs. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index b55c5eb..abb2f5d 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -203,9 +203,9 @@ dut_run_redirect() { dut_read_redirect() { output=$(<$SHUNIT_TMPDIR/$DUT_OUTPUT) - local ORIG_IFS="$IFS" - IFS=$'\n' lines=($output) - IFS="$ORIG_IFS" + local ORIG_IFS="$IFS" + IFS=$'\n' lines=($output) + IFS="$ORIG_IFS" } dut_read() { @@ -269,12 +269,12 @@ dut_wait() { } dut_cleanup() { - if [ -n "$DUT_PID" ] - then + if [ -n "$DUT_PID" ] + then kill -SIGTERM $DUT_PID 2> /dev/null wait $DUT_PID || false - fi - rm -f $SHUNIT_TMPDIR/$DUT_OUTPUT + fi + rm -f $SHUNIT_TMPDIR/$DUT_OUTPUT } tearDown() { From patchwork Tue May 28 08:25:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 800082 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8958F13B5B9 for ; Tue, 28 May 2024 08:26:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884763; cv=none; b=dHlsP82XIvtXfbBBDHlLphLm03XysRFoJ4xo/eG6n3xivynY6G8gf+laSKUSdFQpaVM/nIMif/VRIW/KwY3uyd91q8aevauJHCOR9oZpTBpVIPWDeRezjmLGrizBE28LBWmqu+E0E56FQ0+cjynFEhLHO2xCKIjUTlyxGLaycnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884763; c=relaxed/simple; bh=klHfus8SVMvCGgrlbX/CZqqjTV5MdkCxknBc/bECvKM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z6sFbzorZ1znb4Kxl2LvrfUOZmF9yg58mtwTNma/1lMli8PRii7qPozB/Hai3v05MEy1BO/Ta7w6NR7uih2r0BnboLR1JUh7wymSi/rAGrZ2UMCQ6iXYL0rOvHbBjfnMxAeV8bSYMOCcLtb4+3wbMk4XUMDHK8tRISyFlscLxis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=25ZyqnVo; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="25ZyqnVo" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4211b3c21d6so4164105e9.2 for ; Tue, 28 May 2024 01:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716884760; x=1717489560; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=o3YHRV+Kq7u1W68iAfPZ68X/iHDeFHYB7fdytNZ0EHA=; b=25ZyqnVoGkXuDs3Wm0tfMVU44HeGyymesOhBIypEUZwkQaPBa7zkzAOXH9+Nm9hpV0 D2o/44PydS7F/mqWs4mK8u//ucwHsfSONg3Tp3oldg9qkwahZ0WcXShDHXvWy6jUdVsJ jYzR7aXhEEVijQ5KpdwhFhJ/Rd1w5C59dAOyMPy/IWVdKMxNiqqlL21e4TfsT9JHVPl6 t2dGsXaN6hU0o1iq4zu8tDjWMyEt1uv0mNtK4WgcRTQ9ydyl5TIpsTqb4YiIrsJys/xo cqFKDE7qRg1QyY8uN6LRvFLD5D+tWCPgHrvNb725CRGwuox/0Ae13owWZ3UjNEnsab/O rFgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716884760; x=1717489560; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o3YHRV+Kq7u1W68iAfPZ68X/iHDeFHYB7fdytNZ0EHA=; b=CcJeft4sUZNlg7qqInkfcbtF6u9alIwe441GrStufT5OnNGHkye2Hm3hoLV+QYJqsb VuG/e+fxbSIaW88lZaYLWVgXjF5IGWLf41Pzoh4dfiREMfZp9tjmmqCYDgFg/SiEqfu+ suBjzRwwSZyjWAhKEcvLBI5sAofD1DJv9DZGn0W9K79h37o+AN08BVgvxCaaMGYv94f/ iYiiREEuhftpb6MQNQ9GocskRMYWGDOXUZqLxIEn9p20fIBv+ot1ORGM/GD17rJ76Ej7 ZpukCePCOlQFgEi4HDNlPlR556CMX+c7EjLEcLL8AI6Feu+Y5EOpB+uw9eK05vxqFyWs 1MMw== X-Forwarded-Encrypted: i=1; AJvYcCVT9cPxfa5012+HrEDA2pwez061TZIO34Covse9HFotuKMzdKVeYmwAoA9dPdg5DSlUWErrg0V8MvwT46YcFd0dCqO/wfqUKY1MRA== X-Gm-Message-State: AOJu0YxnQMoGLpZhV3D75lg1DW5bXV5rwO5DT4rwqQLW4Aq7a42JiIbx /uKRKUbMpmP3WFUmiK9cqlYzulJcDuDfDG7oNSbFmStQoGFUKmOEXnysOZBAm+w= X-Google-Smtp-Source: AGHT+IGZF9WGcZNvR2mZSyngYiTphUxcxAzZrUGnBPA2rVuErU1V68h/eGLm/1eKryX22fVvCqIIIQ== X-Received: by 2002:a05:600c:1c04:b0:41c:2313:da92 with SMTP id 5b1f17b1804b1-421089ebd32mr84498055e9.4.1716884759990; Tue, 28 May 2024 01:25:59 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:93eb:927a:e851:8a2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fd37d5c0sm96207545e9.1.2024.05.28.01.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 01:25:59 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 28 May 2024 10:25:49 +0200 Subject: [PATCH libgpiod v3 2/4] tools: tests: use "$@" instead of $* Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240528-fix-bash-tests-v3-2-e9b5be2ba8bf@linaro.org> References: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> In-Reply-To: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> To: Andy Shevchenko , Kent Gibson , Linus Walleij Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1485; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=whhnBTsGyl3h/1vkxXUTFzm/k6+sEscjnXCBeRQUyw8=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmVZUVeOE2ub6KQKh9dKTXGKIs8lAxdzD8zR1xF EF3EcbGQj+JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlWVFQAKCRARpy6gFHHX cqFuD/4gM1HsY8MOog4/CJbSzuHb9Es92pfJPgDPFxDOKdjmFSB+APO393uRNMJi0EmvWZCE7CB 8KKcT8EM5kuyuPFz/Sa7jYleTJIrxXZhRDEpMV5knXcNFHYz7RtMyaxEmGgmSqenlP77AjtBUcY PlTIhg05SClvvsehdECK/nVVbX9Ts2JxR/t0vJvb4usE9ntcQE+sdITAJeKku1jyfKRiljc8D6X nRMUkOMPGPnBIR5+ndJedzjbiYM9aWTICYyeJ6XaVCHCZsSG3t/RABnO647NR/79hPv8KCOmmqg eeMRqksU/IZvVA0AKRHcXCthFaizNJI+uRA57y8SPeCoQJL4vqm+x02pSb3B+Etr2Kq34RX2wRs oQbB6cHudt9ydfzXIuBqBoMSh4oDsZmz03xsd+5QY7k4CIjRp8RJ3eraASBdcTpV47IlNfXBWkb OEnB7g5Qg02O37/tvp2NXyDvkLYL74/DGCidbgMA7eVknfx/+pHkRc+ARy11JhpXHfxh5wLPC7p J1TE95s0poh1xBh5/ZoTrNdv/+36eDCou3151rLbF9BDbfb71U8goyoNWZKt6sRHYPa8Cgd/3nn N/ZiyS2T5KA9zu2HiF5UQZo4GcCQNbBodJC6bA0QqxRu9FfOH8idZtABVMcdHccdR0cSSVev/0h e14+bSNqPBTznhA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski $@ does not break up quoted arguments which is what we want in all cases in the bash test-suite. Use it instead of $*. While at it: prevent globbing with double quotes but allow variable expansion. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index abb2f5d..1bd7d89 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -27,9 +27,9 @@ GPIOSIM_APP_NAME="gpio-tools-test" MIN_KERNEL_VERSION="5.17.4" MIN_SHUNIT_VERSION="2.1.8" -# Run the command in $* and fail the test if the command succeeds. +# Run the command in $@ and fail the test if the command succeeds. assert_fail() { - $* || return 0 + "$@" || return 0 fail " '$*': command did not fail as expected" } @@ -71,7 +71,7 @@ gpiosim_chip() { mkdir -p $BANKPATH - for ARG in $* + for ARG in "$@" do local KEY=$(echo $ARG | cut -d"=" -f1) local VAL=$(echo $ARG | cut -d"=" -f2) @@ -253,7 +253,7 @@ dut_regex_match() { } dut_write() { - echo $* >&${COPROC[1]} + echo "$@" >&${COPROC[1]} } dut_kill() { @@ -283,7 +283,7 @@ tearDown() { } request_release_line() { - $SOURCE_DIR/gpioget -c $* >/dev/null + $SOURCE_DIR/gpioget -c "$@" >/dev/null } # From patchwork Tue May 28 08:25:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 800081 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E888613B5B9 for ; Tue, 28 May 2024 08:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884767; cv=none; b=TU3ZwYtSzPMT0UfaLQsdZUL3cI7mKQbpy/BysT78jioOYGiwUFZg4iYzxLB2AdCsDptG0625qbcxP90uomRyzdrmaaF1zmKNGRW37fmRnsXbierg2sBW7BQJV9wOPp46sY4RhpTQO21N0x/GZ5rmhGg4RuOUcapv9aogqMuN0RA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884767; c=relaxed/simple; bh=GAEE9E5pxIlTtypsNRbue75lfPMNqAE/GTqxio4TpJM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r+t3ARbHnLaW8el/4H35dAvSzB6GbEAClxH0ooRBOee5r5ox4BlEgXiObQ9waXt4cSV5G2IPVMNp1r3rDenlpcFmuOSKNYNgUqHtUy9mJ82tok7xtkiANBmW5eM6C9q9PbcOqP9gPViPoKdhfgcX8VICxPnIduqpqLT29JvQN0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=xR7/853O; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="xR7/853O" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-420180b58c5so3867105e9.3 for ; Tue, 28 May 2024 01:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716884761; x=1717489561; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PUSYzkcmz/5Oy1AGbRpHSlMVdz0s2mXKMHaOTb3Fihg=; b=xR7/853O0a9mhuvJbl5F/VFdsjm80hwqz0XyoQrHBiu+DOSZ4FRZPVq/Y0rIE3wu1c AmAw9CxHEkUjrMnJjfR8i7SY/m5IRw/NpcwifcqyssTDQveaTo9ZMBnBPVTUB2ZCJX8b essMMb1hvnmfSo9FQ/jx7OQDRCJ1g6I6uFLSkt6WqroCv11zv6vdi8FRLV+1N8d6HYFP S3NSjbwusov2L216YgrEs3iNtrhwnPc1wz1dE8DJW8j6lv5UT42fH0tw6qCwJT7gd8BY VAKdw6Dx6q3rkbjw6q0E6aF/hQanY2Ex2r+NOn3ccmKeIJYOjhlWqFJ2Tq3YHRZ7swVG bZZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716884761; x=1717489561; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PUSYzkcmz/5Oy1AGbRpHSlMVdz0s2mXKMHaOTb3Fihg=; b=aY3l1zQwlgI/qDHnVT2ufAeHA4rv0JwoWVvomCW4kgqxeIW1KeBW1PPzC+MdEcpNAA hRPRgM28TteXlyZARl8Yk/95s+kBsgjLVzH8ZwKYeM1aXPo00DT54rFQCQXFeNKI7FyZ Pf/8d7WAaNGZfHWJ8NnLlqRRVFbjEbCM14JD5vLUhaUxS149c5NTQ5NQ9pfZRFjV7esN hDLWxFX2h/jah3HjiRlnDhKlyE9nidPfF9EV+VngaFjsg4cOFSNWqdQ0qDuvCJFO1ZiL DF1/zrpRoWcPxbraiOsZxvWvQ3dP0DnJM+Rp5bIUtjmLL3kJyLDgmj0t7vdtzEX3nMUj OeVw== X-Forwarded-Encrypted: i=1; AJvYcCU5fdVAS7m/0zxHrsA9ZNgPKXwpu5H3y4KSG8JsRk5zF/cDZO5s4VCbmpULSE6d5tKSxXLpIVDY/MnoVUsvaVgowRRNJcXCcSx/dQ== X-Gm-Message-State: AOJu0Yzz7SMsZ6uzkfXe47iwtcR1HxsmOa96Xwc+vBc5vgQmtieDEVE6 pyaaldMTmk0XhGOZnS432vThFn4tDyo3VioUcFZRD05XIrL822b8gnHp4DgywwQ= X-Google-Smtp-Source: AGHT+IGjuFpnGYHnqdSiDJap9Jf+xrb2ePuAy7CL8VEitVplGnXAktBbjZdaoGUg6NkanhIQWOZClg== X-Received: by 2002:a05:600c:56d6:b0:41f:f144:5623 with SMTP id 5b1f17b1804b1-421089cd2a7mr76406905e9.14.1716884761304; Tue, 28 May 2024 01:26:01 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:93eb:927a:e851:8a2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fd37d5c0sm96207545e9.1.2024.05.28.01.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 01:26:00 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 28 May 2024 10:25:50 +0200 Subject: [PATCH libgpiod v3 3/4] tools: tests: remove unneeded ';' in while loops Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240528-fix-bash-tests-v3-3-e9b5be2ba8bf@linaro.org> References: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> In-Reply-To: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> To: Andy Shevchenko , Kent Gibson , Linus Walleij Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=952; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=riNlIxW4Qfkkk/Nr3YxVgXIhisEwGSeSulI++INvgps=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmVZUVrKXhqv25I2smuoNUMQFfl7SPEjd4AEW6x BwW8AdeVwKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlWVFQAKCRARpy6gFHHX cg5jEAChaBBeHgWeuZfxo5vm8YlN9gV+cgGilD9dNeoHhCUcF++vqRzROAJnVwLPq1agoytYLnH xmG2s2quA99Rx+ODbo+U8aIFPPqANXmK6u8Fbqu+CsaGVkwMnN6NBMDlGJBH/DMCh3vUgCiXXkr JseI/8Du8YpxUplbTbDxmen5/RF9PYbclyc05AclRAjEbQpDKaB/MXrRnUuLs21yCU4/eI0Fnye mYtpFV/8uGZvz5J2Xy2t+Lx68tfVnd9eo7NfarX0z0wheDLAq2op64zrxuQBuiX7pUkjqprwFt2 mjKRs0mz+lZvQ5s18em8hEmuob2vAB1Mj7VEGVo5HBx3GVhjep4K+mUvaBa2aDoqmfoWHHJpVsY YYpB5sOxhjKTm25kUS9So9zJyMtkkvVzjmBbtikH+9rCY50O5unyRJ/+E20l6xCILcLrkaNIRwX OBBoEsO1wriqPSw00h3ElolTLURVcLklOTOxrXUennvE+feDxKD4Dei28LzraOdltzXqFQLlxCh 7bUIeZgxICywKjxqJxr3tRhBOUI58/KzIik4bdI62x/Ity2mz2auSAJh0X3OwvtRXP2PxQvcnE3 g/OV0bBM1iBtvnh2y1m/DXd7r7xoq6/+WZaa5aCkS2oaQ23xkswPB3FyOw4lwMBHleDUOnsR72U g1NuUu9bxPZZCvQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We're already breaking the line between while and do so there's no need for the ';' character. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index 1bd7d89..b6809f3 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -211,7 +211,7 @@ dut_read_redirect() { dut_read() { local LINE lines=() - while read -t 0.2 -u ${COPROC[0]} LINE; + while read -t 0.2 -u ${COPROC[0]} LINE do if [ -n "$DUT_FIRST_CHAR" ] then @@ -232,7 +232,7 @@ dut_flush() { lines=() output= unset DUT_FIRST_CHAR - while read -t 0 -u ${COPROC[0]} JUNK; + while read -t 0 -u ${COPROC[0]} JUNK do read -t 0.1 -u ${COPROC[0]} JUNK || true done From patchwork Tue May 28 08:25:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 799648 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F4F013C3E6 for ; Tue, 28 May 2024 08:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884767; cv=none; b=XOrrz4B8QtaAOTf5NNFpDhhKlyWnP/nWY5S8Aj83g21oWVFJa/HVBQvqHQugk/nt3FTRp0vnkzV45ZmRJBv9uxmUpGdqKEd3K1jdXqGThLzY153sjFqwX+5FdNUgc59dLPf05Gvbafa46PYYrNelucBkAfKAf9LHgI0nf4+leeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716884767; c=relaxed/simple; bh=jIGQ2BJVAEjs1wA9Zq573W5bU5CLum6ndnTg1nG81z0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sBZrD6QhBIlc72QpVNxgbVJnx5Vwzbxl0jqGnh1LT+9+lQ1zefYUbn2vuQVSgGPcxPwaPuJwjSq0jteQZfWaEfwxTk6knAUZqYRg8iecUfuPtDQMHE0C5/vWnP/Rihh89AuU/1xJiKvZYwwjMKctbUM8+pArsIOhynoDOOKryq4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=QowjVGHq; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="QowjVGHq" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5295e488248so669381e87.2 for ; Tue, 28 May 2024 01:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716884763; x=1717489563; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cX5B+3J7GsQpKqthqaeQGRlKEHRzAlDaL7dj+Ot1xsM=; b=QowjVGHqPjQLC+Gy0A4vleevoaNdzJAzo1dZLP5Kk8G9mUHg0KnT7iUmH/vnuIBaxa 4jtklwJXs2kVjlTNDSv4c6DIVGWBPvmUf+FRaLbOFN7xtJT7CbaUXnJlVI+e0fftHqM3 3ucXQ9FKXLOqSi+hW6Shyg4Kf4JC0hUwGJC9j//4CubcqJZ8N+LxplK56sd3tPeL5e9J iTrDmzU+WFt+3gyU1Q4jqJxLKsnY8fL4rc68lR7HIZlHiSBjvan2CYzlyQpahkpnHOl+ W76nIA/MvNlZzlrTtBcTqYNEsp9ocatMbJxoBO9caKCL6bCyv6XqLZVwgw7cVAHdUG2q kQQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716884763; x=1717489563; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cX5B+3J7GsQpKqthqaeQGRlKEHRzAlDaL7dj+Ot1xsM=; b=oG4ADL1ZO3gg19NrKFexoOFdC1N/wK+rSrni5iA436xFweLCfsR5JtgQILXActUKwA 2eBlsqysI8yBToWbNTEjVFPHpOytvEs86M8NlF4I0cIBr6Dww+SuU+J0o5hl8AvTaoLA GTjy89n247ghkLeOG9C+d1SX5TyTM2PjdZev8OTIF7Wa89/t2OcsOHh18F5k5BpoGcsK TT9PHOfnUo/dsxolt0is5duZkg/QPQf1kv5UEW9CDTuNVkQYViKl4ZD9Fu4t2J2o1/CE atKRd/yQ7eO2Tog4MuK2UaSnGAUzjjma85Dzb5qWmLcoUT12SL6ICxUS94rjNSPBNJrH GZ6g== X-Forwarded-Encrypted: i=1; AJvYcCX4EokosBwIDzgY1ZwtUDqjsvVQyJhOi0F4cTY9sZy3eaEeV5uqQ2CT23WioxFi05LcQPnUZ3DZTmdpbyWTiiMutaAMTjR4rkMsXQ== X-Gm-Message-State: AOJu0YyGnJ9HUjYMpNhTXc1DD+pR5MX5ipu+lDuixh9Cbjr65tuFvvp8 NcbU8gA/YOP0nlT+jHRiK4Utevu+snNb+Wp8BvSPpN6thlI+nF9028LUDnhF/Wo= X-Google-Smtp-Source: AGHT+IHj26gLYTlDdPuRwoleVEFABekQ7wWmkNVCG+el7kLT6ew/bfL444YzBXcTZ5TuS+q9JOk5uA== X-Received: by 2002:ac2:4e70:0:b0:523:5dcc:c72 with SMTP id 2adb3069b0e04-52966ca8c26mr6147553e87.57.1716884762680; Tue, 28 May 2024 01:26:02 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:93eb:927a:e851:8a2f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fd37d5c0sm96207545e9.1.2024.05.28.01.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 01:26:01 -0700 (PDT) From: Bartosz Golaszewski Date: Tue, 28 May 2024 10:25:51 +0200 Subject: [PATCH libgpiod v3 4/4] tools: tests: remove dependency on grep Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240528-fix-bash-tests-v3-4-e9b5be2ba8bf@linaro.org> References: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> In-Reply-To: <20240528-fix-bash-tests-v3-0-e9b5be2ba8bf@linaro.org> To: Andy Shevchenko , Kent Gibson , Linus Walleij Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1418; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=bRyfutmnfDlShMXvHCUJDt729clEopf4HGJQIeLXVRE=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmVZUWycvmlSMMGgXBRUOatXSQFPtNDjXm83p41 BdHJpzMveCJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlWVFgAKCRARpy6gFHHX ckSrD/9aClhlJCVyB6JLZQSvurp0L4STBq++jT3UhhuPuXAgaSONppMlcdnsXjehAyo5AVWdeJx 1Do1J+tc4uMEmxaP1Hqx6sTH7RFUniuj3hPFy9AO3x0pDGIgrV7wb7BBw8ohPpbDE6DerwMZP1J CkKUSOTlU1tkAU4fSZWOZ1sLcc/Z2DYoeY8YkKE6gSfiNVqz/rSjFkfwFE2ir+UnR86Zh/VcX5J /zZ4nPhMihZhUAz0HiXb4jEechuUjDKmPRrkOKlCbBwNYDT+FDzfVk6SO1qcgyFs8jiiU3G1naH YjUQHx6yBGrbOL/axsf36rPmrFaMZ3HS9G+PEjGt9W9SXlKhq/QqAgaCTp5LwnpOUNVjks1lg4n tEhdA2MOLUSeQhxvWefg6JFNnWGxAL1Xc1bfIOs+zAqbYFZi09Rrx5iK4NUa11p3x/pjHHZKh3G SEl/0aGcZO/wDcnYu8tHDxTiyO065LmFIhqz+ix9hj5T3/a0gYjXHPWg1ebNBYYCtUYPTh/Jgww 1ZGGF6Ei3rFZ0tS9Wkvj4BVptm4w0etDgtHtWCvbxpPJ5GL0J127AQLttLG8gFWhcCLLwRA97dL ad4Ps7iQzxZdxvJySixWMbEUqxJTncHge3tZdYCoz2tc0ttqSM4uJKStBQFc7AgpiDlZSB7TFWs eB4v3BnNbH5MQlQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We only use grep in one place where we don't really need it as we can use find directly. Reported-by: Andy Shevchenko Suggested-by: Kent Gibson Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index b6809f3..521556c 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -158,19 +158,10 @@ gpiosim_cleanup() { local BANKPATH=$DEVPATH/bank0 echo 0 > $DEVPATH/live - - ls $BANKPATH/line* > /dev/null 2>&1 - if [ "$?" = "0" ] - then - for LINE in $(find $BANKPATH/ | grep -E "line[0-9]+$") - do - test -e $LINE/hog && rmdir $LINE/hog - rmdir $LINE - done - fi - - rmdir $BANKPATH - rmdir $DEVPATH + find "$DEVPATH" -type d -name hog -exec rmdir '{}' '+' + find "$DEVPATH" -type d -name "line*" -exec rmdir '{}' '+' + find "$DEVPATH" -type d -name "bank*" -exec rmdir '{}' '+' + rmdir "$DEVPATH" done gpiosim_chip_symlink_cleanup @@ -3078,7 +3069,6 @@ check_prog() { check_prog shunit2 check_prog modprobe check_prog timeout -check_prog grep # Check if we're running a kernel at the required version or later check_kernel $MIN_KERNEL_VERSION