From: Marius Vlad Subject: Re: [PATCH i-g-t] tests/gem_concurrent_all: Please the compiler regarding fscanfs unused result. Date: Tue, 5 Apr 2016 20:34:02 +0300 Message-ID: <20160405173402.GA4802@mcvlad-wk.rb.intel.com> References: <1459876403-4338-1-git-send-email-marius.c.vlad@intel.com> <20160405172321.GC18736@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1403795497==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 77A0C6E272 for ; Tue, 5 Apr 2016 17:33:04 +0000 (UTC) In-Reply-To: <20160405172321.GC18736@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1403795497== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 05, 2016 at 06:23:21PM +0100, Chris Wilson wrote: > On Tue, Apr 05, 2016 at 08:13:23PM +0300, Marius Vlad wrote: > > Signed-off-by: Marius Vlad > > --- > > tests/gem_concurrent_all.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c > > index 10e5357..e84ded3 100644 > > --- a/tests/gem_concurrent_all.c > > +++ b/tests/gem_concurrent_all.c > > @@ -650,7 +650,7 @@ static int read_sysctl(const char *path) > > FILE *file =3D fopen(path, "r"); > > int max =3D 0; > > if (file) { > > - fscanf(file, "%d", &max); > > + igt_assert(fscanf(file, "%d", &max) =3D=3D 1); >=20 > But the code is written in case fscanf() actually fails... It will never fail... Would (void) fscanf() be better? > -Chris >=20 > --=20 > Chris Wilson, Intel Open Source Technology Centre --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXA/cKAAoJELmLWIAQzyE+G5EH/RLqSuAPT1G+FAWg7pAtf8SE 8117UKudIcbLCQumu4hZf6vilTMtFc8sn/YLkEzgSPK1NEpD4YVztd69UMBE/nPb sqFWOOgarVSk3EMJ3JAz0KlZ+5NGqxNLM9lyDzwIXi4HbqChx+cDR8U/O5ve91PZ XBGER5C//mwW4rttKAh64+IoSoDTWyuJOqiChjG+jNiSaMjOlTQWALyL5y42CPWK wg0daNRlW+vqbD1nK5tCKeAQCeFHanrppiql5O13YKLoMSrm0doQeKe7MCBgSAHu cTe6FFPoWNOJgTpVW3p2LWgQSVI7xh44dBcpVSvjc/CLaSi2qXHkakPKE6mj3Rk= =fOGF -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu-- --===============1403795497== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1403795497==--