From patchwork Tue Jan 7 20:42:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11321747 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1BBD930 for ; Tue, 7 Jan 2020 20:43:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9A602072A for ; Tue, 7 Jan 2020 20:43:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726111AbgAGUnG (ORCPT ); Tue, 7 Jan 2020 15:43:06 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:41613 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgAGUnF (ORCPT ); Tue, 7 Jan 2020 15:43:05 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mk1BG-1jYwlJ2CMq-00kOo3; Tue, 07 Jan 2020 21:43:01 +0100 From: Arnd Bergmann To: Dmitry Torokhov Cc: Oleksandr Natalenko , Arnd Bergmann , Richard Fontana , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] input: appletouch: shut up -Wmaybe-uninitialized warning Date: Tue, 7 Jan 2020 21:42:45 +0100 Message-Id: <20200107204300.1365789-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:qgZ7jx6brPqr3DJUiVtmNZgtLjzRT+2qQdnCUsfgjChRG18mMU1 s0eCpoecStsNJ1VUyiitj+YDY9H4iZBLIiYJPrflwlGkVEZn5BCQjmakeydFC9BGzfJmTo5 BCBrnDEJ1B80A85OJooIB0pBrK0mgyy9DxZIu6pthX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List-ID: X-Mailing-List: linux-input@vger.kernel.org Building with -O3 introduces a false-positive warning in this file: In file included from include/linux/compiler_types.h:68, from : drivers/input/mouse/appletouch.c: In function 'atp_complete_geyser_3_4': include/linux/compiler-gcc.h:71:45: error: 'x_z' may be used uninitialized in this function [-Werror=maybe-uninitialized] #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^~~~~~~~~~~~ drivers/input/mouse/appletouch.c:657:12: note: 'x_z' was declared here int x, y, x_z, y_z, x_f, y_f; ^~~ In file included from include/linux/compiler_types.h:68, from : drivers/input/mouse/appletouch.c: In function 'atp_complete_geyser_1_2': include/linux/compiler-gcc.h:71:45: error: 'x_z' may be used uninitialized in this function [-Werror=maybe-uninitialized] #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^~~~~~~~~~~~ drivers/input/mouse/appletouch.c:517:12: note: 'x_z' was declared here int x, y, x_z, y_z, x_f, y_f; ^~~ The variables are not actually used here since the only usage happens when both 'x' and 'y' are non-zero, but this is something that gcc fails to track. Fixes: mmtom ("init/Kconfig: enable -O3 for all arches") Signed-off-by: Arnd Bergmann --- drivers/input/mouse/appletouch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 3f06e8a495d8..ec2139c43fcd 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -330,7 +330,7 @@ static void atp_reinit(struct work_struct *work) retval); } -static int atp_calculate_abs(struct atp *dev, int offset, int nb_sensors, +static noinline int atp_calculate_abs(struct atp *dev, int offset, int nb_sensors, int fact, int *z, int *fingers) { int i, pass;