From patchwork Mon Jan 8 22:12:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10150679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3297760210 for ; Mon, 8 Jan 2018 22:13:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 296EB2891A for ; Mon, 8 Jan 2018 22:13:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E5052891B; Mon, 8 Jan 2018 22:13:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3502287B8 for ; Mon, 8 Jan 2018 22:13:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757862AbeAHWNG (ORCPT ); Mon, 8 Jan 2018 17:13:06 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45346 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757976AbeAHWNE (ORCPT ); Mon, 8 Jan 2018 17:13:04 -0500 Received: by mail-wr0-f193.google.com with SMTP id o15so12266793wrf.12 for ; Mon, 08 Jan 2018 14:13:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eFsntqnPNPN/iWRPzGLWRmHjqkoxonV38CHhtsgWcUM=; b=Pjq0K6wRYJbJvXXQxtG22Y1P3dpTeyZ8/ex4pIdTMmANwYcnN17p8kzGg/D6VKc4uT x3wisJoW5qS126HlVbpLfcuOJIzDKnm3eKG1aN07/XAtJ1wCpuY/s7bYnxGmcMsS2jR4 hnwnMKVnWP5XICdNPiD88LKSoQmb1gLkK+u0q5IcZg0SivWbWZgy2w1/By+j7VByVs1Z KNwaKI5Dv7qf/8mxlYP8wn3PLlfgS+22C2iqFcWkcqG2QCVYBztu/S1yVL1YgOuW7uGb spZz6gG9V82JGvisv5szolFB8mP/bECT1IfBpKIui9w1SlqXoEYQz+TpcMM6sEST1gdD 3i5A== X-Gm-Message-State: AKGB3mLccvJmU0LU/TUynL9zgYO3BQkCshlVqX2pTs6tK6rAUaxCTI2r rWyrYOJFeksMRE7C9NWoCabYug== X-Google-Smtp-Source: ACJfBosMynBHA7NwVZSQfCNdxYhReOBspofJcLCb4kYftJvYoRlD4Z7xdW/zgxKE/iDOd9zK0GR3Xg== X-Received: by 10.223.136.234 with SMTP id g39mr2167570wrg.188.1515449583469; Mon, 08 Jan 2018 14:13:03 -0800 (PST) Received: from localhost.localdomain ([151.66.12.57]) by smtp.gmail.com with ESMTPSA id 34sm6964342wro.7.2018.01.08.14.13.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 14:13:02 -0800 (PST) From: Lorenzo Bianconi To: jic23@kernel.org Cc: linux-iio@vger.kernel.org Subject: [PATCH v3 4/4] iio: humidity: hts221: remove unnecessary get_unaligned_le16() Date: Mon, 8 Jan 2018 23:12:31 +0100 Message-Id: <20180108221231.13283-5-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.15.1 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unnecessary unaligned access routine in hts221_read_oneshot() and the related include Signed-off-by: Lorenzo Bianconi --- drivers/iio/humidity/hts221_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c index fb74a22ef3f5..166946d4978d 100644 --- a/drivers/iio/humidity/hts221_core.c +++ b/drivers/iio/humidity/hts221_core.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -406,7 +405,7 @@ static int hts221_get_sensor_offset(struct hts221_hw *hw, static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val) { - u8 data[HTS221_DATA_SIZE]; + __le16 data; int err; err = hts221_set_enable(hw, true); @@ -415,13 +414,13 @@ static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val) msleep(50); - err = regmap_bulk_read(hw->regmap, addr, data, sizeof(data)); + err = regmap_bulk_read(hw->regmap, addr, &data, sizeof(data)); if (err < 0) return err; hts221_set_enable(hw, false); - *val = (s16)get_unaligned_le16(data); + *val = (s16)le16_to_cpu(data); return IIO_VAL_INT; }