Message ID | 20241031-iio-fix-write-event-config-signature-v2-5-2bcacbb517a2@baylibre.com (mailing list archive) |
---|---|
State | New |
Headers | show
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 4C9BD1A4F01 for <chrome-platform@lists.linux.dev>; Thu, 31 Oct 2024 15:27:14 +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=1730388436; cv=none; b=q13DCAKWZRb1RAKu7/kD8rbsN5BkBqZwoWbsdi9gKqDOdtdoZrH98tRnn7QOi4uVT3xZu+tK3pezihIEiV5JEQwMT2D3h7u1W62XyvT2q5H+xD2mi8D62wQFeB5DU/lkSN1u29dOBzRolkHYrupTcw8kTSNq8tHZc88b2ViVVEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730388436; c=relaxed/simple; bh=yJ57w0VUTH3q0i2oLjf3xWbfCP6jGNPoSNnROEqxxw8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rS4/xWFCFCBb/FrD2MowQKwL8X+mZ9ouFHPHqhkEE/H6m5iypJGNqAdSjnf8qy704BZ1W2fWqpScF86MZXXJlDNkYM+yoeyTnoU1cUX5D6X0enTD2pBmyT28qFFeR3A1Ldr/B334r6GEklZVgICZWBvNA6YKYBP9HC7CHOQXwx8= 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=Vhzghjpr; arc=none smtp.client-ip=209.85.128.45 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="Vhzghjpr" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4314c4cb752so9452735e9.2 for <chrome-platform@lists.linux.dev>; Thu, 31 Oct 2024 08:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1730388433; x=1730993233; 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=ynbTz0mAIREWX9DSd8GtfjNx2HTiawNK3KErRQuBlPE=; b=Vhzghjpr4oILQohJRsn3PoPbW7NHg6baO7dRlB+zcShP2nMub+EvWvHGBhnNeEPgys r4xRedqDqOxLUn5Y3GM8ueKFcPz9ZD4k/K1P01GURJHp9bzKu8f8ij4K6Bp2oHYN729n zxI9BFi8/Z/TGaVaxua3pQ60hd9N/YIkfA4iFRNpZbylNeWjwQUWSvw9mc3pf5OJlIjs +R7nFJ9nhUHXKNCjv0rYi0DpBUT0vIwoOmRcRoufkMaTWNk1PJzxtAp6mfPeY4pOBfLg dz2U4NNCbEyD8+C9ijNULEgw5+KdRxXHP0tA1ySRPZLz+3lylBM1pLpMR5qjG3NrC3QM D/OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730388433; x=1730993233; 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=ynbTz0mAIREWX9DSd8GtfjNx2HTiawNK3KErRQuBlPE=; b=aET4gaHsrx9peNPLlAdOQyMEEEqG9ZHq/ltDmTDpxiizF9wfdTCBvNLEshlU+Py9LY +Ur/83JqHIRmN1uArCAGkBOIc6yjja/HyOAdGv5mSC49l9iutpPeFn2p1YaTKovxXOnc KMhsIdfsYs+D6vzwrvE8EZrxa/KU9/1esvFJrMrZ1qKfwuzeYJXwWFEcksdwNgk0iaXD k5h6KXcom7WbMwYMHtT/u9j3obIdyY361AMzeQGsMdDY4El86UjRgUXJP8b9r6nERJyo 22fKhgKIwWgsnt3coACeWpCjDNX0Zvh+XUE9cpYfL2cNYZvAEtHyTehifKQF7NQMWHau VX6A== X-Forwarded-Encrypted: i=1; AJvYcCX9NcKjzv/MhmPdteTs2zlcX/NuMyFKUgHwvlXb/5V4GzwIO9AEDpEJjVLQ132Vl7vZ9Jck4I7u3ZLYqCTqX4o=@lists.linux.dev X-Gm-Message-State: AOJu0YxXBrvOe0qhtBuWyPxE72olzLypnh0YXATwLielAdU17K8ZZJYa ZTcxA5Z0C8WaQJER3O8Z4csVWNi4XcFOJZVgoWgOsSyM6NDHGz7tC6t7Te/L+Ck= X-Google-Smtp-Source: AGHT+IFcDhwM/WUu2euAD7a6xckHNF1ZKNFT/G1Ed5VwyVng6DCbMufZzTDi7LNt16ADIplrfYs/Hg== X-Received: by 2002:a05:600c:4f04:b0:42c:acb0:dda5 with SMTP id 5b1f17b1804b1-4327b6f9574mr33906995e9.1.1730388432612; Thu, 31 Oct 2024 08:27:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 08:27:12 -0700 (PDT) From: Julien Stephan <jstephan@baylibre.com> Date: Thu, 31 Oct 2024 16:27:00 +0100 Subject: [PATCH v2 05/15] iio: proximity: sx9500: simplify code in write_event_config callback Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: <chrome-platform.lists.linux.dev> List-Subscribe: <mailto:chrome-platform+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:chrome-platform+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20241031-iio-fix-write-event-config-signature-v2-5-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 <muditsharma.info@gmail.com>, Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Anshul Dalal <anshulusr@gmail.com>, Javier Carrasco <javier.carrasco.cruz@gmail.com>, Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>, Michael Hennerich <Michael.Hennerich@analog.com>, Cosmin Tanislav <cosmin.tanislav@analog.com>, Ramona Gradinariu <ramona.gradinariu@analog.com>, Antoniu Miclaus <antoniu.miclaus@analog.com>, Dan Robertson <dan@dlrobertson.com>, Marcelo Schmitt <marcelo.schmitt@analog.com>, Matteo Martelli <matteomartelli3@gmail.com>, Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>, Michal Simek <michal.simek@amd.com>, Mariel Tinaco <Mariel.Tinaco@analog.com>, Jagath Jog J <jagathjog1996@gmail.com>, Lorenzo Bianconi <lorenzo@kernel.org>, Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>, Kevin Tsai <ktsai@capellamicro.com>, Linus Walleij <linus.walleij@linaro.org>, Benson Leung <bleung@chromium.org>, Guenter Roeck <groeck@chromium.org> Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, Julien Stephan <jstephan@baylibre.com> X-Mailer: b4 0.14.2 |
Series |
iio: fix write_event_config signature
|
expand
|
diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 3f4eace05cfc6a4679fe82854dc059aa4a710d6d..e3da709424d5b2bd4e746df7adc4a4969e62f2a6 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -551,7 +551,7 @@ static int sx9500_write_event_config(struct iio_dev *indio_dev, mutex_lock(&data->mutex); - if (state == 1) { + if (state) { ret = sx9500_inc_chan_users(data, chan->channel); if (ret < 0) goto out_unlock; @@ -571,7 +571,7 @@ static int sx9500_write_event_config(struct iio_dev *indio_dev, goto out_unlock; out_undo_chan: - if (state == 1) + if (state) sx9500_dec_chan_users(data, chan->channel); else sx9500_inc_chan_users(data, chan->channel);
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 <jstephan@baylibre.com> --- drivers/iio/proximity/sx9500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)