From patchwork Tue Apr 21 00:31:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11500147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4097A17EA for ; Tue, 21 Apr 2020 00:31:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3193A22251 for ; Tue, 21 Apr 2020 00:31:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbgDUAbl (ORCPT ); Mon, 20 Apr 2020 20:31:41 -0400 Received: from mga05.intel.com ([192.55.52.43]:54519 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgDUAbl (ORCPT ); Mon, 20 Apr 2020 20:31:41 -0400 IronPort-SDR: TLqs7GL6a87bEg9F9cIwWheJtN4mNISUmE/KkyLxoM6c6G53wf0LvyXBn3DoAaahz8QK7CpxAE yl7WK/kRGkWw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2020 17:31:40 -0700 IronPort-SDR: Gp7CVy/mvGKxooyN7+gqr02uUv3P7JZcbNROcgr9vUYijrWDBf5XxPgDPApBuC9gL5dTzNByP3 ST5Itgi3MfRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,408,1580803200"; d="scan'208";a="300437803" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 20 Apr 2020 17:31:39 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id CE45148C; Tue, 21 Apr 2020 03:31:36 +0300 (EEST) From: Andy Shevchenko To: Jonathan Cameron , Peter Meerwald-Stadler , linux-iio@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 10/16] iio: light: zopt2201: Use get_unaligned_le24() Date: Tue, 21 Apr 2020 03:31:29 +0300 Message-Id: <20200421003135.23060-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200421003135.23060-1-andriy.shevchenko@linux.intel.com> References: <20200421003135.23060-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko --- drivers/iio/light/zopt2201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/zopt2201.c b/drivers/iio/light/zopt2201.c index 5f54f39e7a4c..0df45b42c091 100644 --- a/drivers/iio/light/zopt2201.c +++ b/drivers/iio/light/zopt2201.c @@ -219,7 +219,7 @@ static int zopt2201_read(struct zopt2201_data *data, u8 reg) goto fail; mutex_unlock(&data->lock); - return (buf[2] << 16) | (buf[1] << 8) | buf[0]; + return get_unaligned_le24(&buf[0]); fail: mutex_unlock(&data->lock);