From patchwork Fri May 24 18:03:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 798779 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 0FF243B1A3 for ; Fri, 24 May 2024 18:04:06 +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=1716573848; cv=none; b=UGtyO2qMs8mqrPmVkpyuV6cXdWkFjk4Z8q248ZUPc5y7zUVbhI1IkVY8lfC8bfHyqBKRJrZSJS4NgOATk7ePHm8FBcE9uPDEGFSva/47WlGA3malW38rWZCaZt2DYs0EQTnaCr6U4FH1cjVpbgK/0wBoRTYKIB3fMjguLs1Sb3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716573848; c=relaxed/simple; bh=1GyvaNvfpUaEvNsFHnNWVs/AwwJFUlI35Md9Z/n30BQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TyDXzzZtMMUwgRUcZcFF/HmkiQFNFQxf9Lo0fbEDHYfaLh3xC24YxJim8BRA9uGAddrKzw5TpObcyi22YAtcaHfktPMrETZvc/5Fw68lkEo/6tfwzIYT4HhnNRtou6ZtXR7q92tMPjkZDVx7Uv1jh7Y2YL9yulfILzDBs4Z8pdY= 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=vQ6LwtAy; 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="vQ6LwtAy" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42108856c33so6088315e9.1 for ; Fri, 24 May 2024 11:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716573845; x=1717178645; 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=vQ6LwtAyC2i0MufBuFEBsggoacoGht1TvRBzgSsknIkLXfHXJsCWBtx0hM7c9MLVKW /q5ImPfRRJdu/B89txRpJIKVQ2JGyPB1XbWsCKaZPf6x1FDtIy7mPLC0Hm2l0UW+xdcp yIviVVvfO0q/+ZySTpIlnTWZBRHItNx/BPRtVQZ2IjpySOkoe05LDUVthUP/PpN4FkVY JmbD50HziG8AA7KV7+VqJqXCwP5+4BQU23jHCV2mogD83MhLy572yJPy0gDOzKjqTj6l yKJqcLwrE2CC4BIUEVM0pxSrH2LWWyIkU1KSIWlx+86Aklhs5hQok+lNTn0hrGF/68xa E8Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716573845; x=1717178645; 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=S09w1xC2z7NU1h4lFp6SUo/oMFDKMJ6xBJnRAtnKIUUGSwmW+6kp2V9FIluXxIj2lz 6IfYouVzLPwU0n1/4Zfj/SL0oqLxrMDr52A42YS9Dhr9Fmo7V3NQ47q8F7Ac+ET2fO8/ KdTDflozq4OfVXvU231LviWpJ3wqEEKlOXmaH1P+2u2qKgBGd+Mx7hWzSqkb1iNQG40m 4uFWKW8ednstmC4twYx1+z9d6Ftik4Ek1JHwQ5GSBNi3Kds96e0vvTQxXxgS8uBKQdYC yhOmOWxDjeFkHE40rsO0PsOdpu2W5sM1eGa7kMECw0G6jOmKLnEdOM4EkZ99FtC7Jjxu 1+vA== X-Forwarded-Encrypted: i=1; AJvYcCVxWi5G99spo2VpDFv4Hfs526ubQTiM1xpxICLRxb+pUQ/USuo/d4I2IVE38UXXW5rCtXov/nyZZtFOE14gLfaJ6RBRh9QL2TFkyw== X-Gm-Message-State: AOJu0YxdopbJQXG7fHxlzNqccwvy3qF0XUycNf7iZJjMNvrb6ZsnuaI0 a1PLwlqX94tt3h/WFQEG2f90LVJhEsAKQrBXyjOZbfvXTCKCtj2ersh/knrbi1dAb7l17R0OGgH j X-Google-Smtp-Source: AGHT+IHgoysIdSN82jvr5jwCUN7LuOwHFR0YGsldPiOBI1nqdujdDDuvlzNF2Uud2vAk8QaIqvuxWQ== X-Received: by 2002:a5d:69c2:0:b0:354:d382:dcb9 with SMTP id ffacd0b85a97d-354f7521700mr5919593f8f.15.1716573845094; Fri, 24 May 2024 11:04:05 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:986a:afa7:d450:11a9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fc82cc41sm58338675e9.0.2024.05.24.11.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:04:04 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 24 May 2024 20:03:27 +0200 Subject: [PATCH libgpiod 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: <20240524-fix-bash-tests-v1-1-1397c73073a6@linaro.org> References: <20240524-fix-bash-tests-v1-0-1397c73073a6@linaro.org> In-Reply-To: <20240524-fix-bash-tests-v1-0-1397c73073a6@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/ZANAwAKARGnLqAUcddyAcsmYgBmUNaTNuHCsojnVAhkV6McFRulp4Vi5Nj8ksALi masWnsLrgOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlDWkwAKCRARpy6gFHHX coKHD/0e/65597zh0LdTVYSGyxtDEMvddYwIBQvIYMpzxOio90iuF9B1ZPne/nnuExmf4Uyf9xU Du8Bn0cP00JgX3QkomjzqTbpFm3Pg/dPmwdxSaEh/kPNwTz53xynkZIIclOcjEsCB7MAf/CzPUO qfKS18mTGs40watHYC+GDWlfA0V6buJp1vjjGo1KMv/UNjje2n4TXuf0Yr9AOsspZh+JG16tel3 msN+XbvDDQA/GzUcLyHqEqgbBGztdyd+DVXCYEKzb5/oWD7pnMbroLjTxvEsVwjajcGogrb2LdS EpGIzU5mj/VTbHbN2slYkAaVsg19wZmVdU2cnWbioZJzPZd/S2NXNLFmGpGGDxfEa8ob6w8NWLi XHAEMm1Rw5ShJT9mgV7ijaQof8HdVEcKW7YQjndx7IrjAufo++QXCAAJgJfe/yOFGVU+VfUvLKA 7DXeq6za5eSNdMX9kFSgWTmGW/J6vohf1LlW3ZHEAqIULt+9rGYdu59Rx29xiC/E7nZtrimxp6A DF4SBT+fgKpSmlfBdntr3Iemh/QaPB71aATfe19bs88fw++lr3Ud35PaDofZXzTs1Jy8FcwHTEC 1z+8LrUyxfpFjxuO27X54vO0gUaxvfSj0brD30CHMFxbXQ+3st2rXxQ+PJ5n/H8i6haApdh60ej Vlqzzeom54O7LJg== 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 Fri May 24 18:03:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 799009 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 DE62E3B1AC for ; Fri, 24 May 2024 18:04:07 +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=1716573849; cv=none; b=hgSn97iuE/Y+xYxbvTQTJrfd8uK4TfZ0pvR3VRp3frppO4LwWtWdBd0OsfNUsTIYhk46ucrkw9M1X/CIn5s1hxJmDmIeE0clOwdN0x9fFNTGxRbWOzHY3ScotE4EtW8xABNRohvPaSZEx3IO3AXWi1tYpdL0+xM+Jv9O6kVetx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716573849; c=relaxed/simple; bh=Qbl0wFycEDzMrTT5CU1N0Ueak8FzUvxplFalMn8aNhc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nYk0EEB/4u2Cxj0vgMVNQcl4/YRHbMQ+WYNla9EMRu1Nk6461hlnqphpLaGNm7aciLzMk8ZD27F7NEti38mZmqYH5MPV7UOf+Cpce9gRhA4Fvt2pNYhX8Op/pOdI5+Q/3ClWO5f/MKzxKhV9Esp5fyQZ1D0qBzU5Nh0Oe8dwV4M= 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=1cndh7S6; 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="1cndh7S6" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4202c1d19d5so64373455e9.2 for ; Fri, 24 May 2024 11:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716573846; x=1717178646; 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=UBofyP0L45wNyQmF4Cl/rFhlc2AXCK++twiohfFn4ok=; b=1cndh7S6r94baxI+PQcFy3G4X8bgsD51xR9zErdeVqBpWPhnK8UCMlmuSI024QTjKZ NdIAtEuV/xrRGNGodr7V/emFcuY/y5HBDiN7ki8b/kty3QwBiUj/R8p1BtOQFUxz9biq +YTwZjM2ied/YBou9R6eNPnUCUIOeU7IgRzFf+T/OGtLuF3RcO0esJiekiwXVX5F5D4C dhuj7IMgkSs9KQ0rXfGx7LyyA4CPVn6cuz3izWqQ845puNkaXWH2MukFVrAZ/IrRDPLj XPKGPXJbD89p3/HVt99/oHjpRPTZQzJCNtlzvZ97Q8XOqdlbYxJd0UWSPNz5X4k06MZc muIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716573846; x=1717178646; 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=UBofyP0L45wNyQmF4Cl/rFhlc2AXCK++twiohfFn4ok=; b=jGhyUWibOpjSKe2ODSHO5mxDtKX83WR0pVDzDPJBxJFnloV8RXuThNTFE0nivo06PA eai8n1R5GylXqmaNqq2V2ZAHk7zuSVMd+Ft2MnS/1aP99Mux69GlnRwLoL43ynjDyV/O GHjcuoKuNHq7BZrEiRYVJlDjo86qAvmkTcpX1KXZ236UpZvFA07Luwk+0gRKumzRik+V a8mTVBhl+9MzbRjOfXW8Ns5vpdE8DJCMcVTCzz1Q+xuPPlkwlDUp81CJgUIlSuiubvHt 4TPTs+G76hZsV4e3nykTmHsFJ/zb43VufWEslHcVpbjrbxAmJwuZvdMSi0l9FMVFjz1L YGtg== X-Forwarded-Encrypted: i=1; AJvYcCWljibpFCVWANncF1ReD6Rc61LDo8FB+CLwIkDaxSYuLzhZhc8lzPIMdY9wM+Q35/m3qkEA88IXKCdrqcX+Oqccc4Anvlb+ALY3cg== X-Gm-Message-State: AOJu0YxUP88OZm0BmzZkI+PiTzpYRmu2xzm5v9PieYWLcJ+m8chfJcEU 5yF3JpW8i1Afe14uxS99uIvoB5lZysHXdpr0ASz4WDB1GAE7d9GuhtCiyADo5kUN30zHn41Y61V 0 X-Google-Smtp-Source: AGHT+IFTLfGe41ciSPMo1/bDWDEEVLFstoTAdtO6itfbP24VgzWOsZrQAZIF83/03W0wppJGmWulwg== X-Received: by 2002:a05:600c:21d1:b0:418:b9fa:43e9 with SMTP id 5b1f17b1804b1-421089f316emr25318215e9.29.1716573846041; Fri, 24 May 2024 11:04:06 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:986a:afa7:d450:11a9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fc82cc41sm58338675e9.0.2024.05.24.11.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:04:05 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 24 May 2024 20:03:28 +0200 Subject: [PATCH libgpiod 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: <20240524-fix-bash-tests-v1-2-1397c73073a6@linaro.org> References: <20240524-fix-bash-tests-v1-0-1397c73073a6@linaro.org> In-Reply-To: <20240524-fix-bash-tests-v1-0-1397c73073a6@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=1516; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=9WdA7ekccTVMGnQL93blEJQyMBbkAK5+koJN9uuCxLY=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmUNaTOmb8vEsRDPVwVkTS93xP+zQTs7tGDkwfG HwMTHSMFUaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlDWkwAKCRARpy6gFHHX crMwEACGxSJdtIg9B02kd506pZcR2XyJalRCDOTiHBOzySGh5Qo8pHMq68flai8wDCMb2TENY6I YKK2Tig81Q0/+KBwTITuVN4V3Y23r91qXL5xVxURA57F7YcRoh6cgt5OslUlZORm7dzO1AipiaJ 7KCSmXqrJTMqMlU4ZfKlNsjsINiGc7MxbTxxj+x+mBMwIbNv6kvIBs3xEe6ar66+XHJBqZtl6D3 0mPSgdvmpWrjvP8OynV7h/CZGw3o7ymMWqr38wGT6KHODXhkPhvlf6RA4K8ZrSuDgKsmUn11PO+ hNkYkb/j4kk9MX/B8ef/B9nHXth+G6ZcLiXt7CtKOs0KTLXdUraIyIK9ZkRIoO2UAGkBBUaOP/b LxP1HanpwuTADVYyRmHnEC17pbQSsKFhi3ZH4qlX24n4s1ynkLjxH5XIUiyxahNyAwaLNjJBYMI 71QweIxT4cLAn5Dp/itOcp3RGFTXWaa/pYRoG2UKD73Ak7W9uZZMH9FyxNrmQ1KT7piZ6NcTL0X pbJVPhhpv63ALpdhpjQZSYIJD4sqRRQueclrUqh6BrIPQVHwbf7i5gGDFLGmGTtg1cnSPAenPuj pWrPrju/4RmaH0HZhzKEBSHW+NeGFJHteL5eJ2yXEPyws+w27jUO6HluJi0D2LqwiriArADsnaI Zv6W5N4i9HqRh0A== 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 $*. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index abb2f5d..8b4f054 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -27,10 +27,10 @@ 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 - fail " '$*': command did not fail as expected" + $@ || return 0 + fail " '$@': command did not fail as expected" } # Check if the string in $2 matches against the pattern in $1. @@ -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 Fri May 24 18:03:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 798778 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 3FF103B1A3 for ; Fri, 24 May 2024 18:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716573850; cv=none; b=ki4IpD6yIxesRED7jNE/o4yhzLFcANkE50tQId19Ae1cVoPxP2O64hh/9qP2aMkBg4R2rmKAgSQGAPAOZc3UgI431DdIlxBY9kyFIE8NlHAIPRjpgVPWGKF1G4tGb/uKabQ9pF30Iri5ILLQjW+lUKfmsrQaPus/g7DfE5bZma0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716573850; c=relaxed/simple; bh=wYbreMX2LOBMbl1R69OKGsBBvx8WqKuDaihyiydcl8M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cauoQiEfH0C+uhaRf5Mg1xt3w9vSJ4GkCbeqWSdRooX7MkXzsJnJZhER80JRD8TyKl14O2yVnT1pq9lZSpZWqaiijwoyfBPh6NJ/z500b1C/pt9XeY+IdcNb7mbP4v3CGEdWe/DnqlySwXRIOHtMiWU0iWcGFDqkXEkyjO471tI= 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=zuoMKSD+; arc=none smtp.client-ip=209.85.128.53 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="zuoMKSD+" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4200ee78f34so32458885e9.3 for ; Fri, 24 May 2024 11:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716573847; x=1717178647; 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=sSfxUpsCurzjN9zrJCHGoSodTDdImTIm6nR1mONwCw4=; b=zuoMKSD+vcgLbM2uXyNFaRKjIBL9epkBrwqTUg2s06uFgoJmXe1hYuON6YadYcWszl SNobrU5gwZxBq+dYqgUIx1S4n4hTY19nsy4i36nH3YREAPGFSX0dvQ0NIFQGUhcdoGAT +RSJmxXYe2jpI8c7g+3IOC7jfZzsuSlE72sPwyc//2+AkwJjbDXsSZ+RhadpWEe/4zCW FC+8Pppb7BESQVPtmG61Hnq5s/Wug0QxLGsrV2T8S29TV0kAC0PcXnOB7IVnKnPizsG4 vhSPAoi46V8BNjvo6AOE/mldmSpxmppxTMeM9pIlx5GZzIlTzedwSOWXLHUZYftvzKGW Z5TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716573847; x=1717178647; 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=sSfxUpsCurzjN9zrJCHGoSodTDdImTIm6nR1mONwCw4=; b=F9dGF5FVKh4XtOPaRccX2vDcLRbwQ6R9gn65x/59G111grmjHbOwkqXSrLttCGvFpj LLrjJoFL0cdNZ63wZP5tAYxQeW1eYzgW6Zb0eVNW/9jVhvrCBBCIrV4xpa1PVzd3njEV Hl020A9U/s7wIqnCrKO2jgT244x2FU2LjKP47bmOTThGthgVFHVY7LssiJ3esWiXs5bO uAMI4UYN3jfihAbIDx+eKBKOURTfZDRTRCIdS4UzI6A4SmzE2lvA8D4GOZif4nkG7lGU /0tz19lhTSCEMC/Wlg3ysrJRYlYrfm6Y5+3O+JNO88fMrQdBJY/eyuL8yak4kj9prI1R KLYw== X-Forwarded-Encrypted: i=1; AJvYcCV1nhH+6UFDlrZE76nVOy+sPeWVBjkRR5gzXXDTQyhueEl9FOiiQmu4iJyifLkp+Av8pxtpQkpxJaPmx+/yUaPRrdprmpSwSvOWjw== X-Gm-Message-State: AOJu0YwQSNAvv7DpzV30aYSURrvay1k9WLQp1k1Q4cZk3NrTdS7iAJUm +yJobHj17/4fp3ksqNuah0xvpJP1zafQYGgXWs9LckC91ERFJJcaHWizGTaolyTfJG35PG+TiZX i X-Google-Smtp-Source: AGHT+IHOHenXG5qdtvNWf1Su5nXL8hwRdoxvrrFOYjBwcGN6L+65EwNiOUhoIN8RpO+rkZxobBCigw== X-Received: by 2002:a05:600c:2111:b0:420:1fab:177f with SMTP id 5b1f17b1804b1-42108a0325bmr22245795e9.30.1716573846976; Fri, 24 May 2024 11:04:06 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:986a:afa7:d450:11a9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fc82cc41sm58338675e9.0.2024.05.24.11.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:04:06 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 24 May 2024 20:03:29 +0200 Subject: [PATCH libgpiod 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: <20240524-fix-bash-tests-v1-3-1397c73073a6@linaro.org> References: <20240524-fix-bash-tests-v1-0-1397c73073a6@linaro.org> In-Reply-To: <20240524-fix-bash-tests-v1-0-1397c73073a6@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=zGsTLldY8HX3ZiEv4OGR4VINX6+NtXF2XY9jTg7Ha8Y=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmUNaTbpdROYuWntBCA944J1fh2W9gy+2BZl38+ 5mbnIcZxweJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlDWkwAKCRARpy6gFHHX crDnD/47+T6uMSVvaWTW21HoT7p7e4tYbsINiTSATReu4yCQsmueN7+ZSwgCU005Cp+Rhcnr298 bAKPWNbjycIli76mQsnkxfreugD/MyZkaAsQ7hWn0Mj0pEgS7SYJ2VJUheqYub2kVxFl8l0XYy7 7uWUspQJ4fHjxsgbZmoyk+MKux8P+E0xQ29FZlLhxTtGemzU38iFs7W/6dzjTI/dV2HkYFKF7iq uQQsVzzGLmF7LzVKedHZDxyol4AfTOuRnaIg9h0keWVe52Q9+hVsFVOi6WnLXEL//DjnRNXE8ZZ bzgjqAvjbelBeHHOdG60oRkJhOOkUvauZNBBI9rjMdVjePMZe9nHf94CE1OhUYZe85Lr1R9oiJV CAAgo6skRs0V6Xc7bPTZnF5mpF8vNCf9HhAx9IyItYnYBsHcyaKgbSUk4VLNOaAhTFe3agP5X3B YHXXSwlYhSUs29qk8zCfa9UW7jRp0UW75k7j419HD+BFDrXjQu3rbwBzBObMaM6aDutYJG4WwQw Isuetm+k5/9E851m24X7Ui3aN+QWTPOOG5xsBSue2q6Nc0VvaZti2ibSr+Ps6n1yn0oBWACHQTk d2q51G6oQciUNSkM5xlsxaQ+ujf/3iUwqeUUV4ayvKdsbexAb6xo41X5JGaXfBbOW3XlbZ2TY45 KCxZBx6HqyKYhJA== 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 8b4f054..efd895d 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 Fri May 24 18:03:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 799008 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 90CA53B78D for ; Fri, 24 May 2024 18:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716573851; cv=none; b=TJd1EXOxsJRwhC0cViklCPQNEVc1aP9sfkAvM4BMCHDg2vX5WGw352XYanRJUeUuHR9uOiT3nZ4rZ2rxqKy0n0lz9FFlmXOBDuCtsKrTP3NDHMkPtWpKJHs55Tr4IQj08ezkKCnXbAEsUlhbXJ5/rc+m2Ee6+V+HXicW6MFhPrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716573851; c=relaxed/simple; bh=at2qeg7TZrGB+vqR8Tw+7OB/9/hyQe6VN2Q5tm6MxDU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LpFfjrh9WsIYoNo35Tz7paIvbZS+Y/xKST1d1ong0AHywTFSjUJwdOetUyuvE/x9768tIcr2QFyY3d5SqSYD1ELjZKB8qCOsYK3i403iJApOxV9Sed+ddnD91WZ/GeSZw6XRjZ6NuUwIDeMiFixOOn5DO8DaRgjBi+oimrVCEDM= 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=a01tE+DT; arc=none smtp.client-ip=209.85.128.45 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="a01tE+DT" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42102c51524so12355575e9.1 for ; Fri, 24 May 2024 11:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1716573848; x=1717178648; 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=ENB6cfVwUITPokGq9QFCSbQS03CG8NsMXHiVtHbY30A=; b=a01tE+DT82NvupyrQd67QVV/ZU7SNCRjsDClwweyspbw1oHKUeuSYGKhr91M27Nd9k pkDOnxu4cOgce697JMbJRS9ni2Ad8T7W6Sd2ziF/m83+d5+442TTmaUnkCpNN3UK1yZW KxER0C+ZtS+LfUYbsvyGeZteUi9zCuL6Q40ggNylYTVexp+JTg937R9W4zDTC0N1A5hA NZi/Xy1WrUx4mkTGKoUJWG8sxnu1bojanUUmctNaiMvOApracpY2+I5teR4Pl3GxA5cy ib/OJJ42g6KiKpyVmXHumTHuOcoHk/z5+QsrZMLbYkx2l6EgFzJSpkyvpSHgkGQ30v08 G+SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716573848; x=1717178648; 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=ENB6cfVwUITPokGq9QFCSbQS03CG8NsMXHiVtHbY30A=; b=OO/0+AultLfGBF/F01CIRq/Jfw6hVc1v+N8pM2CQmWCFi9AMh+aDmDLGrGxIvMgMyX DF3k21S/Exy+EgWkCZ5Ip4l1Ion1H2yaNLxvnHibl8X8qf+oNfzFZOdIisrmY6fkV8na vXlxqT/lbOZKNIyEGd5AcqA3FS0IgetcbL2e1q0ocfD0lplPkDZrdenQHEOCnm+rqUcA Mm9e2wxzSJREl4vqRvXUFBb+fsrcEIKF7lQ9DqEkw5kC9+EXHHJjRJl4qrQ3z1xKhplG 7njL/Wp019Fnwi4p7MWlRd5HcrB5BRAYEd2WbphWwW+zJc+1kPDJtDU1fak2JRr6P9v/ H50A== X-Forwarded-Encrypted: i=1; AJvYcCUFHoidQ20VDe7BvMUrJJjcpi/tW69oFsuDOTP0/NU0EIGa3dFWBG/Al8NlicbLOmVSWqFjG51StVfgbY5RLoyK1Kof/jzFEmPnRg== X-Gm-Message-State: AOJu0YwPved4SaSh+N5HvHrH6SScTdD7KNYbh7SxYdIQQ5yMFlS/5aV4 eIfTPj8InEQg0ANOegxJo4G6Zg0AKo5bZpSChwb3zknGD7ZeRUEmM0fyGIxtgifkGnrlFaXIMuz n X-Google-Smtp-Source: AGHT+IGz2o+o/oi5p9Uh1utwk4cNoMThONCyJL+gXkNlyeBiyembj0j98jqU9oOJkgU9Mqa/8zbJ2g== X-Received: by 2002:a05:600c:3b1c:b0:418:2981:c70f with SMTP id 5b1f17b1804b1-421015fdc48mr51949725e9.19.1716573847748; Fri, 24 May 2024 11:04:07 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:75a:e000:986a:afa7:d450:11a9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-420fc82cc41sm58338675e9.0.2024.05.24.11.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:04:07 -0700 (PDT) From: Bartosz Golaszewski Date: Fri, 24 May 2024 20:03:30 +0200 Subject: [PATCH libgpiod 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: <20240524-fix-bash-tests-v1-4-1397c73073a6@linaro.org> References: <20240524-fix-bash-tests-v1-0-1397c73073a6@linaro.org> In-Reply-To: <20240524-fix-bash-tests-v1-0-1397c73073a6@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=1106; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=43A85VroYhG+c0X7e0DEgkIsiai6FryEmOt7U+pPjvo=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBmUNaT31Lq2MLlCyQtjJb4Qx++dlQRcegWgoz4b aVc9+Tz8aeJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCZlDWkwAKCRARpy6gFHHX cgnVEACjvhct1mN0D+1VNH1ITN6AvWJM73BCV7xStGI/Xh4Av4wl47l04pffv8I/3BFwTGlEdeD bGRwSvhhuD5a0+wo2g+xDD/OAwHXWkjdoKJvVUZJ5BeD4usOl/pNPzIiDMrkugb5v5ELBjorq1W 9uWU3+5+tQsFAMRY7Lc893fLWzZ/WzPetE+EGX6dNJDwtw66S1tBjv6esFZekopLcGMh5wPlP56 pMxyNF3jnJb/irv9IIUfZRnLQqUXNOcdj2+6FzJ+5naL+USBgAt0kk3VwTF4BCtWJUQiPMj9RSk ZdiFKYK+zkWjLjmYCuhVRDb3TQ3yi2rlAi7UF5w39bjh0vDU93gc+dXfvle7+Po21s6F9tvdD2p WeLmOq+VwzTEgjZz0voOLmooVG3kLT2Lk7gGM5RHB5fIMAI9LtSgE+iPhyRaanMZr2KNloYS1y9 AF5F8aX55Yrw4NnLah6/pGao6/3GM1IWV/V/LJ+SLV8HQXCsRam6Hv3kzVv+vetmtdleqyywcW8 /ijlR7Rabgl7ruCiAC44AGARjQ1XFAQp7onR7+xLVS4w10hFUzIJvxiDCKM4ZXQ0Dcn5tyIaGCY HhKFaiEBmj8mSZfQNZEsKghEysaBooSqteWq8o4Tfe9Dj0MIsiKu43Zgh7YI0hrhOlqZOTNWWRA YuEBG8xfkZ7CVbQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski We only use grep in one place where we can use the -regex option of find instead. Switch to using find --regex and drop grep entirely from the tools test-suite. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index efd895d..f910282 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -162,7 +162,7 @@ gpiosim_cleanup() { ls $BANKPATH/line* > /dev/null 2>&1 if [ "$?" = "0" ] then - for LINE in $(find $BANKPATH/ | grep -E "line[0-9]+$") + for LINE in $(find $BANKPATH/ -regex ".*line[0-9]+$") do test -e $LINE/hog && rmdir $LINE/hog rmdir $LINE @@ -3078,7 +3078,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