From patchwork Mon Jan 1 14:19:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10138555 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 6A76E603B4 for ; Mon, 1 Jan 2018 14:19:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45D9328173 for ; Mon, 1 Jan 2018 14:19:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3877C28768; Mon, 1 Jan 2018 14:19:17 +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 A8C2A28173 for ; Mon, 1 Jan 2018 14:19:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbeAAOTP (ORCPT ); Mon, 1 Jan 2018 09:19:15 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37220 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbeAAOTO (ORCPT ); Mon, 1 Jan 2018 09:19:14 -0500 Received: by mail-wm0-f68.google.com with SMTP id f140so57128881wmd.2 for ; Mon, 01 Jan 2018 06:19:14 -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=WYsJFVL20OEVEP202kW4job/zsdxksCH1Pj4ycF+hzc=; b=Km3mZcFsAZcIdoKzVQioAq5YHAhENrEBKtkFvXdwSoLV9VZYxHk4sMVCKHhSW5pMcW Q3ps/fuIL6f9kx27zsP3wF4xDypOAl42JKP7z4XaFq425Lk3e0qTbvKy5RrTrjhgsB2b ZmY24xS9ocGk4UVgX3h7tJGXOAqa/JNPJjykh43jBhR5rRfdHNm4i3L0elGVX+Z72LR9 /9Z61T6T5venEUUIXOs0W742rd0vUaMJaZuMrnnVqCTUMFZOiD3LNGyrtrvsdfvVZc2G JHroPl9H0b+BY+Ts/TnxdMMkGysE38Cf01IljoteUKP41LVhlqkFdV4S4EMZc3fBkznG Idlw== X-Gm-Message-State: AKGB3mKNjdZXY3hUMHRYns5w2hruPYK1+5KcI3cKYQ5/lyr9qFDBBFZB 4DTzChepND5I6tCOezO2JSOgKw== X-Google-Smtp-Source: ACJfBosgt5TZEzWnJgsAE/fVrFVeK1J95AN/VHQ7GNhsRU81WxHDL7B2vHs315asltuvPmuKDUbchg== X-Received: by 10.80.186.193 with SMTP id x59mr58441025ede.256.1514816353867; Mon, 01 Jan 2018 06:19:13 -0800 (PST) Received: from localhost.localdomain ([151.66.78.0]) by smtp.gmail.com with ESMTPSA id x28sm41276930edd.0.2018.01.01.06.19.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jan 2018 06:19:13 -0800 (PST) From: Lorenzo Bianconi To: jic23@kernel.org Cc: linux-iio@vger.kernel.org Subject: [PATCH] iio: humidity: hts221: remove unnecessary get_unaligned_le16() Date: Mon, 1 Jan 2018 15:19:08 +0100 Message-Id: <20180101141908.22531-1-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 75d442e7b510..6df59e12c5e2 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 @@ -404,7 +403,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); @@ -413,13 +412,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; }