Received: by 10.213.65.68 with SMTP id h4csp874192imn; Tue, 27 Mar 2018 10:21:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx48aQ9Ec5u55DKpxPuQN6CgluutHkI3wDP/OyJkH295EBQz+Szhr3c3FXhQKkx7+yXjG5Dfy X-Received: by 10.98.147.135 with SMTP id r7mr153960pfk.31.1522171288071; Tue, 27 Mar 2018 10:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171288; cv=none; d=google.com; s=arc-20160816; b=CLso0ZEETQsbnNbLSWNdBbi3oHJob6tchJc1a6tyGvognQDFdOS4E+mnznzoD+fKBU WeurMG4pKALFcAfSGGro5RnnUVnztE3gKJla3pbN4gVljctAg/hR46pw8LgNopXSoJVe Vo9PXnQIACWpY2TCZxv9Om86dawyFcVkdX9mAF85wKUVuQ7H2Mc06x/DwcZYVZXASL6G /HeK5AmZ/iqE5WAFALbXUibfH0Cv5HRRk4mVwScG97cCqy8WOowdeqvvam2vuog+kKP5 V1XO85CbhtYfcgiOHN2ejFQf2xteUsxtlsW6nZpv7jrO/nUZkjAI3u7f5fFJ7ZoPPHe0 0uVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sS82UDfQSs+CUISp7xfsDqFGfmzWzDXSFlWuaZSLsDc=; b=b5jEqGgnpKalNTvYQnvfVRpbLSHpkBxqFqKmBq/b+dudU0QDtM5/N2wWG0Y1uHcnP0 VQcE3qu4Io1DxAMpqy1ZbM99xqSkD/NhZ3vjkuvJYsZDxL7H+tlnyyfbOomhxxwK/6ca Lol3UcWjYnPoggVFN+mJmlkf5egY8NMwxUTeb36u4EAF9Fyhe5tU4sHIt+mfK4wvu10b 0QZjqSXW6FJudzraNhVoZe+7m1xyMjk5wYlXVDYCu9O5/qwhZ1XKtkM0AGOU67Kowqhk uHSre1BsDxkHXCjUATBkCgHYd2+XjYs9StqC1qztzHx5N+j41qNNf1bpW2Dzk2BwGPAj V1OA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j62si1111876pgc.583.2018.03.27.10.21.13; Tue, 27 Mar 2018 10:21:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755108AbeC0QiF (ORCPT + 99 others); Tue, 27 Mar 2018 12:38:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46562 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755086AbeC0Qh7 (ORCPT ); Tue, 27 Mar 2018 12:37:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D99A5FFB; Tue, 27 Mar 2018 16:37:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Jonathan Cameron Subject: [PATCH 4.14 093/101] iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot() Date: Tue, 27 Mar 2018 18:28:05 +0200 Message-Id: <20180327162755.726085555@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lorenzo Bianconi commit 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e upstream. Apply le16_to_cpu() to data read from the sensor in order to take into account architecture endianness Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver) Signed-off-by: Lorenzo Bianconi Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c @@ -392,7 +392,7 @@ static int st_lsm6dsx_read_oneshot(struc st_lsm6dsx_sensor_disable(sensor); - *val = (s16)data; + *val = (s16)le16_to_cpu(data); return IIO_VAL_INT; }