From deba07340773e0b7ef7d83843ea3cb6f1d8920da Mon Sep 17 00:00:00 2001 From: Umar Farooq Date: Mon, 10 Oct 2016 23:09:09 +0200 Subject: [PATCH] =?UTF-8?q?Small=20improvement=20to=20avoid=20lib/kernel/k?= =?UTF-8?q?ernel.c:195:3:=20error:=20ignoring=20return=20value=20of=20?= =?UTF-8?q?=E2=80=98fscanf=E2=80=99,=20declared=20with=20attribute=20warn?= =?UTF-8?q?=5Funused=5Fresult=20[-Werror=3Dunused-result]=20error=20on=20U?= =?UTF-8?q?buntu...not=20a=20hard=20requirement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/kernel/kernel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/kernel/kernel.c b/lib/kernel/kernel.c index 8474faf5a..6548dbf49 100644 --- a/lib/kernel/kernel.c +++ b/lib/kernel/kernel.c @@ -184,6 +184,7 @@ int kernel_irq_setaffinity(unsigned irq, uintmax_t new, uintmax_t *old) { char fn[64]; FILE *f; + int ret = 0; snprintf(fn, sizeof(fn), "/proc/irq/%u/smp_affinity", irq); @@ -192,10 +193,10 @@ int kernel_irq_setaffinity(unsigned irq, uintmax_t new, uintmax_t *old) return -1; /* IRQ does not exist */ if (old) - fscanf(f, "%jx", old); + ret = fscanf(f, "%jx", old); fprintf(f, "%jx", new); fclose(f); - return 0; + return ret; }