From patchwork Thu Oct 31 15:26:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 13858158 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD418D767D8 for ; Thu, 31 Oct 2024 16:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iARvgNUgpGuJeduLUMchLuVPcb6x0a/MDX16DJ8FtYc=; b=h5kEovhQNKO8ivY8qPJl4uF6W7 AFEeQp+WM+GXiJh8hjIGczbLgzLjiBPFIh9rbCM+5VIaSMzpyiSC8T1ruLWdg1eOchpvVG9duIf9c 0nQ0NT2s3Td03xs2F6i0B+60VB7bdFinntArY3ZtiWoHaXD5ydJnKVHxJIXqqaEmGJvPGpMtMtx0+ GZ6SDXWoZvmMNHZyt/fBI4np4v79Elui8J4/FKD83muGbUY+ar6W1TZbCPPr3Bp2FihLhbvfZSG5d lRuQRWs1+sKwlVTOQVT5hbO9GqZgYzRGhBYiA3bJNpTriCAzJpAzK/NyngkndrdfPjPPhJCCeINYL ox46v9ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6Xah-000000047C6-135N; Thu, 31 Oct 2024 16:00:07 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6X4r-00000003zFO-1b1g for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 15:27:16 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-539e7e73740so1008329e87.3 for ; Thu, 31 Oct 2024 08:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730388432; x=1730993232; darn=lists.infradead.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=iARvgNUgpGuJeduLUMchLuVPcb6x0a/MDX16DJ8FtYc=; b=1mDqyq4q2SBAGs/uvZgLMZpbtgFsqHwvlMPyuqOfkfXKK5pK6DuQiKwc+VsMrmvtWx piZnHoDXU6nTwruVm/LkH5MvzLEIRZthCpv7WkUVlJjBTEWsnvetrWX1tZgod2Nbw5x5 lbvdEncrRPZtkDZomAXZ3yRj/JwhwtLhIm3V8rJ8HXASx0udECPdwfGiJ2HgjL3EU103 wzP/3l6dAK1J+RVjrqCNY+FPhfAGstWwrQcQDEY5wSiLUXz0ehYBO1YozhHOjPZkUOLd KmG40wK40FXRovUb04ajP2c8svbj/nv/HQbJ2uOhy7ZgBNaJaroJC0AQiI5CTVK15sBN vsoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730388432; x=1730993232; 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=iARvgNUgpGuJeduLUMchLuVPcb6x0a/MDX16DJ8FtYc=; b=jrbDYmrhAizULdaE7h6wzxCVt3DFmdj08t17JTF40Fsb+iX+d5h78+vQ/uVl4bVKnE skmSxdkAaGkBGlYkzH0JaAFTTr3JLtWj+7yF5leLMn9BW3ijmtm3BH2NIyKS0fEWEyWN b1YaHAzL5LaRbfnvxULw9T1IaOXJG5OaZ6YXXNnFkGlfPtPH4giTw2naU/0+n2BWRiXd 42cSCZusrrTQcKzrPI67bwB915X32IWM4N8EnYJPlYp+9ChSWkjo550q5HxA+Hmk17fG QHkE0lDozRg6RAeDNUg59rK1YxC7ZsUIdRhgx+Seok8NcgFJmu0k5s5he48Kaws6Bu4y 3nMQ== X-Forwarded-Encrypted: i=1; AJvYcCVJI9l0V9AKE1JpXmSvryLM0z61VkATqGt5F6p1f3/2Jf8SyoJJ0evnR2bLumWKtJyABVC0/HV30A0GPkoGKA6/@lists.infradead.org X-Gm-Message-State: AOJu0YyRvTR91SE1omTmI++Wie3lnV2EP2bFNwEBtQ6tf5q/qCwMkPh4 pXCaUEv7d3a9UMBeGlGtM89pYvMJ4abwpmnRKnp02Q0Ofg50m+Q5xvBwouuQOZo= X-Google-Smtp-Source: AGHT+IEWcF0+R0QL/6lFuKjPVZ78UfoWB02cUsI4xL/9k/ULH8MPxNidSuG6r6GPzz/NlzRHmcmBRQ== X-Received: by 2002:a05:6512:ba1:b0:539:fdee:fe04 with SMTP id 2adb3069b0e04-53b7ecd57d5mr3831450e87.11.1730388431614; Thu, 31 Oct 2024 08:27:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:27:11 -0700 (PDT) From: Julien Stephan Date: Thu, 31 Oct 2024 16:26:59 +0100 Subject: [PATCH v2 04/15] iio: proximity: irsd200: simplify code in write_event_config callback MIME-Version: 1.0 Message-Id: <20241031-iio-fix-write-event-config-signature-v2-4-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_082713_515289_E4A6B528 X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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/irsd200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/proximity/irsd200.c b/drivers/iio/proximity/irsd200.c index 6e96b764fed8b577d71c3146210679b0b61d4c38..fb0691da99ee621e19013a64d122f097e793efd9 100644 --- a/drivers/iio/proximity/irsd200.c +++ b/drivers/iio/proximity/irsd200.c @@ -662,7 +662,7 @@ static int irsd200_write_event_config(struct iio_dev *indio_dev, return ret; return regmap_field_write( - data->regfields[IRS_REGF_INTR_COUNT_THR_OR], !!state); + data->regfields[IRS_REGF_INTR_COUNT_THR_OR], state); default: return -EINVAL; }