From patchwork Thu Oct 31 15:26:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13858068 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 9C2121A2554 for ; Thu, 31 Oct 2024 15:27:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730388434; cv=none; b=i0fVUgrr9Fuck/iRdZmN4IoRqI/22UXGepOcSirinAdUtDJp6dGiyo9hiVrqdtd7qdvo3vub4wHKI/RzFdznu6wDVJkdF0EAbHM6DSVp1WjMUL0tzf8sygOkCQKhSHxTO7hgzCKsgmR6llJAKsFE1rMKLvsiqQrivDETMWlSjBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730388434; c=relaxed/simple; bh=mCLydiA0KKmrbPKui9elDYVWFMJ0Mv3IrFxNpz1HNfo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S8NpF/ChjuJwN8Sx1ICLSfbr0YAEPQlC8O4ONU7kb3Wel6JurFw1EEBlrM96z3d2lWdwe+BAl0QKS8FSCtUU1plRBwr0r6wErsH5rZTO+a1tX3kVA3/dS1SVZu87uX2fo4ynN/XFQ6OWgx6zWfV6eDpaltiH4V1CrYBpchCyZTg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ZN6J+OUu; arc=none smtp.client-ip=209.85.167.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ZN6J+OUu" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-539f0f9ee49so1256733e87.1 for ; Thu, 31 Oct 2024 08:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730388430; x=1730993230; darn=lists.linux.dev; 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=6eDKpTruMZP+IxXjbPpb2d8Qn7H2+5jIQszhP7gdxmg=; b=ZN6J+OUuV9O1c4aNudJ7qkra4m8aNM0zq9OyQVmbfTWFNmhiatXUpGsV6euw2SuPHv VMqr9dV47b6MEcxh2NhZdbvIiQ/P3ynGnnuCLq8T4m4tjYdKzupt3CEWmi3rn5bDWzq4 xsM/Uuy2OSLwTW4X0qlDTTN7x96RAaniUIYnubbbt9Xq63gZ2PCUFAvO9RKKA6t5tCR3 fx1OvH4w5UBqz4neQJjtEJi3Mt5PkqKEHnsGbTbnzJsmfV+g1FWyOym+2c8LCcjEjYlE MtJZGPvA80iew/wtjbOaCpYjpqKzjlo11A3t+36mRLreMReegb1IKZf1C1eW6i5PsWdW 2aJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730388430; x=1730993230; 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=6eDKpTruMZP+IxXjbPpb2d8Qn7H2+5jIQszhP7gdxmg=; b=BTwZ5nxqeO1DmUReAoPa/UKFKinxtw06lIkkEUxIYOw7c3AKC36iIZLbtNcHGebBp6 G4xSy51YYRGtBe8atUU64yGC8l+d2wFQs06jt3CBGlOtZmAwcEHfVsYPemMOKvSE0d0l K0BjiqOl8F/SIgZtOEhoSFddX8Qo6vbb7tI3vcQDivK6krQCO08x7O5vRbSUXkVnxDFM pASRaSop/QlhI/SkXoQg+TyipWQ/eQ9hpTV0ekXzOQRiHTlOh0dHK49V5J8OZPiIT6L4 yTZWwqKOalayb5uRrvxGrWCZKohae0glpQ36kPN+LBJyn3RVxyByN1WGE+viWPvU2bYS 8Z/A== X-Forwarded-Encrypted: i=1; AJvYcCWVxj3zBJBOR1SRYHcxnevZPHdJmceOuQl1nnDveol/IimVGxZtthGJbe8sAJFHkFYSMvizisMJyXG3a58GkXI=@lists.linux.dev X-Gm-Message-State: AOJu0YxM2dDr2WUkOEhdLaRYp5w+XG5laIUBsPXPXage0YAY01S/mhdW TXNyuR1ixB91MqeU5NVEQ2FNDJE7zf9RGSkJp3/O05K+qY/GckO/j0vXrDemgpk= X-Google-Smtp-Source: AGHT+IGjr93P1e7lz+9DxAcqNxw0ZM4hWmcWRfsYdyiLlzZAFmm8L5DUz7on0ZrmWR0iZ8h9Nc8dCg== X-Received: by 2002:a05:6512:3ca2:b0:539:f699:bb29 with SMTP id 2adb3069b0e04-53b348c8d6fmr8574506e87.15.1730388429624; Thu, 31 Oct 2024 08:27:09 -0700 (PDT) Received: from [192.168.1.64] (2a02-8428-e55b-1101-1e41-304e-170b-482f.rev.sfr.net. [2a02:8428:e55b:1101:1e41:304e:170b:482f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d5bf429sm29399475e9.12.2024.10.31.08.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:27:09 -0700 (PDT) From: Julien Stephan Date: Thu, 31 Oct 2024 16:26:57 +0100 Subject: [PATCH v2 02/15] iio: proximity: hx9023s: simplify code in write_event_config callback Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241031-iio-fix-write-event-config-signature-v2-2-2bcacbb517a2@baylibre.com> References: <20241031-iio-fix-write-event-config-signature-v2-0-2bcacbb517a2@baylibre.com> In-Reply-To: <20241031-iio-fix-write-event-config-signature-v2-0-2bcacbb517a2@baylibre.com> To: Mudit Sharma , Jonathan Cameron , Lars-Peter Clausen , Anshul Dalal , Javier Carrasco , Jean-Baptiste Maneyrol , Michael Hennerich , Cosmin Tanislav , Ramona Gradinariu , Antoniu Miclaus , Dan Robertson , Marcelo Schmitt , Matteo Martelli , Anand Ashok Dumbre , Michal Simek , Mariel Tinaco , Jagath Jog J , Lorenzo Bianconi , Subhajit Ghosh , Kevin Tsai , Linus Walleij , Benson Leung , Guenter Roeck Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan X-Mailer: b4 0.14.2 iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan --- drivers/iio/proximity/hx9023s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c index d8fb34060d3db88a3ba5ecdc209b14be8e42e8b9..38441b1ee040c7c26047b0cb2ac443ecb8396df3 100644 --- a/drivers/iio/proximity/hx9023s.c +++ b/drivers/iio/proximity/hx9023s.c @@ -879,7 +879,7 @@ static int hx9023s_write_event_config(struct iio_dev *indio_dev, struct hx9023s_data *data = iio_priv(indio_dev); if (test_bit(chan->channel, &data->chan_in_use)) { - hx9023s_ch_en(data, chan->channel, !!state); + hx9023s_ch_en(data, chan->channel, state); __assign_bit(chan->channel, &data->chan_event, data->ch_data[chan->channel].enable); }