Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2097366ybi; Thu, 4 Jul 2019 05:11:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTKYhPiknehiAv1w9F679kPm6gQjp8wvuiBITvZDePuwX8WutBGN8x9aHzGavI97Qxz7Tj X-Received: by 2002:a17:90a:cb8e:: with SMTP id a14mr19090149pju.124.1562242313602; Thu, 04 Jul 2019 05:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562242313; cv=none; d=google.com; s=arc-20160816; b=DsS3VgV/hos1i7GyLwlyPxMyc9Oi6a6kxiSIc31/J6T6yTHo2l2e90QwVFjTmcY48S oH7DriazV52c2x2EB3/p1SJ4MqKceSMenhMAsbYcYMC7e4E+37MRf0qJ8GDlOPN4rrK7 YRwEMl9DXgcgSVKJxqWC8K3ZVbCTI+CbCVzwS7CEdZOeMLKT5AkNoN+MBaYIpWh6XPbN ZWF5x/ohYY9S93oW0ELT+mL/pqvjx+6vhxP0ha4rbuqUOrE5a9izotoAna5XjqIsjK1P baq1PnAgIBoa/Knjws4nuzjQFcS3njWLA+YOv3IyAAMRkPBr6FkxSM4FMu/JTPk5l2HU kgEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=J7m+O+up5FGnrJOrM1NTZjuCCOYBaAlc+EU+VST+P0o=; b=xx/swBB8f1C6ILG8DBO+GVX7WLSOh7x7G7pamIVtnGEnW2BOrHTIqWVpwtBbo7E0cg iKJhyJGVb+9G9q4QrGBgUHMowK7kfW4Gt4MAujZ1tk7wIRawZxu+FLYkJ9xFnPjSNtPk 2gYvJTGQnct50w8WmbOjpjDwhMydVITQzn0wB+VxylpW/FyrrAC0xnZe74BCiqOHAvFO 7Ng7A0vvcOWyNIujkRNmP+E71cxhCtC2dMVn+cr0oAIQcpRqyqQxjcnzknaGm8Ivpr3w dgOiOFTSnpRPvXveTGa025LvcRstgVFxqf5fQ2VEuKjiInnRhw+3nUBnYonq+ZPxOYTD QnWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t63si5614263pfb.5.2019.07.04.05.11.38; Thu, 04 Jul 2019 05:11:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727690AbfGDMKe (ORCPT + 99 others); Thu, 4 Jul 2019 08:10:34 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:37707 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727612AbfGDMKe (ORCPT ); Thu, 4 Jul 2019 08:10:34 -0400 Received: by mail-ot1-f67.google.com with SMTP id s20so5763790otp.4; Thu, 04 Jul 2019 05:10:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J7m+O+up5FGnrJOrM1NTZjuCCOYBaAlc+EU+VST+P0o=; b=ic3Tirp2LhDgUc3OVqfrOg+5Ad4v+eg6vpA/WUjQem3aHFjvnEj6nFiTJQ9AGN8S2s +2Zd8/jw9Ch3ItvXWZhtx3ovKkNDLb1j2Zc9cxQclyUrick2xW+CBV/ffJ6BLOQdToaf IR4ZNS+JbRks6TP47th7GbdxmAvHD7gXAPCVrBzAgoQmMXb8penX0u2NXGUC8TUTkMd5 /pVXMH2zaZEg77vHw0xMK+vlDfu4V9kcd1Z+3oA/1Vlrurm2D+mFNEnpXYItVe/NvGX7 KY5sVniiP+27Jr1HzzgnVwqpHLrVNhDNiixNYv7gylWTFJDdHlTEMQwaDttS1sB/7l78 cytg== X-Gm-Message-State: APjAAAUg+bLQ1KFXy3eOO4OjPbe0VEheeuP1kPacWDasepl0AessRVmr dZYH/l0phaA2O4htFf7h/A/0DgYEF8hemdXiRRs= X-Received: by 2002:a9d:704f:: with SMTP id x15mr13127896otj.297.1562242233106; Thu, 04 Jul 2019 05:10:33 -0700 (PDT) MIME-Version: 1.0 References: <20190704113800.3299636-1-arnd@arndb.de> <20190704120756.GA1582@kunai> In-Reply-To: <20190704120756.GA1582@kunai> From: Geert Uytterhoeven Date: Thu, 4 Jul 2019 14:10:22 +0200 Message-ID: Subject: Re: [PATCH] iio: adc: gyroadc: fix uninitialized return code To: Wolfram Sang Cc: Arnd Bergmann , Marek Vasut , Jonathan Cameron , stable , Marek Vasut , Geert Uytterhoeven , Simon Horman , Linux-Renesas , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Kuninori Morimoto , linux-iio@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wolfram, On Thu, Jul 4, 2019 at 2:08 PM Wolfram Sang wrote: > On Thu, Jul 04, 2019 at 01:37:47PM +0200, Arnd Bergmann wrote: > > gcc-9 complains about a blatant uninitialized variable use that > > all earlier compiler versions missed: > > > > drivers/iio/adc/rcar-gyroadc.c:510:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] > > > > Return -EINVAL instead here. > > > > Cc: stable@vger.kernel.org > > Fixes: 059c53b32329 ("iio: adc: Add Renesas GyroADC driver") > > Signed-off-by: Arnd Bergmann > > This is correct but missing that the above 'return ret' is broken, too. > ret is initialized but 0 in that case. Nice catch! Oh well, given enough eyeballs, ... > And maybe we can use something else than -EINVAL for this case? I am on > the go right now, I will look for a suggestion later. -EINVAL is correct here (and in the above case, too), IMHO. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds