From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C931C43215 for ; Wed, 27 Nov 2019 14:33:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0960D20674 for ; Wed, 27 Nov 2019 14:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727085AbfK0Odr convert rfc822-to-8bit (ORCPT ); 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-Google-Smtp-Source: APXvYqxCCNIKdr71l4+aem/37DJmvPbfkWnFnSlhjT3Aiy6bb+myMARYI5vlJfzw8lh/LBhhdEQ2bi0iWvwnKGpu9eY= 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-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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