Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 May 2018 11:31:03 -0600
From:      Sean Bruno <sbruno@freebsd.org>
To:        Ian Lepore <ian@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r333801 - head/sys/contrib/dev/ath/ath_hal/ar9300
Message-ID:  <7e76af2a-7229-ae4b-e060-7b9a355764be@freebsd.org>
In-Reply-To: <1526664543.32688.57.camel@freebsd.org>
References:  <201805181723.w4IHNN6Y091949@repo.freebsd.org> <1526664543.32688.57.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7
Content-Type: multipart/mixed; boundary="i4GJo3K1oHs27WcmgOIJ0IkPqpj8uFWk7";
 protected-headers="v1"
From: Sean Bruno <sbruno@freebsd.org>
To: Ian Lepore <ian@freebsd.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-ID: <7e76af2a-7229-ae4b-e060-7b9a355764be@freebsd.org>
Subject: Re: svn commit: r333801 - head/sys/contrib/dev/ath/ath_hal/ar9300
References: <201805181723.w4IHNN6Y091949@repo.freebsd.org>
 <1526664543.32688.57.camel@freebsd.org>
In-Reply-To: <1526664543.32688.57.camel@freebsd.org>

--i4GJo3K1oHs27WcmgOIJ0IkPqpj8uFWk7
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable



On 05/18/18 11:29, Ian Lepore wrote:
> On Fri, 2018-05-18 at 17:23 +0000, Sean Bruno wrote:
>> Author: sbruno
>> Date: Fri May 18 17:23:23 2018
>> New Revision: 333801
>> URL: https://svnweb.freebsd.org/changeset/base/333801
>>
>> Log:
>> =C2=A0 Quiesce a couple pages of clang warnings with a cast.=C2=A0=C2=A0=
Duplicates
>> =C2=A0 linux maintainer commit:
>> =C2=A0=C2=A0
>> =C2=A0 https://github.com/torvalds/linux/commit/627871b71c89a6ec12fbed=
75063f238e0c7127b2#diff-8c6ddb4c3ad69a6fb9f289475821db56
>> =C2=A0=C2=A0
>> =C2=A0 ar9300template_aphrodite.h:575:40: warning: implicit conversion=
 from 'int'
>> =C2=A0=C2=A0=C2=A0=C2=A0to 'u_int8_t' (aka 'unsigned char') changes va=
lue from 3495 to 167
>> =C2=A0=C2=A0=C2=A0=C2=A0[-Wconstant-conversion]
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0/* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)}
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^~~~~~~=
~~~~~~~~~~~
>> =C2=A0 ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN'
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ?=
 ((x) - 2300) : (((x) - 4800) / 5))
>> =C2=A0=C2=A0
>> =C2=A0 Reviewed by:	imp
>> =C2=A0 MFC after:	1 week
>> =C2=A0 Differential Revision:	https://reviews.freebsd.org/D15476
>>
>> Modified:
>> =C2=A0 head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h
>>
>> Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h	Fri May 18 17:=
07:59 2018	(r333800)
>> +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h	Fri May 18 17:=
23:23 2018	(r333801)
>> @@ -139,7 +139,7 @@ enum Ar9300EepromTemplate
>> =C2=A0#define OSPREY_CUSTOMER_DATA_SIZE=C2=A0=C2=A0=C2=A0=C2=A020
>> =C2=A0
>> =C2=A0#define FREQ2FBIN(x,y) \
>> -=C2=A0=C2=A0=C2=A0=C2=A0(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? ((x) - 230=
0) : (((x) - 4800) / 5))
>> +=C2=A0=C2=A0=C2=A0=C2=A0(u_int8_t)(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? =
((x) - 2300) : (((x) - 4800) / 5))
>> =C2=A0#define FBIN2FREQ(x,y) \
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? (2300=
 + x) : (4800 + 5 * x))
>> =C2=A0#define OSPREY_MAX_CHAINS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A03
>>
>=20
> How can this change possibly be correct? All the values involved are
> compile-time constants, the compiler did the math and tells you the
> result is=C2=A03495. Cast or not, that value is never going to fit into=
 a
> uint8_t. Sure this supresses the warning, but what about actually
> fixing the overflow?
>=20
> -- Ian
>=20
>=20


An excellent question all around.  It appears that the maintainer at
Qualcom acked the linux commit, so I'm not sure how to interpret all of
this.

sean


--i4GJo3K1oHs27WcmgOIJ0IkPqpj8uFWk7--

--gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlr/DddfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4
QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1
/LZi1ggA0qnZSZFdhY7nLXKfTAWYtbmQYTH+wtS7Ok5OWCuqBrTfzUoVgYPacJRL
zAgXhCF3gm6/kBzQ/GB8zgiLFVD5z3nhNHlzOoMkZW65vyH6zRQdRtrzc8ezI/+U
XvUE0VHpMmFfxGN9J0PkibzbF8PDByuHMY3reVKS7zj0PSJoCMfrYgTu0kqHfFtU
JuHcnYYSRKNkUaSIoOQx4KMwjch/o6dMJ8UkNvM4c7xroFPeBI4Nx9yXggywxS9H
MPFBOnfmlEWe3+Ff5jLO2/r0lhniKFFv8USTDaQfFwt0zynyOC4AA3EDDnbEr1yV
LardcsrWCoI6a6Yb8czzquSXDY3Lzg==
=9reQ
-----END PGP SIGNATURE-----

--gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7e76af2a-7229-ae4b-e060-7b9a355764be>