From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D60E61AC88B; Fri, 1 Nov 2024 16:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730479293; cv=none; b=VVuyX7aGNXkPcqODtuEf+wdW+lUd9wjpy6yzyrW3WTtkTTY/BjnuYwbEofJiHj4kXdx1jlVEGXwKmC2HidMUe4RicyNe3+hYHERr0RIOoHKwL5TrQgNnz+7FlpRcVkssSfbk2DyhCPLgMphHAQl4QX/BIkgrz+ScJC0ZD683haA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730479293; c=relaxed/simple; bh=RnVmu4KMn0cYcEtJmqOHewUj8MapyZAuXdZ2ik2BBwk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JuEuyIM5PfQo9LoMjNo+qUV/FwEvXLrLFydVS/2wyuUN8lqwEHMXr3+XfEKYOr9bz/nlqDsrlb0C6es1tVjRLqStiE4nxEbCEU+zc5br9cwxbG1uwABpEzl7V3g64LuZ5ESXrN8KTTV6MvHQtICoIcBSAN7YTmStqzheS0VPYHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FH1q8YKC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FH1q8YKC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F3B2C4CECD; Fri, 1 Nov 2024 16:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730479292; bh=RnVmu4KMn0cYcEtJmqOHewUj8MapyZAuXdZ2ik2BBwk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FH1q8YKCIGY6guripygnr5/X3GiZsfOtWqz7B5YyRdEvi8alczpqthsNyfSEUf0QE YzPta1HyOjTt0iwV6ZiaRFc/LWdu+oebKdb7Vf/HU8ceebCZDvSdPhdIZgmVHJWpNF CLNuIm9LO+SzfRdv3Xe+9ZNj2teoce5Dhx4e93vAu8wKuVO/obJOETKj2wOz6jWNN7 tz79KaeMKPC9QDSpUeIegKhgfvMTg6DX1VpOvI+6O0gec03aeih35q3Ke76Vhbv7dy ptiYxEM0cX485g/gkeSLwRNLiMVLcHppe+BF3g0GWoz69Mpcp7c+yMzBrdctpinnxu GDm7jaLHfT9hA== Date: Fri, 1 Nov 2024 16:41:18 +0000 From: Jonathan Cameron To: Julien Stephan Cc: Mudit Sharma , 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 , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev Subject: Re: [PATCH v2 13/15] iio: light: apds9306: simplifies if branch in apds9306_write_event_config Message-ID: <20241101164118.687be624@jic23-huawei> In-Reply-To: <20241031-iio-fix-write-event-config-signature-v2-13-2bcacbb517a2@baylibre.com> References: <20241031-iio-fix-write-event-config-signature-v2-0-2bcacbb517a2@baylibre.com> <20241031-iio-fix-write-event-config-signature-v2-13-2bcacbb517a2@baylibre.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 31 Oct 2024 16:27:08 +0100 Julien Stephan wrote: > Simplifies the regmap_wite if branch in apds9306_write_event_config. Applied. > > Signed-off-by: Julien Stephan > --- > drivers/iio/light/apds9306.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/iio/light/apds9306.c b/drivers/iio/light/apds9306.c > index 8adc74040db2bddf93fbb773e3519abcc726b9a6..9c08e7c3ad0c17519689a630d42fe9b90438dfe8 100644 > --- a/drivers/iio/light/apds9306.c > +++ b/drivers/iio/light/apds9306.c > @@ -1125,10 +1125,7 @@ static int apds9306_write_event_config(struct iio_dev *indio_dev, > } > } > case IIO_EV_TYPE_THRESH_ADAPTIVE: > - if (state) > - return regmap_field_write(rf->int_thresh_var_en, 1); > - else > - return regmap_field_write(rf->int_thresh_var_en, 0); > + return regmap_field_write(rf->int_thresh_var_en, state); > default: > return -EINVAL; > } >