Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5596750ybc; Wed, 27 Nov 2019 06:35:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyFO2fhZGkrIxnhwMoBP04Ay1nrLbc6gt473vlI4zH70KerEXGvpvvMWKEAAY3zb5mmRv+Y X-Received: by 2002:adf:e5c5:: with SMTP id a5mr44294009wrn.103.1574865325175; Wed, 27 Nov 2019 06:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574865325; cv=none; d=google.com; s=arc-20160816; b=i7MjRFVITg29TXVSqe6cvuJpjleV3DJVxEI8ApZhCX2DY7srT6ODnEE+sMVA/bj9wE pQieuv95BJJdL/aWt/dk9DgLq466jtzLaL71ZClsxqlALKUnjd6Z3FALgG1rjdaC3kCS 6JxDTcbknQFP7r0bPfHqxLOKOXjw+T9w7p51PzLx3Q/CQQ9jpg2ygPr766CxOcvPdOxS IILfOzyepMn4B1UjTeXPT9W4LflWzOFM7umx/NJkBprJQzATRpReAyuLRIebQbvGkQx1 AnOm0arn4Fr9utbwnYOWVX3CxwiOJrelwguOPy1X20IFVL8lq45x+yQ60PhjS7MQoavv wPIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=3y/vazft+OugGs2s/HwRrAzh1bmJZtV54wKnERbvSak=; b=zv5dLY9eF2GOVib/qToLfm1CTqcI15CiIUgLMcGF3R3kj78YC9g4HeFQxKBC/f2jyJ l1uU/Bboj2wYI9Eo5UKtZXgiit14P4r7rz1e7DrXFUj9bbL/nMNvwxw6j5hyEZ2JwdFx EO/r5WDp4f6FX2mPlKlIkrWjqRiPWJsCs/HCecwqadlMuLBtWq02+wDuFWGs/i/pONUl HGc93kU6aJYTNZEQJQsPfzOZ3m/4T4kTz2JHs2nkiXIbwKZyWMyJMOlBbAP1vmrsi+PF eQwygMvoIst5lXFn67gs3YQS3ymnHdIInP04OkHF07GY9jHCCoiNuua6QFzUrUTYMDg/ +RJg== 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 w23si1068179edi.339.2019.11.27.06.35.01; Wed, 27 Nov 2019 06:35:25 -0800 (PST) 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 S1727107AbfK0Odr convert rfc822-to-8bit (ORCPT + 99 others); Wed, 27 Nov 2019 09:33:47 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:37618 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbfK0Odr (ORCPT ); Wed, 27 Nov 2019 09:33:47 -0500 Received: by mail-oi1-f195.google.com with SMTP id 128so12195533oih.4; Wed, 27 Nov 2019 06:33:46 -0800 (PST) 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:content-transfer-encoding; bh=p4HQ0sBvX9KwKME5QSEdWqGhxNVzafG2qhuy+QctP4M=; b=uIu88hPH1HKUcJ9FxgIQiprCpNhBB3D/sjX+Z3Buoc3AY63eSySYBxawinLs6HB6ak zufvG2EoASpJW4XPnzxzHwG1rlMVyeKe3ZNCeUEHK7NaAQEPF3hHHk/ZT6rbeQB3ct6r ELxVeKaPffJqNdMQnrI5XdNkjLZC8Rjz9wPZIeG+PZqXI7EQpkrCLxR3w7Luf9iDTPV5 /quCP4xMzEftrmR/M6Gtrmkh1AlUIy7P9LNX9/hcFqFLk8M15dB6JogP3eYYNFrK4cNo H2vByTo8FwlazB57PN3FpoWbmHSaDHpdWyhrRK7Q/SY+v4kCx9+mtCuStIq08XIKNkMo s7sA== X-Gm-Message-State: APjAAAXTwa0AZ28VipTYnZc8636eEGfZjcCxegeiRt/BV5yfvpHuyTBl pd46WN4VEFe4E4sOpkoN6hELorBye9nwkAivyhU= X-Received: by 2002:a05:6808:b17:: with SMTP id s23mr4564212oij.102.1574865225731; Wed, 27 Nov 2019 06:33:45 -0800 (PST) MIME-Version: 1.0 References: <20191127084253.16356-1-geert+renesas@glider.be> <20191127084253.16356-6-geert+renesas@glider.be> <20191127141529.GA18189@vmlxhi-102.adit-jv.com> In-Reply-To: <20191127141529.GA18189@vmlxhi-102.adit-jv.com> From: Geert Uytterhoeven Date: Wed, 27 Nov 2019 15:33:34 +0100 Message-ID: Subject: Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver To: Eugeniu Rosca Cc: Geert Uytterhoeven , Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Mark Rutland , Harish Jenny K N , Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , "open list:GPIO SUBSYSTEM" , "open list:DOCUMENTATION" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-Renesas , Linux Kernel Mailing List , QEMU Developers , Eugeniu Rosca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eugeniu, On Wed, Nov 27, 2019 at 3:15 PM Eugeniu Rosca wrote: > On Wed, Nov 27, 2019 at 09:42:51AM +0100, Geert Uytterhoeven wrote: > > +static bool isrange(const char *s) > > +{ > > + size_t n = strlen(s); > > Cppcheck 1.40-18521-ge6d692d96058: > drivers/gpio/gpio-aggregator.c:69:11: style: Variable 'n' is assigned a value that is never used. [unreadVariable] > > Smatch v0.5.0-6150-gc1ed13e4ee7b: > drivers/gpio/gpio-aggregator.c:69 isrange() warn: unused return: n = strlen() Correct, this is a remainder of code present temporarily during development. Will drop. (where are the days gcc itself warned about that?) > > + aggr->lookups->dev_id = kasprintf(GFP_KERNEL, "%s.%d", DRV_NAME, id); > > + if (!aggr->lookups) { > > + res = -ENOMEM; > > + goto remove_idr; > > + } > > s/aggr->lookups/aggr->lookups->dev_id/ ? Thanks, will fix. > > +static int gpio_fwd_get_multiple(struct gpio_chip *chip, unsigned long *mask, > > + unsigned long *bits) > > +{ > > + struct gpiochip_fwd *fwd = gpiochip_get_data(chip); > > + unsigned long *values, flags; > > gcc 9.2.1: > warning: ‘flags’ may be used uninitialized in this function [-Wmaybe-uninitialized] > > [..] > > > +static void gpio_fwd_set_multiple(struct gpio_chip *chip, unsigned long *mask, > > + unsigned long *bits) > > +{ > > + struct gpiochip_fwd *fwd = gpiochip_get_data(chip); > > + unsigned long *values, flags; > > gcc 9.2.1, same as above: > warning: ‘flags’ may be used uninitialized in this function [-Wmaybe-uninitialized] So newer gcc is (again) no longer smart enough to notice the check is the same for initializer and user... > Should these be silenced like in 2bf593f101f3ca ("xilinx_uartps.c: > suppress "may be used uninitialised" warning") ? TBH, I'm not a big fan of silencing false positives. But if people like to see flags preinitialized to zero, that can be done... > I plan to do some runtime testing soon. Thanks, looking forward to the results! 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