[PATCH v2] pinctrl: qcom: Avoid assigning unused private context in test cases

From: Sneh Mankad

Date: Wed Jun 10 2026 - 02:23:46 EST


tlmm_test_rising_while_disabled() sets thread_op_remain to 10, but this
variable is only used by the threaded IRQ handler to control the number
of GPIO pin toggles. Since tlmm_test_rising_while_disabled() does not
register a threaded IRQ handler, the assignment is never used.

Similarly, tlmm_test_high() and tlmm_test_low() set intr_op_remain to 9,
but the variable is used to denote the IRQ handler the number of times
GPIO signal has to be toggled from the hard IRQ handler.

Since tlmm_test_high() and tlmm_test_low() themselves toggle the
signal and do not require the hard IRQ handler to do it, the assignment is
never used.

Remove the thread_op_remain assignment from
tlmm_test_rising_while_disabled() and intr_op_remain assignment from
tlmm_test_high() and tlmm_test_low() test cases.

This does not cause any change in functionality.

Signed-off-by: Sneh Mankad <sneh.mankad@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Modify change to also avoid setting priv->intr_op_remain when not required
- Remove patches that are already merged.
- Link to v1: https://lore.kernel.org/r/20260529-tlmm_test_changes-v1-0-88bfdccb4369@xxxxxxxxxxxxxxxx
---
drivers/pinctrl/qcom/tlmm-test.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/pinctrl/qcom/tlmm-test.c b/drivers/pinctrl/qcom/tlmm-test.c
index 007d6539ceced294e81cfbe93a00c75a98c858de..13c417731be7a4dd1c0b8a48044c0090b607e72f 100644
--- a/drivers/pinctrl/qcom/tlmm-test.c
+++ b/drivers/pinctrl/qcom/tlmm-test.c
@@ -273,7 +273,6 @@ static void tlmm_test_low(struct kunit *test)
int i;

priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_HIGH;
- atomic_set(&priv->intr_op_remain, 9);

tlmm_output_high();

@@ -298,7 +297,6 @@ static void tlmm_test_high(struct kunit *test)
int i;

priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_LOW;
- atomic_set(&priv->intr_op_remain, 9);

tlmm_output_low();

@@ -521,7 +519,6 @@ static void tlmm_test_rising_while_disabled(struct kunit *test)
unsigned int before_edge;

priv->intr_op = TLMM_TEST_COUNT;
- atomic_set(&priv->thread_op_remain, 10);

tlmm_output_low();


---
base-commit: 95d73427242a1b8f4c06c39e7e93d83cb5779680
change-id: 20260529-tlmm_test_changes-6061f95c70bd

Best regards,
--
Sneh Mankad <sneh.mankad@xxxxxxxxxxxxxxxx>