Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp360092rwb; Thu, 22 Sep 2022 19:53:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6NS0jJJXw0KvtOB3opeNoRymN8j4Z353RnOgIZJf5WYutI4ee5W6mrG3cJ2+Vy7G/SnlE6 X-Received: by 2002:a17:907:6090:b0:781:44ff:443c with SMTP id ht16-20020a170907609000b0078144ff443cmr5331305ejc.485.1663901585953; Thu, 22 Sep 2022 19:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663901585; cv=none; d=google.com; s=arc-20160816; b=tdlYnv58drwwt+jYNtiuol0J74UiyE/BOOAb94WHinTJlwN/aRPOAy/vXnFL6ljGbP chAYsDJ6mGTOQ96gJsYN6P65kwYO46+Y02ZEVACLUpRBENi24rxABat56hpe1Y/Lj3/B fvb0yyvK/pLIiG7e/RIzunAEe1f0CtidH1n0thqb4W6rJdVa+J7UYZECXnCdvTHWGgtm WcMQcOcc+4jlhbkKkMwl/bDEpR7nroc9Aw21f/t3J4bAgky7SUC/Kv97qsxXBBC4aPi+ VOTmf04kuBMmaIR7ytvgoBsJoC1iuDm7Pq1mmR3ynwwNySWCXqnQ7s0v9RJnWQ8aBlnd 47og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=spy1SlFiNJhg80nQC7+ZvKUORe/YbuGuVnt/Zzs2hk8=; b=NcebottCaJvXF23lrKh43hK5vQ+QHc9Z6lKBEJvgMqdUuY/i95v8f14TN1oJWj/HwV 5y40E6b69yj51Wf3btVeBpWXRuosAwiwgEOJXG5hDQCPbB+B3XX9Ou3Lk7SFvUH63lfX C8/iydubOh0/XMr4JHprVjPZjjwDxgjT3AY/gD2Gq/kSJiuyuBhfu54mQU7HeIozaLnb mKKzuPV5rTB3gT5Gm7FZz1v0cFQVJ/drdralINSTP5BwkUOTdGTw9eXiGKj2qPzhk2NA cEZWo7cjM297iYhkdtNoxzT9uHvpb67Ljs+7WFgYu55gMQ/4hbVKm71xLZrWmRmKKzK8 nnEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RlDbgsfq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a056402050a00b00456cab58382si48264edv.242.2022.09.22.19.52.40; Thu, 22 Sep 2022 19:53:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RlDbgsfq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232291AbiIWCjN (ORCPT + 99 others); Thu, 22 Sep 2022 22:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231127AbiIWCjL (ORCPT ); Thu, 22 Sep 2022 22:39:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B6D1176C0; Thu, 22 Sep 2022 19:39:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E200B829B1; Fri, 23 Sep 2022 02:39:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65602C433C1; Fri, 23 Sep 2022 02:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663900748; bh=PNdU7fNduRcQhJm7dcaxtTTE0/w4p67D22t7Qk/4oIA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RlDbgsfq9WocF3wv6oF3qp73BIG8bHWeNk8PDwpZzFyg5h74slf5WDAh2IkvqquF5 a0TXN3X0phG6rRZfZH7GWE7xvyxgalMrUQq7zjEnC30AjuEXlINniM98vU6pI2IGyt T1gcseg2K/OHlYESk1uWMWnczVAtoN7s2hUBKLAeGC12Xmlr75PPLDPgK7kdzyTl9N 9gWaWA1+L6huRq62WFeYgFYWeiu4ITFeoml+vzRfq4iSJy4ozqIK5hyquXHhWg7EO1 xvxfqPS/Vzs4pJK36zMnONOW8KQjS87Z7ZXNKW6KmEzDpKdZ/8gaiTtyiQ5rSEThO/ av9VMydDhIwQA== Date: Thu, 22 Sep 2022 19:39:06 -0700 From: Jakub Kicinski To: Colin Foster Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, Russell King , Linus Walleij , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Lee Jones , Krzysztof Kozlowski , Rob Herring , Paolo Abeni , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Vivien Didelot , Andrew Lunn Subject: Re: [PATCH v2 net-next 08/14] net: dsa: felix: update init_regmap to be string-based Message-ID: <20220922193906.7ab18960@kernel.org> In-Reply-To: <20220922040102.1554459-9-colin.foster@in-advantage.com> References: <20220922040102.1554459-1-colin.foster@in-advantage.com> <20220922040102.1554459-9-colin.foster@in-advantage.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Sep 2022 21:00:56 -0700 Colin Foster wrote: > During development, it was believed that a wrapper for ocelot_regmap_init() > would be sufficient for the felix driver to work in non-mmio scenarios. > This was merged in during commit 242bd0c10bbd ("net: dsa: ocelot: felix: > add interface for custom regmaps") > > As the external ocelot DSA driver grew closer to an acceptable state, it > was realized that most of the parameters that were passed in from struct > resource *res were useless and ignored. This is due to the fact that the > external ocelot DSA driver utilizes dev_get_regmap(dev, resource->name). > > Instead of simply ignoring those parameters, refactor the API to only > require the name as an argument. MMIO scenarios this will reconstruct the > struct resource before calling ocelot_regmap_init(ocelot, resource). MFD > scenarios need only call dev_get_regmap(dev, name). > > Signed-off-by: Colin Foster drivers/net/dsa/ocelot/felix.c:1328:14: warning: variable 'match' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized] for (i = 0; i < TARGET_MAX; i++) { ^~~~~~~~~~~~~~ drivers/net/dsa/ocelot/felix.c:1338:7: note: uninitialized use occurs here if (!match) { ^~~~~ drivers/net/dsa/ocelot/felix.c:1328:14: note: remove the condition if it is always true for (i = 0; i < TARGET_MAX; i++) { ^~~~~~~~~~~~~~ drivers/net/dsa/ocelot/felix.c:1324:30: note: initialize the variable 'match' to silence this warning const struct resource *match; ^ = NULL