Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp708512ybc; Sat, 16 Nov 2019 07:19:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzpYuGYH/CdqZhpXGmgYPk7WEjJHF9xwEX3ioHUMIXgnEGnv6MMGPKp6jHCdoT+ixiJ0qk9 X-Received: by 2002:a17:906:f154:: with SMTP id gw20mr10419186ejb.279.1573917562088; Sat, 16 Nov 2019 07:19:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573917562; cv=none; d=google.com; s=arc-20160816; b=fFBE6vdh4XhZ890uKM305GBI1o/i15Ue2nDpMB5HT2v6dMbMn9Own9VQlDAKjkLdlT 7unzkq6XjskPI9gvuxngy/sL/tiDGv+ALlQzz+rjID5eiEFna8RfBFhK8Y+YwbMbwSMC 4+Udn3t6rCFMmAdWrq6JijGd0iAp/a8BnBO4ld4ebZj/A2HWf/tSzc1eil4mS4oPUp6q yI27dKFKO+XkysKDktd506gk9nKviZ6eJWIBpGeTZRPrYwJi96HYZ4FS67Mo9gorgQDY LhFzyVJzWaI7NALS2DzZ7GUZLyTJPE9pPt2P6JJbhepW0nVc6DXhbM4/d7gnYl7HNYYP 4v1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=nlJH9BG8TCDj4QN01lGgh62BcHesiyOzkpx1TXiFGEc=; b=Xv5SEe+46wU5EAk7RVc+LrGh4eug9AajWkIexU5v2pKMxSfAxYbp5943YzlDgi0v4h +/FbKVBRgpqA03KJLWlSOFMrdeDYG6w0hOVEJKn8jxD7K/7EE6usLR5kMo8hj3RHUD+i /SYaO/unj4YG6G13lX27HIKqquX4QFBpy3+0bD/CzJRakdnrTp4YTVECNuq/pqCJgeFA F5byuvwuW1K+Eqe4NuwoX2ifr4nYujwMmMKLmpTtEZhtrSGqyn4B/3/COIxOnKUs9iXN 2fYgLvujkiBtQSKz6gXtRcggS6dw2Jju8/PZotliqj4mIAuTqJicXcfAiLwvaO1sqxQo vDkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZKJyUylV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si9214518edl.128.2019.11.16.07.18.57; Sat, 16 Nov 2019 07:19:22 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=ZKJyUylV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbfKPPPc (ORCPT + 99 others); Sat, 16 Nov 2019 10:15:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:45246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbfKPPPc (ORCPT ); Sat, 16 Nov 2019 10:15:32 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC92820723; Sat, 16 Nov 2019 15:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573917331; bh=sfswPkLkh/RNYHt16XH+PrtY9jP4ASLZcJsAC/YIzwA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZKJyUylVCN+a9iXLtHG8+ZWDhyNIvfOY8eNyWefAn1vTJiJ7+0AEXw0LW7gEaOPNV hFK++8da/MVnZQjEU+SjYrim4yrndm0TtaxZ7aqbjL9HyJCTt4JadQD/uNR4ElTVTF grVEIrpVmkAFOLQLPJ0aIo6IqNTXTfLCf1rIVOAo= Date: Sat, 16 Nov 2019 15:15:25 +0000 From: Jonathan Cameron To: "Sa, Nuno" Cc: "linux-iio@vger.kernel.org" , "Jonathan.Cameron@huawei.com" , "colin.king@canonical.com" , "knaack.h@gmx.de" , "pmeerw@pmeerw.net" , "lars@metafoo.de" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] iio: temperature: ltc2983: fix u32 read into a unsigned long long Message-ID: <20191116151516.5c7a7555@archlinux> In-Reply-To: <20191110114823.2bbe87b0@archlinux> References: <20191105202818.90065-1-colin.king@canonical.com> <20191110114823.2bbe87b0@archlinux> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 10 Nov 2019 11:48:23 +0000 Jonathan Cameron wrote: > On Wed, 6 Nov 2019 14:19:52 +0000 > "Sa, Nuno" wrote: >=20 > > On Tue, 2019-11-05 at 20:28 +0000, Colin King wrote: =20 > > >=20 > > > From: Colin Ian King > > >=20 > > > Currently the read of temp using of_property_read_u32_index is > > > reading > > > a u32 value into a unsigned long long. This relies on machine > > > endianness > > > to work correctly, so fix this by reading a u32 value and setting > > > temp > > > to this value. > > >=20 > > > Addresses-Coverity: ("Reliance on integer endianness") > > > Fixes: f110f3188e56 ("iio: temperature: Add support for LTC2983") > > > Signed-off-by: Colin Ian King > > > --- > > > drivers/iio/temperature/ltc2983.c | 6 ++++-- > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/drivers/iio/temperature/ltc2983.c > > > b/drivers/iio/temperature/ltc2983.c > > > index ddf47023364b..d39c0d6b77f1 100644 > > > --- a/drivers/iio/temperature/ltc2983.c > > > +++ b/drivers/iio/temperature/ltc2983.c > > > @@ -444,8 +444,10 @@ static struct ltc2983_custom_sensor > > > *__ltc2983_custom_sensor_new( > > > else > > > temp =3D __convert_to_raw(temp, > > > resolution); > > > } else { > > > - of_property_read_u32_index(np, propname, index, > > > - (u32 *)&temp); > > > + u32 t32; > > > + > > > + of_property_read_u32_index(np, propname, index, > > > &t32); > > > + temp =3D t32; > > > } > > > =20 > > > for (j =3D 0; j < n_size; j++) =20 > >=20 > > Acked-by: Nuno S=C3=A1 > > =20 >=20 > A slight complexity around this one. I'm not sure I'll have time for a pu= ll > before the merge window (as Greg will only take them to about 1 week befo= re > that opens so we get some exposure in Linux next). >=20 > As a result I'll have to sit on this one until Linus comments on rc7, pro= bably > later today. Otherwise it'll be material for stable post release. >=20 > If I seem to have lost it give me a poke and we'll make sure it goes into= =20 > an early rc instead of at the merge window. I forgot about it when I sent the final pull request out. Sorry about that, will have to wait for post merge window. Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan >=20 > Thanks, >=20 > Jonathan >=20 > > Thanks, > > Nuno S=C3=A1 =20 >=20