From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A79B2C43215 for ; Sat, 16 Nov 2019 15:15:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BDCC20728 for ; Sat, 16 Nov 2019 15:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573917333; bh=sfswPkLkh/RNYHt16XH+PrtY9jP4ASLZcJsAC/YIzwA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=hodsJz+QzioQzG7FYSL4Wi5642CkRQVwoVU9xXGwYhvKhkdK3vWry33RdMnRosdsg S3EmLXk0E2C2pQLx67sBGefVtbbrapuTN3ieVlZ1DOouGlLyrnwm2k45UV0xbTphpZ FT04EmgVOyG92dCCxNkbKn7gZ+9NTTaWzdc0kk9c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727840AbfKPPPc (ORCPT ); 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