Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1546556img; Sat, 23 Mar 2019 05:55:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0UpbGFWqwZs91d5oEdwbbBuFvroAaWpSSkgQn7lHVTPiKI89G+G9Qz7qEHX7nIi/dMz6f X-Received: by 2002:aa7:8249:: with SMTP id e9mr14256420pfn.6.1553345703356; Sat, 23 Mar 2019 05:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553345703; cv=none; d=google.com; s=arc-20160816; b=vzfC9GmBEcu++IhiLEs1v1KuEIXcP/KTSClltM26TQ7RL1GnUEkNQPzBwCcBVG7BeL cR0aoY2ygxG0DX0UUFfz5GAPZBFCiXwR/P9hLibT1oJWCwWpNdaGhOtQS3ofeQnfTR4O 7zWKDsDA0/JCgtieNqlQGmpjHdzyB4MCHbJxhNZxXLc+Hi89OQpSh1RUITrD0cqt2GAI +kmJXhJG+p2qwvFJ4XJ5M9JW2cDFANJ3nxYwB+ArrmGbk3AvjuibTBoO0gIP2/jGHVWm eJ/xw/o7P8w300uYK+8TpLsFoCd2svJy5aTK8fdZr2z32t56wtug6nw0tYeJTKtwkZrF pu3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UNX6DqWrbbVQKs40nVLxu3cNUe9PZN8vCebi9sI0jrE=; b=JH8498Mxi12kPmJxyyog5Hv0dWOY10NTDoElWQfCHVn6rVL/V/kUKQQh1ofpa0+hcr LYzo1eQFA1bDG0/u9ybpBKD59ZsQ+kPU1JldThg7LR2KkDJo6q7MQ8ANvvMcTG28qth2 oSCUpHsoGNAuLr80KGDKvStcWJzC5KvqGQQUMawkoOCb0kem5Fzy9jmWF0h/z0e4YZ3m VePOYV9lpufQSs9ExzAMZAnUpcyRprWr2SsKcC4xfDnVtqKkRJQdBhK12FczZSTxZ1iP hm7iV3huqjoUntinTyNeAd7IOJfryEz6XXhkkDfOhhiXiAOLM6plqM3cv0nJop48lseo itDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sx7FEhC8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si1417303pfe.250.2019.03.23.05.54.48; Sat, 23 Mar 2019 05:55:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sx7FEhC8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727588AbfCWMyD (ORCPT + 99 others); Sat, 23 Mar 2019 08:54:03 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37644 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbfCWMyC (ORCPT ); Sat, 23 Mar 2019 08:54:02 -0400 Received: by mail-wr1-f67.google.com with SMTP id w10so5170407wrm.4; Sat, 23 Mar 2019 05:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UNX6DqWrbbVQKs40nVLxu3cNUe9PZN8vCebi9sI0jrE=; b=Sx7FEhC8P22RmYb9hJeQT3N+7v8btNt5x65Qot2+FRPRkGM9VmY8++jTDcTHTks3/e /rMuVpdHf3EXgzHXjE+/hIsN+WiNVyZpKBaMJr9SxapaqvQh7T4YWMGkjpoNUJdAd2hK MF4RcDp3R5/36kCghWAF02JjcBvtTmq4UnPAPkE7IL2avrWYkIiK6OUMZ798DeAiIuDg qv2qQ/hSrWHix5KEZdIXhx+OO2rYeB4KjmyIywEJTzkKbTOvGcDREA/XhLkAkosAGhGX jW+hnu7JcZ+xV+HkEmmROux4cZq1YGRjg+nWsQgaKcgmZLu9CZplmX9ddnyEU8tXe7ry vLMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UNX6DqWrbbVQKs40nVLxu3cNUe9PZN8vCebi9sI0jrE=; b=l2MUZyfmH+sBrBQzt49hgDA4hIp8iGHqJ5bEOGYP+6y2wxrSlfaN1UxGDTjg2vut4a EB7RwhKxo2LWf7gL14Jl5RxBoQp3kUxYaUnjLzVnIEoyJVzC9TEGcafS9cKuIv0YX3QM 5fw0O3/aIJeNpkqCqIyuIWR4HDKtc+vl2RGWsFIYQvmeMsIUD+Rjej7dhuzCpK7jGxDG zzwgrIQtHxO238ga8B6gxlaE9Nd+jOrvfCIKF/H4zuo2NEsfT22cRFccGjrzh+GuB4/P H2kF0MYsU0iQdyerHXcAH+qtv+mq4tgCfsFMRSq+6bDu3+Bkpp7wWRyw8MhxbvgrQjgi oc9g== X-Gm-Message-State: APjAAAU7pR9ByD6AXv3PPD89IWLcFHmSLlAX0LUhtdCHv/WoPdBQ9Jm3 ElWG4CoDN/ocamLuQBLPRxQ= X-Received: by 2002:a5d:49c1:: with SMTP id t1mr9358027wrs.220.1553345640410; Sat, 23 Mar 2019 05:54:00 -0700 (PDT) Received: from peano ([87.19.116.42]) by smtp.gmail.com with ESMTPSA id b134sm22255379wmd.26.2019.03.23.05.53.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 05:53:59 -0700 (PDT) Date: Sat, 23 Mar 2019 13:53:58 +0100 From: Cristian Sicilia To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] staging: iio: adc: Adding temp var to improve readability Message-ID: <82dd56df8d410ec91061ef51c2653345d7e30aa2.1553335775.git.sicilia.cristian@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Creating a temporary variable to improve readability Signed-off-by: Cristian Sicilia --- drivers/staging/iio/adc/ad7280a.c | 55 ++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index d81a5bd..5d848aa 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) for (i = 0; i < st->scan_cnt; i++) { if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) { if (((channels[i] >> 11) & 0xFFF) >= - st->cell_threshhigh) - iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_VOLTAGE, - 1, - 0, - IIO_EV_DIR_RISING, - IIO_EV_TYPE_THRESH, - 0, 0, 0), + st->cell_threshhigh) { + u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0, + IIO_EV_DIR_RISING, + IIO_EV_TYPE_THRESH, + 0, 0, 0); + iio_push_event(indio_dev, tmp, iio_get_time_ns(indio_dev)); - else if (((channels[i] >> 11) & 0xFFF) <= - st->cell_threshlow) - iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_VOLTAGE, - 1, - 0, - IIO_EV_DIR_FALLING, - IIO_EV_TYPE_THRESH, - 0, 0, 0), + } else if (((channels[i] >> 11) & 0xFFF) <= + st->cell_threshlow) { + u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0, + IIO_EV_DIR_FALLING, + IIO_EV_TYPE_THRESH, + 0, 0, 0); + iio_push_event(indio_dev, tmp, iio_get_time_ns(indio_dev)); + } } else { - if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh) - iio_push_event(indio_dev, - IIO_UNMOD_EVENT_CODE( - IIO_TEMP, - 0, + if (((channels[i] >> 11) & 0xFFF) >= + st->aux_threshhigh) { + u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0, IIO_EV_TYPE_THRESH, - IIO_EV_DIR_RISING), + IIO_EV_DIR_RISING); + iio_push_event(indio_dev, tmp, iio_get_time_ns(indio_dev)); - else if (((channels[i] >> 11) & 0xFFF) <= - st->aux_threshlow) - iio_push_event(indio_dev, - IIO_UNMOD_EVENT_CODE( - IIO_TEMP, - 0, + } else if (((channels[i] >> 11) & 0xFFF) <= + st->aux_threshlow) { + u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0, IIO_EV_TYPE_THRESH, - IIO_EV_DIR_FALLING), + IIO_EV_DIR_FALLING); + iio_push_event(indio_dev, tmp, iio_get_time_ns(indio_dev)); + } } } -- 2.7.4