Received: by 10.213.65.68 with SMTP id h4csp845648imn; Tue, 27 Mar 2018 09:51:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx490Ca+c+ahMKp2o8DSNk7y11gk3pdwFIED+qS0B6zZrstDKcxOVve9l7AswDrW9YCV9iOBz X-Received: by 2002:a17:902:b602:: with SMTP id b2-v6mr87937pls.11.1522169515946; Tue, 27 Mar 2018 09:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522169515; cv=none; d=google.com; s=arc-20160816; b=eyKcu8EBR9mWKIH5gx3LURGVgxWyyPQTp1MHB9Jn8mh+qYlRQuIyDM52avk6J3os0F xZkgUjSwe3dNL6VMy5upw2xj7mpx2C9xuG2yQ4l/uvWYUdP4axXxyDUjeVNraX8rjPUE uvHGx6sTHu5VwagdoAL0TRE50NZYfDszrpTTEyH9BgBTci0Mn4v5etyQhlbOZQvwSaJk BotVJ7s8NDJfClEuj29bKQAv5kkhDeyZ6tE0qT69GAEgSVZ0QV8ZSJvfoa+T9tDcg+Y7 J2NYerehr5qX2/R0zV44624fXSEKlb1rtW0y0YsKhTAIHMdezNuKh287di0IqbKeKlpH Hhzw== 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=EF4CqCaH+72kR/CPRBJuLPuudd8UhTvTI6Rhp3uNvFc=; b=sTwwdtct6K8KKKj9+KiifJLrm0ZhKisYwRWM3ev+P4ZCvswBM+/4P4IT2k9FdWtgKi yP0SPBtRGC1k3uDgnFdsHI+EvEd1/FLbUSKQL02hjnqUVivpyEFhvoeEvkBF9gkpYw6v tll5pvIy8RCJCVo6IE9BGeaA1j1moqLRGCbnoiSShqSvb1bmk9xSCNZt41F7UXqq09ct rgKRL62fgARzXwXl/YUy/WpDLualXgImSIG9rvQvvmK4VSiHKEM8lzJN9jxV8dJtszjQ +MnNPMZIPv6mcWn5dBVvYwwggJ1I7o7150fbZEULUvO9uJKLjviXiCqMXvxa8wE8Pcpy JN0g== 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 38-v6si1587707pln.397.2018.03.27.09.51.41; Tue, 27 Mar 2018 09:51:55 -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 S1755630AbeC0QtS (ORCPT + 99 others); Tue, 27 Mar 2018 12:49:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49376 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbeC0QnC (ORCPT ); Tue, 27 Mar 2018 12:43:02 -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 4ECADF98; Tue, 27 Mar 2018 16:43:01 +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.15 100/105] iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot() Date: Tue, 27 Mar 2018 18:28:20 +0200 Message-Id: <20180327162804.082521634@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@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.15-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 @@ -448,7 +448,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; }