From patchwork Sat Sep 24 01:53:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987307 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89754C07E9D for ; Sat, 24 Sep 2022 01:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233009AbiIXBxq (ORCPT ); Fri, 23 Sep 2022 21:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232932AbiIXBxp (ORCPT ); Fri, 23 Sep 2022 21:53:45 -0400 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E81106529; Fri, 23 Sep 2022 18:53:44 -0700 (PDT) Received: by mail-qv1-xf2a.google.com with SMTP id l14so1038916qvq.8; Fri, 23 Sep 2022 18:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=H1UaOTpezQWNyZKXRTONOpsHys97wRpqFpTI6Zr1YuY=; b=inp7n0QA5p8anUYe8CCsOphpF3rIrxEVB1QR+ClplsUiGfl+QW5A4WUIKYfWC76Nb3 7pJqgukW+yh4J4/NKWLfrRHTVEzNEBGQY2iq6Tk6DgLwnhWPgbXlRnkPBg3OCQhMIdit u74U4kxvL+EF29wIQPWkUPt2Yg9RrAZ0pFIi9Da+DJFRgrIfaXJww+LUVlNnYiOGDvyw NDqlvGza4O8YCYyUYHJe4VAAV7eF3WiLBb114qa+vFtvFUcgSfzl232ipbiV1uUEHC/w yObPUMif1RmXBhdlEN3H9Bn7x9DCX8/k6KByxHtd48F1IPAjLLm3EGhIgpmc3KzfHFqP tEdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=H1UaOTpezQWNyZKXRTONOpsHys97wRpqFpTI6Zr1YuY=; b=GbDr7nh7FsKP0IJJ+MmT0ZORvGirKwmL43K4KjZ5V8ryrZUsRoNrXUpTQjytT7HXh0 A15e78Q7DeXGQcNDUQkYRhihs4601WqsdYAB6ABm4XqdA1v3SyprKtjSUtFzUjddFa9d IOZsGw8WBXcNBT9hNGRiBpeHtMzoR1c+mUysHp4b0KES84hUPeZTRjW4FoCGUdU6iC0b esvTVzy9GCZooem4UDaRES+idIfP+PgHLe07fZNQ3LMpksFptpTGpvOZyaXpo6Byhm1r gmdQYzkCu1gxukqNO955o2cAe5wS9lHDJnYvF2uw+g+lIZHRFmVGpXqjXpYjuye5nCoe CIxA== X-Gm-Message-State: ACrzQf14hVSzBwJMXMqE4rv6trfiLIXoHzk734hVZKUPgSzNS0nSvnKB QEJ84AU/kgLcRX7gfWq41B4= X-Google-Smtp-Source: AMsMyM6SaF7yVnz7G9pkKIWzOtbx0ys3YxyqEi6q6nbRya0jENAUE+CkV/4R2no91GsXh8Y66WCgDQ== X-Received: by 2002:a05:6214:2303:b0:4ad:58f2:7ca4 with SMTP id gc3-20020a056214230300b004ad58f27ca4mr9134294qvb.89.1663984423937; Fri, 23 Sep 2022 18:53:43 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id i10-20020ac8764a000000b0035badb499c7sm6962360qtr.21.2022.09.23.18.53.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:43 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 01/13] sunhme: remove unused tx_dump_ring() Date: Fri, 23 Sep 2022 21:53:27 -0400 Message-Id: <20220924015339.1816744-2-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rolf Eike Beer I can't find a reference to it in the entire git history. Signed-off-by: Rolf Eike Beer Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index e660902cfdf7..987f4c7338f5 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -135,25 +135,9 @@ static __inline__ void tx_dump_log(void) this = (this + 1) & (TX_LOG_LEN - 1); } } -static __inline__ void tx_dump_ring(struct happy_meal *hp) -{ - struct hmeal_init_block *hb = hp->happy_block; - struct happy_meal_txd *tp = &hb->happy_meal_txd[0]; - int i; - - for (i = 0; i < TX_RING_SIZE; i+=4) { - printk("TXD[%d..%d]: [%08x:%08x] [%08x:%08x] [%08x:%08x] [%08x:%08x]\n", - i, i + 4, - le32_to_cpu(tp[i].tx_flags), le32_to_cpu(tp[i].tx_addr), - le32_to_cpu(tp[i + 1].tx_flags), le32_to_cpu(tp[i + 1].tx_addr), - le32_to_cpu(tp[i + 2].tx_flags), le32_to_cpu(tp[i + 2].tx_addr), - le32_to_cpu(tp[i + 3].tx_flags), le32_to_cpu(tp[i + 3].tx_addr)); - } -} #else #define tx_add_log(hp, a, s) do { } while(0) #define tx_dump_log() do { } while(0) -#define tx_dump_ring(hp) do { } while(0) #endif #ifdef HMEDEBUG From patchwork Sat Sep 24 01:53:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987308 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DB42C04A95 for ; Sat, 24 Sep 2022 01:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233032AbiIXBxu (ORCPT ); Fri, 23 Sep 2022 21:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbiIXBxr (ORCPT ); Fri, 23 Sep 2022 21:53:47 -0400 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51E4D106529; Fri, 23 Sep 2022 18:53:46 -0700 (PDT) Received: by mail-qv1-xf2a.google.com with SMTP id m9so1043090qvv.7; Fri, 23 Sep 2022 18:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=EMSKPlPuK4q/nTKtVAaS1LoKYLaCiDbMiUAnbQLl7/w=; b=PhXhgakoDqjO2sh84la5qnE8A+4MUk0IFBS3y4yqnl2OkknazWfOUEI4KpJZx2TqQ0 m5W8GDSXd2QTEQu6XqvG9hYrk9nFR4bDv0IZC+E23nqHLLhvPUBJmQ7L2C7/AC2QBOtK jXun7++gEeHNCASaISR/8jthkY3Wy2tZqdyV2wom9KKrexyihVTYYmv7bM9tur3feRKm wFf9PxVZyo0V2SjVVhkkmPLnNS8HDrNgSYIMMlI3/2pgwjagHUoxEPx84W+udEto+lPS TYD9Crp5Bm+qLVSj1VPW1A3ztQdQnYneCEmWyMtbQGvQE482ZM7ObrnrTq/Q9uOe2zKp 5AZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=EMSKPlPuK4q/nTKtVAaS1LoKYLaCiDbMiUAnbQLl7/w=; b=zDbI6sYsulBQ0kNXnk8HqMBJk+oTzzu+NE/iM+u0qGcWFtTqymLjwLK8bTbZUwdaNQ IIB3OEJrKo60cdKO6MxyiqYCQnXPkxpL/kwiezbIHLRFD/U9/logE+BFQAn1IxmpgIY6 mRggE/AMNHNhhLgvAC06btXI6jaZBFM53XooXprJ8XcqDQQgQRKJYxD/bkz8Y3tCSeMx TC89ijjL+oe2C9MYylSy24QXwgBlpMdDp89P+5wykHia3Rfy9SW4YzkubZvBdL2+8e0s oOd9OT7AKm7mCITL4tI84pLdZPglLIT5XZkXuboK/peipWnBUwYsj7c0IGEKZ5CIgIbw 7agQ== X-Gm-Message-State: ACrzQf0xkFfEHt+p5+dkMDP+XRU+vHPL9+DO8UD/JwZNg3dGhk3Qwaaq PKDj+uKKLtRNAbi7yR/1tnc= X-Google-Smtp-Source: AMsMyM5beK1ddavxGdhZSlhTuLFdyqfh1+8n68Ek1gQtSjQpfUh3sDmOnjv1GLEhZlEvGqJoFF0g5w== X-Received: by 2002:a0c:a950:0:b0:4aa:e2ac:922a with SMTP id z16-20020a0ca950000000b004aae2ac922amr9301111qva.119.1663984425443; Fri, 23 Sep 2022 18:53:45 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id y26-20020a37f61a000000b006ceb933a9fesm6961864qkj.81.2022.09.23.18.53.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:44 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 02/13] sunhme: Remove version Date: Fri, 23 Sep 2022 21:53:28 -0400 Message-Id: <20220924015339.1816744-3-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Module versions are not very useful: > The basic problem is, the version string does not identify the sources > with enough accuracy. It says nothing about back ported fixes in > stable kernels. It tells you nothing about vendor patches to the > network core, etc. https://lore.kernel.org/all/Yf6mtvA1zO7cdzr7@lunn.ch/ While we're at it, inline the author and use the driver name a bit more. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 987f4c7338f5..7340d0f2ef93 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -61,15 +61,8 @@ #include "sunhme.h" #define DRV_NAME "sunhme" -#define DRV_VERSION "3.10" -#define DRV_RELDATE "August 26, 2008" -#define DRV_AUTHOR "David S. Miller (davem@davemloft.net)" -static char version[] = - DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n"; - -MODULE_VERSION(DRV_VERSION); -MODULE_AUTHOR(DRV_AUTHOR); +MODULE_AUTHOR("David S. Miller (davem@davemloft.net)"); MODULE_DESCRIPTION("Sun HappyMealEthernet(HME) 10/100baseT ethernet driver"); MODULE_LICENSE("GPL"); @@ -2451,8 +2444,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info { struct happy_meal *hp = netdev_priv(dev); - strscpy(info->driver, "sunhme", sizeof(info->driver)); - strscpy(info->version, "2.02", sizeof(info->version)); + strscpy(info->driver, DRV_NAME, sizeof(info->driver)); if (hp->happy_flags & HFLAG_PCI) { struct pci_dev *pdev = hp->happy_dev; strscpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info)); @@ -2488,8 +2480,6 @@ static const struct ethtool_ops hme_ethtool_ops = { .set_link_ksettings = hme_set_link_ksettings, }; -static int hme_version_printed; - #ifdef CONFIG_SBUS /* Given a happy meal sbus device, find it's quattro parent. * If none exist, allocate and return a new one. @@ -2973,9 +2963,6 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, goto err_out; SET_NETDEV_DEV(dev, &pdev->dev); - if (hme_version_printed++ == 0) - printk(KERN_INFO "%s", version); - hp = netdev_priv(dev); hp->happy_dev = pdev; From patchwork Sat Sep 24 01:53:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987309 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2069DC07E9D for ; Sat, 24 Sep 2022 01:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233036AbiIXBxv (ORCPT ); Fri, 23 Sep 2022 21:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233014AbiIXBxt (ORCPT ); Fri, 23 Sep 2022 21:53:49 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF73109508; Fri, 23 Sep 2022 18:53:48 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id i3so1188116qkl.3; Fri, 23 Sep 2022 18:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=mEOjjinJBS1qWUuCIBh6UgT1Mu6ffVpl8EY8geKQjdE=; b=EMH7sxk/K27lQL6ZB5kjAnloR9i2W8DN1+MrlObnr2w/1Nn7QWI/vs/K4qQV9nuRjS 9WQPaTwntilZ91gEWZfzLgSWaTSoEzJUZz9JOIRPsKCEVheQjc2DVpRNT1+6w+P0G6AC 1os4ARjc1OxpAm1gnvqbSiiAp8qfo1FIwZIPbCQm88IYKVlgUN8YCht6uZPtGrmpjg3B eVnJGs+lTFUZEnRDX8gNugMGJViInBkhLMAUHqpSsAg/IiTpNBzx6NLT4fCKZE6HwtSr gdzopsNu611sZdca9+ZgrVd9PRzVZVJYQftlC+8TJPvZpFLDt2shXWe76OLecwJvXdeB ETzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=mEOjjinJBS1qWUuCIBh6UgT1Mu6ffVpl8EY8geKQjdE=; b=cs5cvsrtM+OCJyhjjegpIMhF8vxGKmcWIDgb5fD0OlWifEANYe3h0Wb5Z1qInynDfL 36USeek5u6ubDLiCOv9+I2M7rsgIW6Db9qVUj63wVM7RtgGvLSUtK/Cel0xWUTEtBFnF Hm8wILFQh056NK6vVzywC3/pDKo+RWrB/hTLo616EG2pK7DTeHPu3JrxcYY7jNTZ/X4C ps6UZP7V5Yjg79ArwoIw+mlRNNjfVEpZFht89aZZl7utDDDuYCQBrStfUjTM/eUcuG/n n1EmBlPw1l2+hhL+vZX/RIMxgORcSV/vKCkATZ1da0NqESVRt/2+CQ7VBrY4c3/XNURs tU0Q== X-Gm-Message-State: ACrzQf3KGHVpcaoLWS1tEcbeRvXC3w/Fd+eb72TN5eeuMJ/0H3ZiqptY 5uY5Kg7UQFhcmuNJ/hlQe5c= X-Google-Smtp-Source: AMsMyM5wRuds6mIcmGqNHQHGC/IcVsmZJD8v2ZeMHicGQuWZDTawbS3y3YvaSADXqlNUbWxLT3fyIA== X-Received: by 2002:a37:65d0:0:b0:6cd:cce9:bd71 with SMTP id z199-20020a3765d0000000b006cdcce9bd71mr7590594qkb.353.1663984426818; Fri, 23 Sep 2022 18:53:46 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id o13-20020a05620a2a0d00b006baef6daa45sm7291133qkp.119.2022.09.23.18.53.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:46 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 03/13] sunhme: forward the error code from pci_enable_device() Date: Fri, 23 Sep 2022 21:53:29 -0400 Message-Id: <20220924015339.1816744-4-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rolf Eike Beer This already returns a proper error value, so pass it to the caller. Signed-off-by: Rolf Eike Beer Signed-off-by: Sean Anderson --- Changes in v2: - Remove space after pci_enable_device drivers/net/ethernet/sun/sunhme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 7340d0f2ef93..63a7cacd8286 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2940,11 +2940,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, strcpy(prom_name, "SUNW,hme"); #endif - err = -ENODEV; - - if (pci_enable_device(pdev)) + err = pci_enable_device(pdev); + if (err) goto err_out; pci_set_master(pdev); + err = -ENODEV; if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); From patchwork Sat Sep 24 01:53:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987310 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DE28C6FA8E for ; Sat, 24 Sep 2022 01:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232932AbiIXBxw (ORCPT ); Fri, 23 Sep 2022 21:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233015AbiIXBxt (ORCPT ); Fri, 23 Sep 2022 21:53:49 -0400 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43969109510; Fri, 23 Sep 2022 18:53:48 -0700 (PDT) Received: by mail-qv1-xf2a.google.com with SMTP id l14so1038965qvq.8; Fri, 23 Sep 2022 18:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=LeIBCym424oVAIElfANjqwZrpZymtgMFimxYd8UvdhU=; b=Diola2BHO65ypIhX09MTSMO4KEJZgBhIRR917z3AidVM7m+htt/PyTpl6E+nGGDGUS 6vKeb8EZQl/+lPfwgnVfovLmMmV5asaLHBHjDYQql2R53WNoOzpH7/wfBQw+ZrKIsu/y SY9MVkuLsXo234IpOXvGjJW4doX2uzlpBz7gp+5aokx6D3Exca0TZN97r0PPBNGeavwG Qzq+nb6hqVmxD2DRQHq/n36MF0NttkZYImPmFkw2Ewz/7DC1PBNAe5gH5dh4W+3Roes/ jYelgMdunTLPsRDmgKV9ARi16W97UUFAh65Lqsk/rgicloa+fG6cWwIlnWw8HJHlpx0p orsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=LeIBCym424oVAIElfANjqwZrpZymtgMFimxYd8UvdhU=; b=Iw0RPcRZ03zOsCUiKR7KWLLI8L2AH1lzCD3h3kd+vIhiyoUzUarptB7VmFASYnAUlT GBua6yzdy+SqIl/xEqkh+J1ilFBdn+CzzvB34LucrefFp6OD775C+BOS49K3qlqzxL54 YC0joU4gYCTI0jHwoonH55R7B0UU2/UZhAy6m09gu8Q+e1vTbB0rBiWBTN+kdOI/D2iS 9qaKUgEaa7YmytAIxakPj+Oym14UG5AGZGqpK3+GRba/4XBTeeBuUs/ADF1zoL02PVpe 7kjKtIZR1ebhNub7a4crPwM42NxOGUHHpnVVKrjt6E0Ny2vlQJSdjFCRdFuweRD6h0GM dxVA== X-Gm-Message-State: ACrzQf093ZrIhTJDkntcnrrrHzdAw/OPRdGKFw4vg/ar3s3y5jx/mOso kcKjfEK4DdQPLPjj4vW31yA= X-Google-Smtp-Source: AMsMyM6Vjf9ItGJmdPx5JYFBE5MzPJ5VGy0zRZvBouF4abAmqvE2SKaDpoZa+fEbckOcwdM3kgODhg== X-Received: by 2002:a05:6214:d05:b0:4ac:daac:f1c4 with SMTP id 5-20020a0562140d0500b004acdaacf1c4mr9267552qvh.84.1663984427996; Fri, 23 Sep 2022 18:53:47 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id k16-20020a05620a415000b006cbe3be300esm7713603qko.12.2022.09.23.18.53.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:47 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 04/13] sunhme: Return an ERR_PTR from quattro_pci_find Date: Fri, 23 Sep 2022 21:53:30 -0400 Message-Id: <20220924015339.1816744-5-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In order to differentiate between a missing bridge and an OOM condition, return ERR_PTRs from quattro_pci_find. This also does some general linting in the area. Signed-off-by: Sean Anderson --- Changes in v2: - Use memset to clear p->happy_meals drivers/net/ethernet/sun/sunhme.c | 49 +++++++++++++++++-------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 63a7cacd8286..b0843210beb9 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2498,18 +2498,16 @@ static struct quattro *quattro_sbus_find(struct platform_device *child) return qp; qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); - if (qp != NULL) { - int i; + if (!qp) + return NULL; - for (i = 0; i < 4; i++) - qp->happy_meals[i] = NULL; + memset(qp->happy_meals, 0, sizeof(*qp->happy_meals)); - qp->quattro_dev = child; - qp->next = qfe_sbus_list; - qfe_sbus_list = qp; + qp->quattro_dev = child; + qp->next = qfe_sbus_list; + qfe_sbus_list = qp; - platform_set_drvdata(op, qp); - } + platform_set_drvdata(op, qp); return qp; } @@ -2569,30 +2567,33 @@ static void quattro_sbus_free_irqs(void) #ifdef CONFIG_PCI static struct quattro *quattro_pci_find(struct pci_dev *pdev) { + int i; struct pci_dev *bdev = pdev->bus->self; struct quattro *qp; - if (!bdev) return NULL; + if (!bdev) + return ERR_PTR(-ENODEV); + for (qp = qfe_pci_list; qp != NULL; qp = qp->next) { struct pci_dev *qpdev = qp->quattro_dev; if (qpdev == bdev) return qp; } + qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); - if (qp != NULL) { - int i; + if (!qp) + return ERR_PTR(-ENOMEM); - for (i = 0; i < 4; i++) - qp->happy_meals[i] = NULL; + for (i = 0; i < 4; i++) + qp->happy_meals[i] = NULL; - qp->quattro_dev = bdev; - qp->next = qfe_pci_list; - qfe_pci_list = qp; + qp->quattro_dev = bdev; + qp->next = qfe_pci_list; + qfe_pci_list = qp; - /* No range tricks necessary on PCI. */ - qp->nranges = 0; - } + /* No range tricks necessary on PCI. */ + qp->nranges = 0; return qp; } #endif /* CONFIG_PCI */ @@ -2948,11 +2949,15 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); - if (qp == NULL) + if (IS_ERR(qp)) { + err = PTR_ERR(qp); goto err_out; + } + for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) - if (qp->happy_meals[qfe_slot] == NULL) + if (!qp->happy_meals[qfe_slot]) break; + if (qfe_slot == 4) goto err_out; } From patchwork Sat Sep 24 01:53:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987311 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ACE4C07E9D for ; Sat, 24 Sep 2022 01:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231833AbiIXByO (ORCPT ); Fri, 23 Sep 2022 21:54:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbiIXBxw (ORCPT ); Fri, 23 Sep 2022 21:53:52 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30017109130; Fri, 23 Sep 2022 18:53:50 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id a20so1109065qtw.10; Fri, 23 Sep 2022 18:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=OO0GtcNtQwihzrk2K6fcu3YyCXtG90+hs6GbEQ7Yrns=; b=ksrD5vWyumDXyswFvQS4t1GX0pqsh6URmojGHzCdASf/3MzLelYopfyWsnhexfdzN3 QmtfFSe1zJeAEK4/wix362ZwaQJAQf+kX7xuz2kGzkC9fYR23+RUle+TE8qlUhRYTqrU qTcPJ28Wn6h8G+tGBiKoclPRHc6qB4rdcLrY04z7J/80gWvjycgpRX/lFJXF4ALqO1x9 iUjhvcSkffbDbKjxLzhAcn9JXpUIHkkH+6OTwt3zw9E5toS6X0W7xYcK3u3aDNGgXRcK wuCxmZ4LLGTHrEEFfpXDhsCdMiVEQt6M0zu7900RZOJPwQTKtcoJowsl8KalWrlHTrOq WTXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=OO0GtcNtQwihzrk2K6fcu3YyCXtG90+hs6GbEQ7Yrns=; b=0QI4EwNymaBEifbqIe0co9Cjx1n94uisF4+DUUINrOyMltwWbX13RxLwHrlB7BIxZp 8XV9ue66w6vbyH9sZ/311SsVjOOVNUuMkJcAxqaVFhZYnL9akXoxzAOjSWyrNnImbYaI Qzx75Ghm4yUUxWOKYSrUKKwDOMKD2vqiEoeyiQD3U9Ax3csxUGGdXncaOAzQUNQFSnOz lh/tS1KagSxsHbIsdmY0B1yR+hwWUTCtQri+Ngk8dfQLeUJ5GrAErq9piCcWsAi5EqDF 7+xcYIXZhYEpog6eghiERW+QwAE3cnaqcxDbEPLC7pe2hXdKJkmG1O2tSSoM55rkEAZn HAgg== X-Gm-Message-State: ACrzQf1PjgX+gFuYKMYLpD3vuo6SCKy4OXMF1QxefHzyiEmVkFUwmO0h AYlymwfGvbItyhynmAKaZ/E= X-Google-Smtp-Source: AMsMyM4OatpQr119T45L0Jv3SGf4MvJddJhl+cI+87UkDo5lwwjryrW/as9WbYFxOVwGMinCgtGZTQ== X-Received: by 2002:ac8:7f54:0:b0:35d:159d:f88e with SMTP id g20-20020ac87f54000000b0035d159df88emr8748288qtk.415.1663984429224; Fri, 23 Sep 2022 18:53:49 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id bn29-20020a05620a2add00b006bbf85cad0fsm6945531qkb.20.2022.09.23.18.53.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:48 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 05/13] sunhme: Regularize probe errors Date: Fri, 23 Sep 2022 21:53:31 -0400 Message-Id: <20220924015339.1816744-6-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This fixes several error paths to ensure they return an appropriate error (instead of ENODEV). Signed-off-by: Sean Anderson --- Changes in v2: - Set err inside error branches drivers/net/ethernet/sun/sunhme.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index b0843210beb9..26b5e44a6f2e 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2945,7 +2945,6 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, if (err) goto err_out; pci_set_master(pdev); - err = -ENODEV; if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); @@ -2963,9 +2962,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } dev = alloc_etherdev(sizeof(struct happy_meal)); - err = -ENOMEM; - if (!dev) + if (!dev) { + err = -ENOMEM; goto err_out; + } SET_NETDEV_DEV(dev, &pdev->dev); hp = netdev_priv(dev); @@ -2982,18 +2982,22 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } hpreg_res = pci_resource_start(pdev, 0); - err = -ENODEV; + err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } - if (pci_request_regions(pdev, DRV_NAME)) { + + err = pci_request_regions(pdev, DRV_NAME); + if (err) { printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " "aborting.\n"); goto err_out_clear_quattro; } - if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == NULL) { + hpreg_base = ioremap(hpreg_res, 0x8000); + if (!hpreg_base) { + err = -ENOMEM; printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); goto err_out_free_res; } @@ -3063,9 +3067,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma, GFP_KERNEL); - err = -ENODEV; - if (!hp->happy_block) + if (!hp->happy_block) { + err = -ENOMEM; goto err_out_iounmap; + } hp->linkcheck = 0; hp->timer_state = asleep; From patchwork Sat Sep 24 01:53:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987312 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30354C04A95 for ; Sat, 24 Sep 2022 01:54:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233101AbiIXByT (ORCPT ); Fri, 23 Sep 2022 21:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233053AbiIXBxy (ORCPT ); Fri, 23 Sep 2022 21:53:54 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B345810953B; Fri, 23 Sep 2022 18:53:51 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id c6so1037432qvn.6; Fri, 23 Sep 2022 18:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=6w3YkN0UHp7fqEFzoZUCtmaO0hnkOPKKUS5sVUpFAGg=; b=So4zIkSAw2gyB7bXCfeOV0xEgH/+L8qTcnWc6C9EhS2YW0P9xM0O7XOl4I0dZ7lYTB dI94J8T/BKned6BsV6iXAMfVV9EnLoHriyUyhdPQaMLh4+vtZmAI7dtQG8nO5K80R3AC 9KWHEfsadLsSRRPZRb4we6HKvHzohDRIxhxU9xXhvLUZWymSWJU4rsXUjxkidePZmS6P el9O2OjjcOTguG+hFYo+70EIeuc2wYhT2/z14ycVu7q3zYdSSvzh6gzF3Lz18yFmXhGX ENOK/DIArl1fY0wC03fNSGrvR4Lwes5ikqdPXE23W3djj8MYRQ4pNwPBtEmIMAgEq9cx 0L1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=6w3YkN0UHp7fqEFzoZUCtmaO0hnkOPKKUS5sVUpFAGg=; b=8ATpAWvhdJamrZWENsE0qyykX8McLWKYLDXGwWHGWxAK+4tNN4P2KCa0Zjj6NbXyWH CA+/IPk0362W0Kl+yDyKVZtg8fybQnPCs9ICa66mj0ZGkXxTPX2wymAU54LCP202Y5Fn UWp3cQKPHTl0JER+DhaU1dvHSsJ6RauYOgHlezo8lGW/4yekKsJEAh/ZUsZyWDloEkEu xTtAXBVZUuJlqogrHiMWVwJ67GsBzE0tkxE65Te7m++C23nEhBO7dzEgFe6jpQWjtPsz dOfRw3X+Y1DLlsnJAjJ7gIbZJkgZjlPrZ0zX6KFjpXDnjzKSCxFo0nvCJ0x+ywZuPWc6 ko3Q== X-Gm-Message-State: ACrzQf3Hw9su/16oljWnyP7goi0Tp3+J73D/GgVUGi4LxG6pqY2hM0ge A4QYPNEBgMUmyD5AM26FGb8= X-Google-Smtp-Source: AMsMyM4pqSi7fgOPqM5AlyX9e9Cn/OnWKNA/AIxTCuwEHCXocfwM9tp9dSXR9Do87Js8n6RjWbs4TQ== X-Received: by 2002:a05:6214:2aaa:b0:4ac:acbd:7ef8 with SMTP id js10-20020a0562142aaa00b004acacbd7ef8mr9221607qvb.126.1663984430427; Fri, 23 Sep 2022 18:53:50 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id o26-20020ac8555a000000b0035ce8965045sm6448804qtr.42.2022.09.23.18.53.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:50 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 06/13] sunhme: switch to devres Date: Fri, 23 Sep 2022 21:53:32 -0400 Message-Id: <20220924015339.1816744-7-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Rolf Eike Beer This not only removes a lot of code, it also fixes the memleak of the DMA memory when register_netdev() fails. Signed-off-by: Rolf Eike Beer [ rebased onto net-next/master; fixed error reporting ] Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 55 ++++++++----------------------- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 26b5e44a6f2e..7d6825c573a2 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2924,7 +2924,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, struct happy_meal *hp; struct net_device *dev; void __iomem *hpreg_base; - unsigned long hpreg_res; + struct resource *hpreg_res; int i, qfe_slot = -1; char prom_name[64]; u8 addr[ETH_ALEN]; @@ -2941,7 +2941,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, strcpy(prom_name, "SUNW,hme"); #endif - err = pci_enable_device(pdev); + err = pcim_enable_device(pdev); if (err) goto err_out; pci_set_master(pdev); @@ -2961,7 +2961,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, goto err_out; } - dev = alloc_etherdev(sizeof(struct happy_meal)); + dev = devm_alloc_etherdev(&pdev->dev, sizeof(struct happy_meal)); if (!dev) { err = -ENOMEM; goto err_out; @@ -2981,25 +2981,26 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, qp->happy_meals[qfe_slot] = dev; } - hpreg_res = pci_resource_start(pdev, 0); err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } - err = pci_request_regions(pdev, DRV_NAME); - if (err) { + hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0), DRV_NAME); + if (IS_ERR(hpreg_res)) { + err = PTR_ERR(hpreg_res); printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " "aborting.\n"); goto err_out_clear_quattro; } - hpreg_base = ioremap(hpreg_res, 0x8000); + hpreg_base = pcim_iomap(pdev, 0, 0x8000); if (!hpreg_base) { err = -ENOMEM; printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); - goto err_out_free_res; + goto err_out_clear_quattro; } for (i = 0; i < 6; i++) { @@ -3065,11 +3066,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, hp->happy_bursts = DMA_BURSTBITS; #endif - hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, - &hp->hblock_dvma, GFP_KERNEL); + hp->happy_block = dmam_alloc_coherent(&pdev->dev, PAGE_SIZE, + &hp->hblock_dvma, GFP_KERNEL); if (!hp->happy_block) { err = -ENOMEM; - goto err_out_iounmap; + goto err_out_clear_quattro; } hp->linkcheck = 0; @@ -3104,11 +3105,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, happy_meal_set_initial_advertisement(hp); spin_unlock_irq(&hp->happy_lock); - err = register_netdev(hp->dev); + err = devm_register_netdev(&pdev->dev, dev); if (err) { printk(KERN_ERR "happymeal(PCI): Cannot register net device, " "aborting.\n"); - goto err_out_free_coherent; + goto err_out_clear_quattro; } pci_set_drvdata(pdev, hp); @@ -3141,41 +3142,14 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, return 0; -err_out_free_coherent: - dma_free_coherent(hp->dma_dev, PAGE_SIZE, - hp->happy_block, hp->hblock_dvma); - -err_out_iounmap: - iounmap(hp->gregs); - -err_out_free_res: - pci_release_regions(pdev); - err_out_clear_quattro: if (qp != NULL) qp->happy_meals[qfe_slot] = NULL; - free_netdev(dev); - err_out: return err; } -static void happy_meal_pci_remove(struct pci_dev *pdev) -{ - struct happy_meal *hp = pci_get_drvdata(pdev); - struct net_device *net_dev = hp->dev; - - unregister_netdev(net_dev); - - dma_free_coherent(hp->dma_dev, PAGE_SIZE, - hp->happy_block, hp->hblock_dvma); - iounmap(hp->gregs); - pci_release_regions(hp->happy_dev); - - free_netdev(net_dev); -} - static const struct pci_device_id happymeal_pci_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) }, { } /* Terminating entry */ @@ -3187,7 +3161,6 @@ static struct pci_driver hme_pci_driver = { .name = "hme", .id_table = happymeal_pci_ids, .probe = happy_meal_pci_probe, - .remove = happy_meal_pci_remove, }; static int __init happy_meal_pci_init(void) From patchwork Sat Sep 24 01:53:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987313 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59660C07E9D for ; Sat, 24 Sep 2022 01:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233109AbiIXByh (ORCPT ); Fri, 23 Sep 2022 21:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233015AbiIXByM (ORCPT ); Fri, 23 Sep 2022 21:54:12 -0400 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E32B10D64B; Fri, 23 Sep 2022 18:53:53 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id d15so1168793qka.9; Fri, 23 Sep 2022 18:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=YwzcTSHue/aTP/bYbUu3/ubH6aMaGvNmLvEjU7mjOAk=; b=aNajAbEZmkYzW6vUxA3ESZhgrcD4YBS/N/qZPljmDYhjvNE15vaLigGEj1DxbeHA9c D/zhuumVMwRW5Qj36HmNmUXv6RQpsGzknVxkdsEKXH10BeJ80XNryNOo5eaSynVUJwPB HIMedsDiTydtdU+P8DrnZuzGxNo7vgyoM7yIZDhNO8ltpQAFYWAZUG+TvvNpQ4SsuBLp a727i5OkiQPnrd5gk4VLHDO07EiQajRflFPfztgi5dtQDigNO34Z0rGCzr4C+FVV7mCX 2rj13+VwxJw5tpWQiL/qj3XuxsmF0vQD8D850iCmVHCiMkUJoHhPrFIO0TCtsUCat+QF XVpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YwzcTSHue/aTP/bYbUu3/ubH6aMaGvNmLvEjU7mjOAk=; b=JAs/Twxksob3g4A+D9BmqlXAq4we3AKAHVan0qXGQWbz3+p81ak7ttafqbr5nnNr9s STdT9PEMLV6axR2aUfkeVdjKq3q+bWcRtbCDDBr83qBlozdOBngs2Hfz0x3poZuoz8kt XGLEI/Gv6YoIm6+as1bBBqnEHUXNoD4iYqSEFVLim+1q1g/6LdWhuKKYHROSUKzetNwg 1h39GAqTq7gESrCPyuZ0ogigxXZrHop495tkPgpi/LEZO96D5q010no/YVXYJkQlhLcn nacJmYNQiqBJITWyhfyZOgtpCfmUX6Jvhxo2fFiHYy4bqgLcMpQ+y7Z3DSCLNMVQK9fa WiYw== X-Gm-Message-State: ACrzQf3PMEcguSSuZOgsK/Qwn6qiuuV2ATjf6s4HVSSCuKBls7GoIErl vn+A84LywkiVELGlrnM49Do= X-Google-Smtp-Source: AMsMyM4J6rQvGwQa8ZFg7VFGI6NLFE5P5yDTKHbeY3pI66PtsGAi842E6FcNSdXI/KTuFP8DGxX3Vg== X-Received: by 2002:a05:620a:290c:b0:6ce:6686:109e with SMTP id m12-20020a05620a290c00b006ce6686109emr7465135qkp.741.1663984431984; Fri, 23 Sep 2022 18:53:51 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id 22-20020a05620a06d600b006cc190f627bsm6704827qky.63.2022.09.23.18.53.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:51 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 07/13] sunhme: Convert FOO((...)) to FOO(...) Date: Fri, 23 Sep 2022 21:53:33 -0400 Message-Id: <20220924015339.1816744-8-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org With the power of variadic macros, double parentheses are unnecessary. Signed-off-by: Sean Anderson --- Changes in v2: - sumhme -> sunhme drivers/net/ethernet/sun/sunhme.c | 272 +++++++++++++++--------------- 1 file changed, 136 insertions(+), 136 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 7d6825c573a2..77a2a192f2ce 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -134,17 +134,17 @@ static __inline__ void tx_dump_log(void) #endif #ifdef HMEDEBUG -#define HMD(x) printk x +#define HMD printk #else -#define HMD(x) +#define HMD(...) #endif /* #define AUTO_SWITCH_DEBUG */ #ifdef AUTO_SWITCH_DEBUG -#define ASD(x) printk x +#define ASD printk #else -#define ASD(x) +#define ASD(...) #endif #define DEFAULT_IPG0 16 /* For lance-mode only */ @@ -320,7 +320,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, int retval = 0; int i; - ASD(("happy_meal_bb_read: reg=%d ", reg)); + ASD("happy_meal_bb_read: reg=%d ", reg); /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -355,7 +355,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); - ASD(("value=%x\n", retval)); + ASD("value=%x\n", retval); return retval; } @@ -366,7 +366,7 @@ static void happy_meal_bb_write(struct happy_meal *hp, u32 tmp; int i; - ASD(("happy_meal_bb_write: reg=%d value=%x\n", reg, value)); + ASD("happy_meal_bb_write: reg=%d value=%x\n", reg, value); /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -410,14 +410,14 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, int tries = TCVR_READ_TRIES; int retval; - ASD(("happy_meal_tcvr_read: reg=0x%02x ", reg)); + ASD("happy_meal_tcvr_read: reg=0x%02x ", reg); if (hp->tcvr_type == none) { - ASD(("no transceiver, value=TCVR_FAILURE\n")); + ASD("no transceiver, value=TCVR_FAILURE\n"); return TCVR_FAILURE; } if (!(hp->happy_flags & HFLAG_FENABLE)) { - ASD(("doing bit bang\n")); + ASD("doing bit bang\n"); return happy_meal_bb_read(hp, tregs, reg); } @@ -430,7 +430,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; - ASD(("value=%04x\n", retval)); + ASD("value=%04x\n", retval); return retval; } @@ -442,7 +442,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, { int tries = TCVR_WRITE_TRIES; - ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value)); + ASD("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value); /* Welcome to Sun Microsystems, can I take your order please? */ if (!(hp->happy_flags & HFLAG_FENABLE)) { @@ -807,7 +807,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = TX_RESET_TRIES; - HMD(("happy_meal_tx_reset: reset, ")); + HMD("happy_meal_tx_reset: reset, "); /* Would you like to try our SMCC Delux? */ hme_write32(hp, bregs + BMAC_TXSWRESET, 0); @@ -819,7 +819,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!"); /* Take care. */ - HMD(("done\n")); + HMD("done\n"); } /* hp->happy_lock must be held */ @@ -827,7 +827,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = RX_RESET_TRIES; - HMD(("happy_meal_rx_reset: reset, ")); + HMD("happy_meal_rx_reset: reset, "); /* We have a special on GNU/Viking hardware bugs today. */ hme_write32(hp, bregs + BMAC_RXSWRESET, 0); @@ -839,7 +839,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!"); /* Don't forget your vik_1137125_wa. Have a nice day. */ - HMD(("done\n")); + HMD("done\n"); } #define STOP_TRIES 16 @@ -849,7 +849,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) { int tries = STOP_TRIES; - HMD(("happy_meal_stop: reset, ")); + HMD("happy_meal_stop: reset, "); /* We're consolidating our STB products, it's your lucky day. */ hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); @@ -861,7 +861,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) printk(KERN_ERR "happy meal: Fry guys."); /* Remember: "Different name, same old buggy as shit hardware." */ - HMD(("done\n")); + HMD("done\n"); } /* hp->happy_lock must be held */ @@ -890,21 +890,21 @@ static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) /* hp->happy_lock must be held */ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) { - ASD(("happy_meal_poll_stop: ")); + ASD("happy_meal_poll_stop: "); /* If polling disabled or not polling already, nothing to do. */ if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != (HFLAG_POLLENABLE | HFLAG_POLL)) { - HMD(("not polling, return\n")); + HMD("not polling, return\n"); return; } /* Shut up the MIF. */ - ASD(("were polling, mif ints off, ")); + ASD("were polling, mif ints off, "); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* Turn off polling. */ - ASD(("polling off, ")); + ASD("polling off, "); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); @@ -913,7 +913,7 @@ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) /* Let the bits set. */ udelay(200); - ASD(("done\n")); + ASD("done\n"); } /* Only Sun can take such nice parts and fuck up the programming interface @@ -929,44 +929,44 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) int result, tries = TCVR_RESET_TRIES; tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD(("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig)); + ASD("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig); if (hp->tcvr_type == external) { - ASD(("external<")); + ASD("external<"); hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; - ASD(("ISOLATE,")); + ASD("ISOLATE,"); happy_meal_tcvr_write(hp, tregs, MII_BMCR, (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); if (result == TCVR_FAILURE) { - ASD(("phyread_fail>\n")); + ASD("phyread_fail>\n"); return -1; } - ASD(("phyread_ok,PSELECT>")); + ASD("phyread_ok,PSELECT>"); hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->tcvr_type = external; hp->paddr = TCV_PADDR_ETX; } else { if (tconfig & TCV_CFG_MDIO1) { - ASD(("internal\n")); + ASD("phyread_fail>\n"); return -1; } - ASD(("phyread_ok,~PSELECT>")); + ASD("phyread_ok,~PSELECT>"); hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; } } - ASD(("BMCR_RESET ")); + ASD("BMCR_RESET "); happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); while (--tries) { @@ -979,10 +979,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) udelay(20); } if (!tries) { - ASD(("BMCR RESET FAILED!\n")); + ASD("BMCR RESET FAILED!\n"); return -1; } - ASD(("RESET_OK\n")); + ASD("RESET_OK\n"); /* Get fresh copies of the PHY registers. */ hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); @@ -990,7 +990,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); - ASD(("UNISOLATE")); + ASD("UNISOLATE"); hp->sw_bmcr &= ~(BMCR_ISOLATE); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -1004,10 +1004,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) udelay(20); } if (!tries) { - ASD((" FAILED!\n")); + ASD(" FAILED!\n"); return -1; } - ASD((" SUCCESS and CSCONFIG_DFBYPASS\n")); + ASD(" SUCCESS and CSCONFIG_DFBYPASS\n"); if (!is_lucent_phy(hp)) { result = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG); @@ -1025,60 +1025,60 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr { unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD(("happy_meal_transceiver_check: tcfg=%08lx ", tconfig)); + ASD("happy_meal_transceiver_check: tcfg=%08lx ", tconfig); if (hp->happy_flags & HFLAG_POLL) { /* If we are polling, we must stop to get the transceiver type. */ - ASD((" ")); + ASD(" "); if (hp->tcvr_type == internal) { if (tconfig & TCV_CFG_MDIO1) { - ASD((" ")); + ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD(("\n")); + ASD("\n"); tconfig &= ~(TCV_CFG_PENABLE); tconfig |= TCV_CFG_PSELECT; hme_write32(hp, tregs + TCVR_CFG, tconfig); } } else { if (hp->tcvr_type == external) { - ASD((" ")); + ASD(" "); if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { - ASD((" ")); + ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD(("\n")); + ASD("\n"); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PSELECT)); } - ASD(("\n")); + ASD("\n"); } else { - ASD(("\n")); + ASD("\n"); } } } else { u32 reread = hme_read32(hp, tregs + TCVR_CFG); /* Else we can just work off of the MDIO bits. */ - ASD((" ")); + ASD(" "); if (reread & TCV_CFG_MDIO1) { hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD(("\n")); + ASD("\n"); } else { if (reread & TCV_CFG_MDIO0) { hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD(("\n")); + ASD("\n"); } else { printk(KERN_ERR "happy meal: Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ - ASD(("\n")); + ASD("\n"); } } } @@ -1185,15 +1185,15 @@ static void happy_meal_init_rings(struct happy_meal *hp) struct hmeal_init_block *hb = hp->happy_block; int i; - HMD(("happy_meal_init_rings: counters to zero, ")); + HMD("happy_meal_init_rings: counters to zero, "); hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0; /* Free any skippy bufs left around in the rings. */ - HMD(("clean, ")); + HMD("clean, "); happy_meal_clean_rings(hp); /* Now get new skippy bufs for the receive ring. */ - HMD(("init rxring, ")); + HMD("init rxring, "); for (i = 0; i < RX_RING_SIZE; i++) { struct sk_buff *skb; u32 mapping; @@ -1220,11 +1220,11 @@ static void happy_meal_init_rings(struct happy_meal *hp) skb_reserve(skb, RX_OFFSET); } - HMD(("init txring, ")); + HMD("init txring, "); for (i = 0; i < TX_RING_SIZE; i++) hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); - HMD(("done\n")); + HMD("done\n"); } /* hp->happy_lock must be held */ @@ -1272,15 +1272,15 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, */ #ifdef AUTO_SWITCH_DEBUG - ASD(("%s: Advertising [ ", hp->dev->name)); + ASD("%s: Advertising [ ", hp->dev->name); if (hp->sw_advertise & ADVERTISE_10HALF) - ASD(("10H ")); + ASD("10H "); if (hp->sw_advertise & ADVERTISE_10FULL) - ASD(("10F ")); + ASD("10F "); if (hp->sw_advertise & ADVERTISE_100HALF) - ASD(("100H ")); + ASD("100H "); if (hp->sw_advertise & ADVERTISE_100FULL) - ASD(("100F ")); + ASD("100F "); #endif /* Enable Auto-Negotiation, this is usually on already... */ @@ -1364,65 +1364,65 @@ static int happy_meal_init(struct happy_meal *hp) /* If auto-negotiation timer is running, kill it. */ del_timer(&hp->happy_timer); - HMD(("happy_meal_init: happy_flags[%08x] ", - hp->happy_flags)); + HMD("happy_meal_init: happy_flags[%08x] ", + hp->happy_flags); if (!(hp->happy_flags & HFLAG_INIT)) { - HMD(("set HFLAG_INIT, ")); + HMD("set HFLAG_INIT, "); hp->happy_flags |= HFLAG_INIT; happy_meal_get_counters(hp, bregs); } /* Stop polling. */ - HMD(("to happy_meal_poll_stop\n")); + HMD("to happy_meal_poll_stop\n"); happy_meal_poll_stop(hp, tregs); /* Stop transmitter and receiver. */ - HMD(("happy_meal_init: to happy_meal_stop\n")); + HMD("happy_meal_init: to happy_meal_stop\n"); happy_meal_stop(hp, gregs); /* Alloc and reset the tx/rx descriptor chains. */ - HMD(("happy_meal_init: to happy_meal_init_rings\n")); + HMD("happy_meal_init: to happy_meal_init_rings\n"); happy_meal_init_rings(hp); /* Shut up the MIF. */ - HMD(("happy_meal_init: Disable all MIF irqs (old[%08x]), ", - hme_read32(hp, tregs + TCVR_IMASK))); + HMD("happy_meal_init: Disable all MIF irqs (old[%08x]), ", + hme_read32(hp, tregs + TCVR_IMASK)); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* See if we can enable the MIF frame on this card to speak to the DP83840. */ if (hp->happy_flags & HFLAG_FENABLE) { - HMD(("use frame old[%08x], ", - hme_read32(hp, tregs + TCVR_CFG))); + HMD("use frame old[%08x], ", + hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); } else { - HMD(("use bitbang old[%08x], ", - hme_read32(hp, tregs + TCVR_CFG))); + HMD("use bitbang old[%08x], ", + hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); } /* Check the state of the transceiver. */ - HMD(("to happy_meal_transceiver_check\n")); + HMD("to happy_meal_transceiver_check\n"); happy_meal_transceiver_check(hp, tregs); /* Put the Big Mac into a sane state. */ - HMD(("happy_meal_init: ")); + HMD("happy_meal_init: "); switch(hp->tcvr_type) { case none: /* Cannot operate if we don't know the transceiver type! */ - HMD(("AAIEEE no transceiver type, EAGAIN")); + HMD("AAIEEE no transceiver type, EAGAIN"); return -EAGAIN; case internal: /* Using the MII buffers. */ - HMD(("internal, using MII, ")); + HMD("internal, using MII, "); hme_write32(hp, bregs + BMAC_XIFCFG, 0); break; case external: /* Not using the MII, disable it. */ - HMD(("external, disable MII, ")); + HMD("external, disable MII, "); hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); break; } @@ -1431,18 +1431,18 @@ static int happy_meal_init(struct happy_meal *hp) return -EAGAIN; /* Reset the Happy Meal Big Mac transceiver and the receiver. */ - HMD(("tx/rx reset, ")); + HMD("tx/rx reset, "); happy_meal_tx_reset(hp, bregs); happy_meal_rx_reset(hp, bregs); /* Set jam size and inter-packet gaps to reasonable defaults. */ - HMD(("jsize/ipg1/ipg2, ")); + HMD("jsize/ipg1/ipg2, "); hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); /* Load up the MAC address and random seed. */ - HMD(("rseed/macaddr, ")); + HMD("rseed/macaddr, "); /* The docs recommend to use the 10LSB of our MAC here. */ hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); @@ -1451,7 +1451,7 @@ static int happy_meal_init(struct happy_meal *hp) hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); - HMD(("htable, ")); + HMD("htable, "); if ((hp->dev->flags & IFF_ALLMULTI) || (netdev_mc_count(hp->dev) > 64)) { hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); @@ -1481,9 +1481,9 @@ static int happy_meal_init(struct happy_meal *hp) } /* Set the RX and TX ring ptrs. */ - HMD(("ring ptrs rxr[%08x] txr[%08x]\n", - ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), - ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0)))); + HMD("ring ptrs rxr[%08x] txr[%08x]\n", + ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), + ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0))); hme_write32(hp, erxregs + ERX_RING, ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0))); hme_write32(hp, etxregs + ETX_RING, @@ -1501,8 +1501,8 @@ static int happy_meal_init(struct happy_meal *hp) | 0x4); /* Set the supported burst sizes. */ - HMD(("happy_meal_init: old[%08x] bursts<", - hme_read32(hp, gregs + GREG_CFG))); + HMD("happy_meal_init: old[%08x] bursts<", + hme_read32(hp, gregs + GREG_CFG)); #ifndef CONFIG_SPARC /* It is always PCI and can handle 64byte bursts. */ @@ -1531,34 +1531,34 @@ static int happy_meal_init(struct happy_meal *hp) } #endif - HMD(("64>")); + HMD("64>"); hme_write32(hp, gregs + GREG_CFG, gcfg); } else if (hp->happy_bursts & DMA_BURST32) { - HMD(("32>")); + HMD("32>"); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); } else if (hp->happy_bursts & DMA_BURST16) { - HMD(("16>")); + HMD("16>"); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); } else { - HMD(("XXX>")); + HMD("XXX>"); hme_write32(hp, gregs + GREG_CFG, 0); } #endif /* CONFIG_SPARC */ /* Turn off interrupts we do not want to hear. */ - HMD((", enable global interrupts, ")); + HMD(", enable global interrupts, "); hme_write32(hp, gregs + GREG_IMASK, (GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP | GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR)); /* Set the transmit ring buffer size. */ - HMD(("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, - hme_read32(hp, etxregs + ETX_RSIZE))); + HMD("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, + hme_read32(hp, etxregs + ETX_RSIZE)); hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); /* Enable transmitter DVMA. */ - HMD(("tx dma enable old[%08x], ", - hme_read32(hp, etxregs + ETX_CFG))); + HMD("tx dma enable old[%08x], ", + hme_read32(hp, etxregs + ETX_CFG)); hme_write32(hp, etxregs + ETX_CFG, hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); @@ -1567,8 +1567,8 @@ static int happy_meal_init(struct happy_meal *hp) * properly. I cannot think of a sane way to provide complete * coverage for this hardware bug yet. */ - HMD(("erx regs bug old[%08x]\n", - hme_read32(hp, erxregs + ERX_CFG))); + HMD("erx regs bug old[%08x]\n", + hme_read32(hp, erxregs + ERX_CFG)); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); regtmp = hme_read32(hp, erxregs + ERX_CFG); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); @@ -1580,8 +1580,8 @@ static int happy_meal_init(struct happy_meal *hp) } /* Enable Big Mac hash table filter. */ - HMD(("happy_meal_init: enable hash rx_cfg_old[%08x], ", - hme_read32(hp, bregs + BMAC_RXCFG))); + HMD("happy_meal_init: enable hash rx_cfg_old[%08x], ", + hme_read32(hp, bregs + BMAC_RXCFG)); rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME; if (hp->dev->flags & IFF_PROMISC) rxcfg |= BIGMAC_RXCFG_PMISC; @@ -1591,7 +1591,7 @@ static int happy_meal_init(struct happy_meal *hp) udelay(10); /* Ok, configure the Big Mac transmitter. */ - HMD(("BIGMAC init, ")); + HMD("BIGMAC init, "); regtmp = 0; if (hp->happy_flags & HFLAG_FULL) regtmp |= BIGMAC_TXCFG_FULLDPLX; @@ -1615,14 +1615,14 @@ static int happy_meal_init(struct happy_meal *hp) if (hp->tcvr_type == external) regtmp |= BIGMAC_XCFG_MIIDISAB; - HMD(("XIF config old[%08x], ", - hme_read32(hp, bregs + BMAC_XIFCFG))); + HMD("XIF config old[%08x], ", + hme_read32(hp, bregs + BMAC_XIFCFG)); hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); /* Start things up. */ - HMD(("tx old[%08x] and rx [%08x] ON!\n", - hme_read32(hp, bregs + BMAC_TXCFG), - hme_read32(hp, bregs + BMAC_RXCFG))); + HMD("tx old[%08x] and rx [%08x] ON!\n", + hme_read32(hp, bregs + BMAC_TXCFG), + hme_read32(hp, bregs + BMAC_RXCFG)); /* Set larger TX/RX size to allow for 802.1q */ hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8); @@ -1843,9 +1843,9 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) } #ifdef TXDEBUG -#define TXD(x) printk x +#define TXD printk #else -#define TXD(x) +#define TXD(...) #endif /* hp->happy_lock must be held */ @@ -1857,13 +1857,13 @@ static void happy_meal_tx(struct happy_meal *hp) int elem; elem = hp->tx_old; - TXD(("TX<")); + TXD("TX<"); while (elem != hp->tx_new) { struct sk_buff *skb; u32 flags, dma_addr, dma_len; int frag; - TXD(("[%d]", elem)); + TXD("[%d]", elem); this = &txbase[elem]; flags = hme_read_desc32(hp, &this->tx_flags); if (flags & TXFLAG_OWN) @@ -1899,7 +1899,7 @@ static void happy_meal_tx(struct happy_meal *hp) dev->stats.tx_packets++; } hp->tx_old = elem; - TXD((">")); + TXD(">"); if (netif_queue_stopped(dev) && TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) @@ -1907,9 +1907,9 @@ static void happy_meal_tx(struct happy_meal *hp) } #ifdef RXDEBUG -#define RXD(x) printk x +#define RXD printk #else -#define RXD(x) +#define RXD(...) #endif /* Originally I used to handle the allocation failure by just giving back just @@ -1928,7 +1928,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) int elem = hp->rx_new, drops = 0; u32 flags; - RXD(("RX<")); + RXD("RX<"); this = &rxbase[elem]; while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { struct sk_buff *skb; @@ -1936,11 +1936,11 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) u16 csum = flags & RXFLAG_CSUM; u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); - RXD(("[%d ", elem)); + RXD("[%d ", elem); /* Check for errors. */ if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { - RXD(("ERR(%08x)]", flags)); + RXD("ERR(%08x)]", flags); dev->stats.rx_errors++; if (len < ETH_ZLEN) dev->stats.rx_length_errors++; @@ -2012,7 +2012,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->ip_summed = CHECKSUM_COMPLETE; - RXD(("len=%d csum=%4x]", len, csum)); + RXD("len=%d csum=%4x]", len, csum); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -2025,7 +2025,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) hp->rx_new = elem; if (drops) printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); - RXD((">")); + RXD(">"); } static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) @@ -2034,32 +2034,32 @@ static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD(("happy_meal_interrupt: status=%08x ", happy_status)); + HMD("happy_meal_interrupt: status=%08x ", happy_status); spin_lock(&hp->happy_lock); if (happy_status & GREG_STAT_ERRORS) { - HMD(("ERRORS ")); + HMD("ERRORS "); if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) goto out; } if (happy_status & GREG_STAT_MIFIRQ) { - HMD(("MIFIRQ ")); + HMD("MIFIRQ "); happy_meal_mif_interrupt(hp); } if (happy_status & GREG_STAT_TXALL) { - HMD(("TXALL ")); + HMD("TXALL "); happy_meal_tx(hp); } if (happy_status & GREG_STAT_RXTOHOST) { - HMD(("RXTOHOST ")); + HMD("RXTOHOST "); happy_meal_rx(hp, dev); } - HMD(("done\n")); + HMD("done\n"); out: spin_unlock(&hp->happy_lock); @@ -2077,7 +2077,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD(("quattro_interrupt: status=%08x ", happy_status)); + HMD("quattro_interrupt: status=%08x ", happy_status); if (!(happy_status & (GREG_STAT_ERRORS | GREG_STAT_MIFIRQ | @@ -2088,30 +2088,30 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) spin_lock(&hp->happy_lock); if (happy_status & GREG_STAT_ERRORS) { - HMD(("ERRORS ")); + HMD("ERRORS "); if (happy_meal_is_not_so_happy(hp, happy_status)) goto next; } if (happy_status & GREG_STAT_MIFIRQ) { - HMD(("MIFIRQ ")); + HMD("MIFIRQ "); happy_meal_mif_interrupt(hp); } if (happy_status & GREG_STAT_TXALL) { - HMD(("TXALL ")); + HMD("TXALL "); happy_meal_tx(hp); } if (happy_status & GREG_STAT_RXTOHOST) { - HMD(("RXTOHOST ")); + HMD("RXTOHOST "); happy_meal_rx(hp, dev); } next: spin_unlock(&hp->happy_lock); } - HMD(("done\n")); + HMD("done\n"); return IRQ_HANDLED; } @@ -2122,7 +2122,7 @@ static int happy_meal_open(struct net_device *dev) struct happy_meal *hp = netdev_priv(dev); int res; - HMD(("happy_meal_open: ")); + HMD("happy_meal_open: "); /* On SBUS Quattro QFE cards, all hme interrupts are concentrated * into a single source which we register handling at probe time. @@ -2131,7 +2131,7 @@ static int happy_meal_open(struct net_device *dev) res = request_irq(hp->irq, happy_meal_interrupt, IRQF_SHARED, dev->name, dev); if (res) { - HMD(("EAGAIN\n")); + HMD("EAGAIN\n"); printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", hp->irq); @@ -2139,7 +2139,7 @@ static int happy_meal_open(struct net_device *dev) } } - HMD(("to happy_meal_init\n")); + HMD("to happy_meal_init\n"); spin_lock_irq(&hp->happy_lock); res = happy_meal_init(hp); @@ -2174,9 +2174,9 @@ static int happy_meal_close(struct net_device *dev) } #ifdef SXDEBUG -#define SXD(x) printk x +#define SXD printk #else -#define SXD(x) +#define SXD(...) #endif static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) @@ -2244,7 +2244,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, } entry = hp->tx_new; - SXD(("SX", len, entry)); + SXD("SX", len, entry); hp->tx_skbs[entry] = skb; if (skb_shinfo(skb)->nr_frags == 0) { From patchwork Sat Sep 24 01:53:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987314 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9097C04A95 for ; Sat, 24 Sep 2022 01:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233093AbiIXByi (ORCPT ); Fri, 23 Sep 2022 21:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233087AbiIXByP (ORCPT ); Fri, 23 Sep 2022 21:54:15 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EBC0109771; Fri, 23 Sep 2022 18:53:54 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id ml1so1064252qvb.1; Fri, 23 Sep 2022 18:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=AqcwPX5NrwQ5Phxc7B78FzyStvxIApMlNxgtoCkojQ4=; b=eMimTk6wJD/NSK7tI+TJy/WBpVBlogF0MThwgAYiJxErF8WGoYr7IIdsGj82s4xPK0 DB6u7zfNnJYFuD51Dj7YAS5Kv+MpogxYAcFi+qHhZAS5rkyOLd9mnoZMmQD5ZPSA/Hqz L2icfXWhtxlTvhiYPtazBFw6a9b3Asug8E981pCD6284zmQaol8fwoDfpp2t0wbzGIQv do3M3vQWV5JNvdFI7HcfwFQvNJlgtubgHYD/zIa8Mjid3uefHbqB/5uLD6Tl8RsMcyou T7srWm/4cORBYpUS1l65ejxWsoI03MagpZFHt3LQzsPsFm3IJ44M14/5KsYOM8Ws4jer 6erQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=AqcwPX5NrwQ5Phxc7B78FzyStvxIApMlNxgtoCkojQ4=; b=lc/KVZkzovsvNuS3kCQBjYJy6RL5qBIk1+s+blXupJXQZ28TgOq7n+2kP2hfTBsWr8 VwrYlIXY8ilXLSxgxqQrz6ZKtt5j+tkwcsNcTe6nuGPbaNIfoXyTuJusvr7mbpseQ907 wGyFGTEK/LN+YLqnSGDkzTtsrvkVupivebry3M7XdvXN7efBEYQ8fTD2BoEyJOJgDn23 5FjaLjwIIntRT5zQsNkQD8ax+SThnFoNYFjWrK4f/Ycj8rmsN9/FQibqJw367Qk4on5n ECQHoDoLeVgM6LDEstYxfxn+R+TRf/M3QYK+xq2m7gchytv7NlWS236dTuVmaxwH2tk+ YSMg== X-Gm-Message-State: ACrzQf1MLaEGUGSaEnttLvouCN96qm2DoMyHDMGTGfQ3qE6qWABIoU4o 7otIkFlcoYt1XqeBA9mvuLo= X-Google-Smtp-Source: AMsMyM4Tg7+nu4VMjSeTeps5gCW3slq2mnLxrn7FFOTRQ+ls6Emux7a058MRnZkqdWnycdj/fcoiDA== X-Received: by 2002:a05:6214:d4f:b0:4ab:20:87c5 with SMTP id 15-20020a0562140d4f00b004ab002087c5mr9387753qvr.55.1663984433391; Fri, 23 Sep 2022 18:53:53 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id w25-20020a05620a0e9900b006b5c061844fsm6908182qkm.49.2022.09.23.18.53.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:53 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 08/13] sunhme: Clean up debug infrastructure Date: Fri, 23 Sep 2022 21:53:34 -0400 Message-Id: <20220924015339.1816744-9-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Remove all the single-use debug conditionals, and just collect the debug defines at the top of the file. HMD seems like it is used for general debug info, so just redefine it as pr_debug. Additionally, instead of using the default loglevel, use the debug loglevel for debugging. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 72 ++++++++++++++----------------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 77a2a192f2ce..cea99ddc4ce5 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -80,13 +80,37 @@ static struct quattro *qfe_sbus_list; static struct quattro *qfe_pci_list; #endif -#undef HMEDEBUG -#undef SXDEBUG -#undef RXDEBUG -#undef TXDEBUG -#undef TXLOGGING +#define HMD pr_debug -#ifdef TXLOGGING +/* "Auto Switch Debug" aka phy debug */ +#if 0 +#define ASD pr_debug +#else +#define ASD(...) +#endif + +/* Transmit debug */ +#if 0 +#define TXD pr_debug +#else +#define TXD(...) +#endif + +/* Skid buffer debug */ +#if 0 +#define SXD pr_debug +#else +#define SXD(...) +#endif + +/* Receive debug */ +#if 0 +#define RXD pr_debug +#else +#define RXD(...) +#endif + +#if 0 struct hme_tx_logent { unsigned int tstamp; int tx_new, tx_old; @@ -129,22 +153,8 @@ static __inline__ void tx_dump_log(void) } } #else -#define tx_add_log(hp, a, s) do { } while(0) -#define tx_dump_log() do { } while(0) -#endif - -#ifdef HMEDEBUG -#define HMD printk -#else -#define HMD(...) -#endif - -/* #define AUTO_SWITCH_DEBUG */ - -#ifdef AUTO_SWITCH_DEBUG -#define ASD printk -#else -#define ASD(...) +#define tx_add_log(hp, a, s) +#define tx_dump_log() #endif #define DEFAULT_IPG0 16 /* For lance-mode only */ @@ -1842,12 +1852,6 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) happy_meal_poll_stop(hp, tregs); } -#ifdef TXDEBUG -#define TXD printk -#else -#define TXD(...) -#endif - /* hp->happy_lock must be held */ static void happy_meal_tx(struct happy_meal *hp) { @@ -1906,12 +1910,6 @@ static void happy_meal_tx(struct happy_meal *hp) netif_wake_queue(dev); } -#ifdef RXDEBUG -#define RXD printk -#else -#define RXD(...) -#endif - /* Originally I used to handle the allocation failure by just giving back just * that one ring buffer to the happy meal. Problem is that usually when that * condition is triggered, the happy meal expects you to do something reasonable @@ -2173,12 +2171,6 @@ static int happy_meal_close(struct net_device *dev) return 0; } -#ifdef SXDEBUG -#define SXD printk -#else -#define SXD(...) -#endif - static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) { struct happy_meal *hp = netdev_priv(dev); From patchwork Sat Sep 24 01:53:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987315 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D29CC04A95 for ; Sat, 24 Sep 2022 01:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233150AbiIXBy4 (ORCPT ); Fri, 23 Sep 2022 21:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbiIXByg (ORCPT ); Fri, 23 Sep 2022 21:54:36 -0400 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63B9010BB0C; Fri, 23 Sep 2022 18:53:56 -0700 (PDT) Received: by mail-qv1-xf33.google.com with SMTP id g4so1060272qvo.3; Fri, 23 Sep 2022 18:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=47DaXlMFK6b2IVewGMobf+JX9qgPMyGuSDxZ3yHbbBw=; b=lbdsH0zXdghfNKNGoBPBegi7BrULizAi/NCy+jVp8t+vnqgmcQEwRWTNlIPQPLY0Be io1MKu8WgljuMBBhK2FyYN8QRioTLSxLU7kRNCOjIyzA8CWK2FkCbwQl8SZ7Dq0nc9DX Cnrbt1JZ0iXLAdRjcxB1lwcIi4XzlWbncKV0IhiydmcId67YpDRjMUDetvZ5do3jHMXH D3n6BTlsCzQ605JGRJsfJyNmWci+rgUkgsFmfjGTFmVvhZO8HBc2fI+0mjSA9lbj5kup 6iIen8Qu0MUp1fZvbiFHs8xpCxy+CkqtcxJhjpdGelE8QR9Jy+DesikJiXVobwXafJAO N1+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=47DaXlMFK6b2IVewGMobf+JX9qgPMyGuSDxZ3yHbbBw=; b=uzVqWhU6UEE2aOWJ/J4frFMXWUcb9tNLSXjULS+F4sM0Np1hJLinP3eNQ2FsnJGGoE F8oSqFnJu5TWz9pF0IMkIWh0SuuRWE/lm0k5t1CK1iXP5Kgwwfx1w4iRv8chg85I8fQr FiNLE1jm2G1stvNz4i+RAbnoHqqH2gnGtLoXhwr78Ak3NgH/rOVmrTc9l3AHVqSgsXdW AXyiAkvlY1VM6rS5EbESO3z33XACqZibueoRpFYWMmMXRxk5Vsgq7/aMQANvcFDvVXxL 2mjbMjg303MnZGJV/TujxPFH4txkgmQV63LDqYxNu0L6wfRPB2dqZ4/R2rCXUzCnUvca ceLg== X-Gm-Message-State: ACrzQf0seGg2P4UPMPJpqSn6aj728MYdtCFj6qqBTHigzGS8yYSyVARs 6kxi0M7M3kUBvr9u3yy7oN0= X-Google-Smtp-Source: AMsMyM6inxZIzhNnrma9SWrXZWeXXw5mAVXapSpgdmK2bMthHA7KcW088UwixLmS8rUvms2ikbA03g== X-Received: by 2002:a0c:8c4f:0:b0:4ac:94fa:a587 with SMTP id o15-20020a0c8c4f000000b004ac94faa587mr9369355qvb.40.1663984434704; Fri, 23 Sep 2022 18:53:54 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id cp4-20020a05622a420400b0035cdd7a42d0sm6245242qtb.22.2022.09.23.18.53.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:54 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 09/13] sunhme: Convert printk(KERN_FOO ...) to pr_foo(...) Date: Fri, 23 Sep 2022 21:53:35 -0400 Message-Id: <20220924015339.1816744-10-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This is a mostly-mechanical translation of the existing printks into pr_foos. In several places, I have pasted messages which were broken over several lines to allow for easier grepping. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 152 +++++++++++++++--------------- 1 file changed, 78 insertions(+), 74 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index cea99ddc4ce5..df8e38c117f3 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -145,7 +145,7 @@ static __inline__ void tx_dump_log(void) this = txlog_cur_entry; for (i = 0; i < TX_LOG_LEN; i++) { - printk("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, + pr_err("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, tx_log[this].tstamp, tx_log[this].tx_new, tx_log[this].tx_old, tx_log[this].action, tx_log[this].status); @@ -436,7 +436,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) udelay(20); if (!tries) { - printk(KERN_ERR "happy meal: Aieee, transceiver MIF read bolixed\n"); + pr_err("happy meal: Aieee, transceiver MIF read bolixed\n"); return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; @@ -469,7 +469,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, /* Anything else? */ if (!tries) - printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n"); + pr_err("happy meal: Aieee, transceiver MIF write bolixed\n"); /* Fifty-two cents is your change, have a nice day. */ } @@ -647,8 +647,8 @@ static void happy_meal_timer(struct timer_list *t) /* Enter force mode. */ do_force_mode: hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); - printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful, trying force link mode\n", - hp->dev->name); + pr_notice("%s: Auto-Negotiation unsuccessful, trying force link mode\n", + hp->dev->name); hp->sw_bmcr = BMCR_SPEED100; happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -707,8 +707,8 @@ static void happy_meal_timer(struct timer_list *t) restart_timer = 0; } else { if (hp->timer_ticks >= 10) { - printk(KERN_NOTICE "%s: Auto negotiation successful, link still " - "not completely up.\n", hp->dev->name); + pr_notice("%s: Auto negotiation successful, link still not completely up.\n", + hp->dev->name); hp->timer_ticks = 0; restart_timer = 1; } else { @@ -763,14 +763,14 @@ static void happy_meal_timer(struct timer_list *t) */ /* Let the user know... */ - printk(KERN_NOTICE "%s: Link down, cable problem?\n", - hp->dev->name); + pr_notice("%s: Link down, cable problem?\n", + hp->dev->name); ret = happy_meal_init(hp); if (ret) { /* ho hum... */ - printk(KERN_ERR "%s: Error, cannot re-init the " - "Happy Meal.\n", hp->dev->name); + pr_err("%s: Error, cannot re-init the Happy Meal.\n", + hp->dev->name); } goto out; } @@ -792,7 +792,7 @@ static void happy_meal_timer(struct timer_list *t) case asleep: default: /* Can't happens.... */ - printk(KERN_ERR "%s: Aieee, link timer is asleep but we got one anyways!\n", + pr_err("%s: Aieee, link timer is asleep but we got one anyways!\n", hp->dev->name); restart_timer = 0; hp->timer_ticks = 0; @@ -826,7 +826,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) /* Lettuce, tomato, buggy hardware (no extra charge)? */ if (!tries) - printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!"); + pr_err("happy meal: Transceiver BigMac ATTACK!"); /* Take care. */ HMD("done\n"); @@ -846,7 +846,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) /* Will that be all? */ if (!tries) - printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!"); + pr_err("happy meal: Receiver BigMac ATTACK!"); /* Don't forget your vik_1137125_wa. Have a nice day. */ HMD("done\n"); @@ -868,7 +868,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) /* Come back next week when we are "Sun Microelectronics". */ if (!tries) - printk(KERN_ERR "happy meal: Fry guys."); + pr_err("happy meal: Fry guys."); /* Remember: "Different name, same old buggy as shit hardware." */ HMD("done\n"); @@ -1086,7 +1086,7 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr hp->tcvr_type = internal; ASD("\n"); } else { - printk(KERN_ERR "happy meal: Transceiver and a coke please."); + pr_err("happy meal: Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ ASD("\n"); } @@ -1311,10 +1311,10 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, udelay(10); } if (!timeout) { - printk(KERN_ERR "%s: Happy Meal would not start auto negotiation " - "BMCR=0x%04x\n", hp->dev->name, hp->sw_bmcr); - printk(KERN_NOTICE "%s: Performing force link detection.\n", - hp->dev->name); + pr_err("%s: Happy Meal would not start auto negotiation BMCR=0x%04x\n", + hp->dev->name, hp->sw_bmcr); + pr_notice("%s: Performing force link detection.\n", + hp->dev->name); goto force_link; } else { hp->timer_state = arbwait; @@ -1583,8 +1583,8 @@ static int happy_meal_init(struct happy_meal *hp) regtmp = hme_read32(hp, erxregs + ERX_CFG); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { - printk(KERN_ERR "happy meal: Eieee, rx config register gets greasy fries.\n"); - printk(KERN_ERR "happy meal: Trying to set %08x, reread gives %08x\n", + pr_err("happy meal: Eieee, rx config register gets greasy fries.\n"); + pr_err("happy meal: Trying to set %08x, reread gives %08x\n", ERX_CFG_DEFAULT(RX_OFFSET), regtmp); /* XXX Should return failure here... */ } @@ -1722,24 +1722,26 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR | GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR | GREG_STAT_SLVPERR)) - printk(KERN_ERR "%s: Error interrupt for happy meal, status = %08x\n", + pr_err("%s: Error interrupt for happy meal, status = %08x\n", hp->dev->name, status); if (status & GREG_STAT_RFIFOVF) { /* Receive FIFO overflow is harmless and the hardware will take care of it, just some packets are lost. Who cares. */ - printk(KERN_DEBUG "%s: Happy Meal receive FIFO overflow.\n", hp->dev->name); + pr_debug("%s: Happy Meal receive FIFO overflow.\n", + hp->dev->name); } if (status & GREG_STAT_STSTERR) { /* BigMAC SQE link test failed. */ - printk(KERN_ERR "%s: Happy Meal BigMAC SQE test failed.\n", hp->dev->name); + pr_err("%s: Happy Meal BigMAC SQE test failed.\n", + hp->dev->name); reset = 1; } if (status & GREG_STAT_TFIFO_UND) { /* Transmit FIFO underrun, again DMA error likely. */ - printk(KERN_ERR "%s: Happy Meal transmitter FIFO underrun, DMA error.\n", + pr_err("%s: Happy Meal transmitter FIFO underrun, DMA error.\n", hp->dev->name); reset = 1; } @@ -1748,7 +1750,8 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver error, tried to transmit something larger * than ethernet max mtu. */ - printk(KERN_ERR "%s: Happy Meal MAX Packet size error.\n", hp->dev->name); + pr_err("%s: Happy Meal MAX Packet size error.\n", + hp->dev->name); reset = 1; } @@ -1758,14 +1761,13 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) * faster than the interrupt handler could keep up * with. */ - printk(KERN_INFO "%s: Happy Meal out of receive " - "descriptors, packet dropped.\n", - hp->dev->name); + pr_info("%s: Happy Meal out of receive descriptors, packet dropped.\n", + hp->dev->name); } if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { /* All sorts of DMA receive errors. */ - printk(KERN_ERR "%s: Happy Meal rx DMA errors [ ", hp->dev->name); + pr_err("%s: Happy Meal rx DMA errors [ ", hp->dev->name); if (status & GREG_STAT_RXERR) printk("GenericError "); if (status & GREG_STAT_RXPERR) @@ -1780,20 +1782,20 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver bug, didn't set EOP bit in tx descriptor given * to the happy meal. */ - printk(KERN_ERR "%s: EOP not set in happy meal transmit descriptor!\n", + pr_err("%s: EOP not set in happy meal transmit descriptor!\n", hp->dev->name); reset = 1; } if (status & GREG_STAT_MIFIRQ) { /* MIF signalled an interrupt, were we polling it? */ - printk(KERN_ERR "%s: Happy Meal MIF interrupt.\n", hp->dev->name); + pr_err("%s: Happy Meal MIF interrupt.\n", hp->dev->name); } if (status & (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { /* All sorts of transmit DMA errors. */ - printk(KERN_ERR "%s: Happy Meal tx DMA errors [ ", hp->dev->name); + pr_err("%s: Happy Meal tx DMA errors [ ", hp->dev->name); if (status & GREG_STAT_TXEACK) printk("GenericError "); if (status & GREG_STAT_TXLERR) @@ -1810,14 +1812,14 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Bus or parity error when cpu accessed happy meal registers * or it's internal FIFO's. Should never see this. */ - printk(KERN_ERR "%s: Happy Meal register access SBUS slave (%s) error.\n", + pr_err("%s: Happy Meal register access SBUS slave (%s) error.\n", hp->dev->name, (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); reset = 1; } if (reset) { - printk(KERN_NOTICE "%s: Resetting...\n", hp->dev->name); + pr_notice("%s: Resetting...\n", hp->dev->name); happy_meal_init(hp); return 1; } @@ -1829,22 +1831,25 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) { void __iomem *tregs = hp->tcvregs; - printk(KERN_INFO "%s: Link status change.\n", hp->dev->name); + pr_info("%s: Link status change.\n", hp->dev->name); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); /* Use the fastest transmission protocol possible. */ if (hp->sw_lpa & LPA_100FULL) { - printk(KERN_INFO "%s: Switching to 100Mbps at full duplex.", hp->dev->name); + pr_info("%s: Switching to 100Mbps at full duplex.", + hp->dev->name); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); } else if (hp->sw_lpa & LPA_100HALF) { - printk(KERN_INFO "%s: Switching to 100MBps at half duplex.", hp->dev->name); + pr_info("%s: Switching to 100MBps at half duplex.", + hp->dev->name); hp->sw_bmcr |= BMCR_SPEED100; } else if (hp->sw_lpa & LPA_10FULL) { - printk(KERN_INFO "%s: Switching to 10MBps at full duplex.", hp->dev->name); + pr_info("%s: Switching to 10MBps at full duplex.", + hp->dev->name); hp->sw_bmcr |= BMCR_FULLDPLX; } else { - printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name); + pr_info("%s: Using 10Mbps at half duplex.", hp->dev->name); } happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -2022,7 +2027,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) } hp->rx_new = elem; if (drops) - printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); + pr_info("%s: Memory squeeze, deferring packet.\n", + hp->dev->name); RXD(">"); } @@ -2130,7 +2136,7 @@ static int happy_meal_open(struct net_device *dev) dev->name, dev); if (res) { HMD("EAGAIN\n"); - printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", + pr_err("happy_meal(SBUS): Can't order irq %d to go.\n", hp->irq); return -EAGAIN; @@ -2175,12 +2181,12 @@ static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) { struct happy_meal *hp = netdev_priv(dev); - printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name); + pr_err("%s: transmit timed out, resetting\n", dev->name); tx_dump_log(); - printk (KERN_ERR "%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, - hme_read32(hp, hp->gregs + GREG_STAT), - hme_read32(hp, hp->etxregs + ETX_CFG), - hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); + pr_err("%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, + hme_read32(hp, hp->gregs + GREG_STAT), + hme_read32(hp, hp->etxregs + ETX_CFG), + hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); spin_lock_irq(&hp->happy_lock); happy_meal_init(hp); @@ -2230,7 +2236,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); spin_unlock_irq(&hp->happy_lock); - printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n", + pr_err("%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; } @@ -2527,8 +2533,8 @@ static int __init quattro_sbus_register_irqs(void) IRQF_SHARED, "Quattro", qp); if (err != 0) { - printk(KERN_ERR "Quattro HME: IRQ registration " - "error %d.\n", err); + pr_err("Quattro HME: IRQ registration error %d.\n", + err); return err; } } @@ -2636,7 +2642,7 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) SET_NETDEV_DEV(dev, &op->dev); if (hme_version_printed++ == 0) - printk(KERN_INFO "%s", version); + pr_info("%s", version); /* If user did not specify a MAC address specifically, use * the Quattro local-mac-address property... @@ -2679,35 +2685,35 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) hp->gregs = of_ioremap(&op->resource[0], 0, GREG_REG_SIZE, "HME Global Regs"); if (!hp->gregs) { - printk(KERN_ERR "happymeal: Cannot map global registers.\n"); + pr_err("happymeal: Cannot map global registers.\n"); goto err_out_free_netdev; } hp->etxregs = of_ioremap(&op->resource[1], 0, ETX_REG_SIZE, "HME TX Regs"); if (!hp->etxregs) { - printk(KERN_ERR "happymeal: Cannot map MAC TX registers.\n"); + pr_err("happymeal: Cannot map MAC TX registers.\n"); goto err_out_iounmap; } hp->erxregs = of_ioremap(&op->resource[2], 0, ERX_REG_SIZE, "HME RX Regs"); if (!hp->erxregs) { - printk(KERN_ERR "happymeal: Cannot map MAC RX registers.\n"); + pr_err("happymeal: Cannot map MAC RX registers.\n"); goto err_out_iounmap; } hp->bigmacregs = of_ioremap(&op->resource[3], 0, BMAC_REG_SIZE, "HME BIGMAC Regs"); if (!hp->bigmacregs) { - printk(KERN_ERR "happymeal: Cannot map BIGMAC registers.\n"); + pr_err("happymeal: Cannot map BIGMAC registers.\n"); goto err_out_iounmap; } hp->tcvregs = of_ioremap(&op->resource[4], 0, TCVR_REG_SIZE, "HME Tranceiver Regs"); if (!hp->tcvregs) { - printk(KERN_ERR "happymeal: Cannot map TCVR registers.\n"); + pr_err("happymeal: Cannot map TCVR registers.\n"); goto err_out_iounmap; } @@ -2774,19 +2780,18 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) err = register_netdev(hp->dev); if (err) { - printk(KERN_ERR "happymeal: Cannot register net device, " - "aborting.\n"); + pr_err("happymeal: Cannot register net device, aborting.\n"); goto err_out_free_coherent; } platform_set_drvdata(op, hp); if (qfe_slot != -1) - printk(KERN_INFO "%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", - dev->name, qfe_slot); + pr_info("%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", + dev->name, qfe_slot); else - printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", - dev->name); + pr_info("%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", + dev->name); printk("%pM\n", dev->dev_addr); @@ -2975,7 +2980,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { - printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); + pr_err("happymeal(PCI): Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } @@ -2983,15 +2988,14 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, pci_resource_len(pdev, 0), DRV_NAME); if (IS_ERR(hpreg_res)) { err = PTR_ERR(hpreg_res); - printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " - "aborting.\n"); + pr_err("happymeal(PCI): Cannot obtain PCI resources, aborting.\n"); goto err_out_clear_quattro; } hpreg_base = pcim_iomap(pdev, 0, 0x8000); if (!hpreg_base) { err = -ENOMEM; - printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); + pr_err("happymeal(PCI): Unable to remap card memory.\n"); goto err_out_clear_quattro; } @@ -3099,8 +3103,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = devm_register_netdev(&pdev->dev, dev); if (err) { - printk(KERN_ERR "happymeal(PCI): Cannot register net device, " - "aborting.\n"); + pr_err("happymeal(PCI): Cannot register net device, aborting.\n"); goto err_out_clear_quattro; } @@ -3114,7 +3117,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, int i = simple_strtoul(dev->name + 3, NULL, 10); sprintf(prom_name, "-%d", i + 3); } - printk(KERN_INFO "%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", dev->name, prom_name); + pr_info("%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", + dev->name, prom_name); if (qpdev->vendor == PCI_VENDOR_ID_DEC && qpdev->device == PCI_DEVICE_ID_DEC_21153) printk("DEC 21153 PCI Bridge\n"); @@ -3124,11 +3128,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } if (qfe_slot != -1) - printk(KERN_INFO "%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", - dev->name, qfe_slot); + pr_info("%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", + dev->name, qfe_slot); else - printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", - dev->name); + pr_info("%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", + dev->name); printk("%pM\n", dev->dev_addr); From patchwork Sat Sep 24 01:53:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987316 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D2FC04A95 for ; Sat, 24 Sep 2022 01:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbiIXBzV (ORCPT ); Fri, 23 Sep 2022 21:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233117AbiIXByi (ORCPT ); Fri, 23 Sep 2022 21:54:38 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A50C9115A60; Fri, 23 Sep 2022 18:53:56 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id i3so1188252qkl.3; Fri, 23 Sep 2022 18:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=aKva3ZJ/O9G0+2Nw0YoyqLX83/uvO6/PI1aE03Z1UKc=; b=eaePMnouOccU6NDo9wcRxIxyV6bm6BPdWMsnLAc/yln3KSrkmp/vW+I8JsncLJ23GE 6GY996V8LcUmYCLVq4iUcw0kQzioF0ZZxxuyD0RHZb+OUVC1uhvR0M+HhoONfWDX5gfU C4ZLzFhGpp3xNw8gWext4SMw3Sscc6uJ3uEO3/1LPvD91d83vVhk/rljOoAa36Y5vgfS p3SMmv+DpIYIcNQw0Wvffp32owBNRfqZqc0pod9cSyM3/r6vA2iDxVp+OeoMzo6+RfK6 S66RocyHPddQZTL8OuQK+/z1+stTSVjIKwK+J6LrHAK4xIe0EaEqNhWyZab+xLUfWuyD Slag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=aKva3ZJ/O9G0+2Nw0YoyqLX83/uvO6/PI1aE03Z1UKc=; b=7PZmUcAN+km9RDDHSu96qVZZEWusIU5ckn5nMfijdwZAgzq1heYNxrqQZh8Vxs0WHg MC8kajJpT9Ak/x3JHdZfB9HyGjawrm7X2OVNEQTkM/Za2WFmYY8/e9CUgOw+GTWrmFRH wn8duyonq8yzchFHY059T7OG7zJF6qxCmGRRxwZwMe3SBzZuFftt2YOrNCNnaIetliYj PIXDfNLFi0URuCl+ZmTbGkQHsDHwoZ33qZaQirvjObBQzC6lC7mynTKMeX/t5cl2NJJq 0RmaCMKoVf9fpIn1Cc5SimrdIQpcp8aBv1yImNcsJl2de8aW4n2cNsFoCIEIMjDLhQYn bcHA== X-Gm-Message-State: ACrzQf1BfU75D9soOMkOVFgHoopDwzsgxsfF8TYhpilu4XyCiRikGSOO qZhuLv59D5LeY8+xrkGi7b4= X-Google-Smtp-Source: AMsMyM55Qgjns1kxZtM4XZBv0A6KZQpgVB8UoZMXY9rTmGWYVGhto7dTMqITzerav67SooiUTJSh/Q== X-Received: by 2002:a05:620a:2989:b0:6ce:1360:33b4 with SMTP id r9-20020a05620a298900b006ce136033b4mr7802885qkp.755.1663984436051; Fri, 23 Sep 2022 18:53:56 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id y6-20020ae9f406000000b006ce51b541dfsm7042367qkl.36.2022.09.23.18.53.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:55 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 10/13] sunhme: Use (net)dev_foo wherever possible Date: Fri, 23 Sep 2022 21:53:36 -0400 Message-Id: <20220924015339.1816744-11-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Wherever possible, use the associated netdev (or device) when printing errors or other messages. This makes it immediately clear what device caused the error, and provides more information than just the device name. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 174 +++++++++++++++--------------- 1 file changed, 85 insertions(+), 89 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index df8e38c117f3..fad98e20a63f 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -436,7 +436,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) udelay(20); if (!tries) { - pr_err("happy meal: Aieee, transceiver MIF read bolixed\n"); + netdev_err(hp->dev, "Aieee, transceiver MIF read bolixed\n"); return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; @@ -469,7 +469,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, /* Anything else? */ if (!tries) - pr_err("happy meal: Aieee, transceiver MIF write bolixed\n"); + netdev_err(hp->dev, "Aieee, transceiver MIF write bolixed\n"); /* Fifty-two cents is your change, have a nice day. */ } @@ -647,8 +647,8 @@ static void happy_meal_timer(struct timer_list *t) /* Enter force mode. */ do_force_mode: hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); - pr_notice("%s: Auto-Negotiation unsuccessful, trying force link mode\n", - hp->dev->name); + netdev_notice(hp->dev, + "Auto-Negotiation unsuccessful, trying force link mode\n"); hp->sw_bmcr = BMCR_SPEED100; happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -707,8 +707,8 @@ static void happy_meal_timer(struct timer_list *t) restart_timer = 0; } else { if (hp->timer_ticks >= 10) { - pr_notice("%s: Auto negotiation successful, link still not completely up.\n", - hp->dev->name); + netdev_notice(hp->dev, + "Auto negotiation successful, link still not completely up.\n"); hp->timer_ticks = 0; restart_timer = 1; } else { @@ -763,14 +763,14 @@ static void happy_meal_timer(struct timer_list *t) */ /* Let the user know... */ - pr_notice("%s: Link down, cable problem?\n", - hp->dev->name); + netdev_notice(hp->dev, + "Link down, cable problem?\n"); ret = happy_meal_init(hp); if (ret) { /* ho hum... */ - pr_err("%s: Error, cannot re-init the Happy Meal.\n", - hp->dev->name); + netdev_err(hp->dev, + "Error, cannot re-init the Happy Meal.\n"); } goto out; } @@ -792,8 +792,8 @@ static void happy_meal_timer(struct timer_list *t) case asleep: default: /* Can't happens.... */ - pr_err("%s: Aieee, link timer is asleep but we got one anyways!\n", - hp->dev->name); + netdev_err(hp->dev, + "Aieee, link timer is asleep but we got one anyways!\n"); restart_timer = 0; hp->timer_ticks = 0; hp->timer_state = asleep; /* foo on you */ @@ -826,7 +826,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) /* Lettuce, tomato, buggy hardware (no extra charge)? */ if (!tries) - pr_err("happy meal: Transceiver BigMac ATTACK!"); + netdev_err(hp->dev, "Transceiver BigMac ATTACK!"); /* Take care. */ HMD("done\n"); @@ -846,7 +846,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) /* Will that be all? */ if (!tries) - pr_err("happy meal: Receiver BigMac ATTACK!"); + netdev_err(hp->dev, "Receiver BigMac ATTACK!"); /* Don't forget your vik_1137125_wa. Have a nice day. */ HMD("done\n"); @@ -868,7 +868,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) /* Come back next week when we are "Sun Microelectronics". */ if (!tries) - pr_err("happy meal: Fry guys."); + netdev_err(hp->dev, "Fry guys."); /* Remember: "Different name, same old buggy as shit hardware." */ HMD("done\n"); @@ -1086,7 +1086,8 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr hp->tcvr_type = internal; ASD("\n"); } else { - pr_err("happy meal: Transceiver and a coke please."); + netdev_err(hp->dev, + "Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ ASD("\n"); } @@ -1282,7 +1283,7 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, */ #ifdef AUTO_SWITCH_DEBUG - ASD("%s: Advertising [ ", hp->dev->name); + ASD("%s: Advertising [ "); if (hp->sw_advertise & ADVERTISE_10HALF) ASD("10H "); if (hp->sw_advertise & ADVERTISE_10FULL) @@ -1311,10 +1312,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, udelay(10); } if (!timeout) { - pr_err("%s: Happy Meal would not start auto negotiation BMCR=0x%04x\n", - hp->dev->name, hp->sw_bmcr); - pr_notice("%s: Performing force link detection.\n", - hp->dev->name); + netdev_err(hp->dev, + "Happy Meal would not start auto negotiation BMCR=0x%04x\n", + hp->sw_bmcr); + netdev_notice(hp->dev, + "Performing force link detection.\n"); goto force_link; } else { hp->timer_state = arbwait; @@ -1583,9 +1585,11 @@ static int happy_meal_init(struct happy_meal *hp) regtmp = hme_read32(hp, erxregs + ERX_CFG); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { - pr_err("happy meal: Eieee, rx config register gets greasy fries.\n"); - pr_err("happy meal: Trying to set %08x, reread gives %08x\n", - ERX_CFG_DEFAULT(RX_OFFSET), regtmp); + netdev_err(hp->dev, + "Eieee, rx config register gets greasy fries.\n"); + netdev_err(hp->dev, + "Trying to set %08x, reread gives %08x\n", + ERX_CFG_DEFAULT(RX_OFFSET), regtmp); /* XXX Should return failure here... */ } @@ -1722,27 +1726,26 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR | GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR | GREG_STAT_SLVPERR)) - pr_err("%s: Error interrupt for happy meal, status = %08x\n", - hp->dev->name, status); + netdev_err(hp->dev, + "Error interrupt for happy meal, status = %08x\n", + status); if (status & GREG_STAT_RFIFOVF) { /* Receive FIFO overflow is harmless and the hardware will take care of it, just some packets are lost. Who cares. */ - pr_debug("%s: Happy Meal receive FIFO overflow.\n", - hp->dev->name); + netdev_dbg(hp->dev, "Happy Meal receive FIFO overflow.\n"); } if (status & GREG_STAT_STSTERR) { /* BigMAC SQE link test failed. */ - pr_err("%s: Happy Meal BigMAC SQE test failed.\n", - hp->dev->name); + netdev_err(hp->dev, "Happy Meal BigMAC SQE test failed.\n"); reset = 1; } if (status & GREG_STAT_TFIFO_UND) { /* Transmit FIFO underrun, again DMA error likely. */ - pr_err("%s: Happy Meal transmitter FIFO underrun, DMA error.\n", - hp->dev->name); + netdev_err(hp->dev, + "Happy Meal transmitter FIFO underrun, DMA error.\n"); reset = 1; } @@ -1750,8 +1753,7 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver error, tried to transmit something larger * than ethernet max mtu. */ - pr_err("%s: Happy Meal MAX Packet size error.\n", - hp->dev->name); + netdev_err(hp->dev, "Happy Meal MAX Packet size error.\n"); reset = 1; } @@ -1761,13 +1763,13 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) * faster than the interrupt handler could keep up * with. */ - pr_info("%s: Happy Meal out of receive descriptors, packet dropped.\n", - hp->dev->name); + netdev_info(hp->dev, + "Happy Meal out of receive descriptors, packet dropped.\n"); } if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { /* All sorts of DMA receive errors. */ - pr_err("%s: Happy Meal rx DMA errors [ ", hp->dev->name); + netdev_err(hp->dev, "Happy Meal rx DMA errors [ "); if (status & GREG_STAT_RXERR) printk("GenericError "); if (status & GREG_STAT_RXPERR) @@ -1782,20 +1784,20 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Driver bug, didn't set EOP bit in tx descriptor given * to the happy meal. */ - pr_err("%s: EOP not set in happy meal transmit descriptor!\n", - hp->dev->name); + netdev_err(hp->dev, + "EOP not set in happy meal transmit descriptor!\n"); reset = 1; } if (status & GREG_STAT_MIFIRQ) { /* MIF signalled an interrupt, were we polling it? */ - pr_err("%s: Happy Meal MIF interrupt.\n", hp->dev->name); + netdev_err(hp->dev, "Happy Meal MIF interrupt.\n"); } if (status & (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { /* All sorts of transmit DMA errors. */ - pr_err("%s: Happy Meal tx DMA errors [ ", hp->dev->name); + netdev_err(hp->dev, "Happy Meal tx DMA errors [ "); if (status & GREG_STAT_TXEACK) printk("GenericError "); if (status & GREG_STAT_TXLERR) @@ -1812,14 +1814,14 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) /* Bus or parity error when cpu accessed happy meal registers * or it's internal FIFO's. Should never see this. */ - pr_err("%s: Happy Meal register access SBUS slave (%s) error.\n", - hp->dev->name, - (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); + netdev_err(hp->dev, + "Happy Meal register access SBUS slave (%s) error.\n", + (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); reset = 1; } if (reset) { - pr_notice("%s: Resetting...\n", hp->dev->name); + netdev_notice(hp->dev, "Resetting...\n"); happy_meal_init(hp); return 1; } @@ -1831,25 +1833,22 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) { void __iomem *tregs = hp->tcvregs; - pr_info("%s: Link status change.\n", hp->dev->name); + netdev_info(hp->dev, "Link status change.\n"); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); /* Use the fastest transmission protocol possible. */ if (hp->sw_lpa & LPA_100FULL) { - pr_info("%s: Switching to 100Mbps at full duplex.", - hp->dev->name); + netdev_info(hp->dev, "Switching to 100Mbps at full duplex."); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); } else if (hp->sw_lpa & LPA_100HALF) { - pr_info("%s: Switching to 100MBps at half duplex.", - hp->dev->name); + netdev_info(hp->dev, "Switching to 100MBps at half duplex."); hp->sw_bmcr |= BMCR_SPEED100; } else if (hp->sw_lpa & LPA_10FULL) { - pr_info("%s: Switching to 10MBps at full duplex.", - hp->dev->name); + netdev_info(hp->dev, "Switching to 10MBps at full duplex."); hp->sw_bmcr |= BMCR_FULLDPLX; } else { - pr_info("%s: Using 10Mbps at half duplex.", hp->dev->name); + netdev_info(hp->dev, "Using 10Mbps at half duplex."); } happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -2027,8 +2026,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) } hp->rx_new = elem; if (drops) - pr_info("%s: Memory squeeze, deferring packet.\n", - hp->dev->name); + netdev_info(hp->dev, "Memory squeeze, deferring packet.\n"); RXD(">"); } @@ -2136,8 +2134,7 @@ static int happy_meal_open(struct net_device *dev) dev->name, dev); if (res) { HMD("EAGAIN\n"); - pr_err("happy_meal(SBUS): Can't order irq %d to go.\n", - hp->irq); + netdev_err(dev, "Can't order irq %d to go.\n", hp->irq); return -EAGAIN; } @@ -2181,12 +2178,12 @@ static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) { struct happy_meal *hp = netdev_priv(dev); - pr_err("%s: transmit timed out, resetting\n", dev->name); + netdev_err(dev, "transmit timed out, resetting\n"); tx_dump_log(); - pr_err("%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, - hme_read32(hp, hp->gregs + GREG_STAT), - hme_read32(hp, hp->etxregs + ETX_CFG), - hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); + netdev_err(dev, "Happy Status %08x TX[%08x:%08x]\n", + hme_read32(hp, hp->gregs + GREG_STAT), + hme_read32(hp, hp->etxregs + ETX_CFG), + hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); spin_lock_irq(&hp->happy_lock); happy_meal_init(hp); @@ -2236,8 +2233,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); spin_unlock_irq(&hp->happy_lock); - pr_err("%s: BUG! Tx Ring full when queue awake!\n", - dev->name); + netdev_err(dev, "BUG! Tx Ring full when queue awake!\n"); return NETDEV_TX_BUSY; } @@ -2533,8 +2529,9 @@ static int __init quattro_sbus_register_irqs(void) IRQF_SHARED, "Quattro", qp); if (err != 0) { - pr_err("Quattro HME: IRQ registration error %d.\n", - err); + dev_err(&op->dev, + "Quattro HME: IRQ registration error %d.\n", + err); return err; } } @@ -2641,9 +2638,6 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) goto err_out; SET_NETDEV_DEV(dev, &op->dev); - if (hme_version_printed++ == 0) - pr_info("%s", version); - /* If user did not specify a MAC address specifically, use * the Quattro local-mac-address property... */ @@ -2685,35 +2679,35 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) hp->gregs = of_ioremap(&op->resource[0], 0, GREG_REG_SIZE, "HME Global Regs"); if (!hp->gregs) { - pr_err("happymeal: Cannot map global registers.\n"); + dev_err(&op->dev, "Cannot map global registers.\n"); goto err_out_free_netdev; } hp->etxregs = of_ioremap(&op->resource[1], 0, ETX_REG_SIZE, "HME TX Regs"); if (!hp->etxregs) { - pr_err("happymeal: Cannot map MAC TX registers.\n"); + dev_err(&op->dev, "Cannot map MAC TX registers.\n"); goto err_out_iounmap; } hp->erxregs = of_ioremap(&op->resource[2], 0, ERX_REG_SIZE, "HME RX Regs"); if (!hp->erxregs) { - pr_err("happymeal: Cannot map MAC RX registers.\n"); + dev_err(&op->dev, "Cannot map MAC RX registers.\n"); goto err_out_iounmap; } hp->bigmacregs = of_ioremap(&op->resource[3], 0, BMAC_REG_SIZE, "HME BIGMAC Regs"); if (!hp->bigmacregs) { - pr_err("happymeal: Cannot map BIGMAC registers.\n"); + dev_err(&op->dev, "Cannot map BIGMAC registers.\n"); goto err_out_iounmap; } hp->tcvregs = of_ioremap(&op->resource[4], 0, TCVR_REG_SIZE, "HME Tranceiver Regs"); if (!hp->tcvregs) { - pr_err("happymeal: Cannot map TCVR registers.\n"); + dev_err(&op->dev, "Cannot map TCVR registers.\n"); goto err_out_iounmap; } @@ -2780,18 +2774,17 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) err = register_netdev(hp->dev); if (err) { - pr_err("happymeal: Cannot register net device, aborting.\n"); + dev_err(&op->dev, "Cannot register net device, aborting.\n"); goto err_out_free_coherent; } platform_set_drvdata(op, hp); if (qfe_slot != -1) - pr_info("%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", - dev->name, qfe_slot); + netdev_info(dev, "Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", + qfe_slot); else - pr_info("%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", - dev->name); + netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet "); printk("%pM\n", dev->dev_addr); @@ -2980,7 +2973,8 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = -EINVAL; if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { - pr_err("happymeal(PCI): Cannot find proper PCI device base address.\n"); + dev_err(&pdev->dev, + "Cannot find proper PCI device base address.\n"); goto err_out_clear_quattro; } @@ -2988,14 +2982,14 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, pci_resource_len(pdev, 0), DRV_NAME); if (IS_ERR(hpreg_res)) { err = PTR_ERR(hpreg_res); - pr_err("happymeal(PCI): Cannot obtain PCI resources, aborting.\n"); + dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n"); goto err_out_clear_quattro; } hpreg_base = pcim_iomap(pdev, 0, 0x8000); if (!hpreg_base) { err = -ENOMEM; - pr_err("happymeal(PCI): Unable to remap card memory.\n"); + dev_err(&pdev->dev, "Unable to remap card memory.\n"); goto err_out_clear_quattro; } @@ -3103,7 +3097,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = devm_register_netdev(&pdev->dev, dev); if (err) { - pr_err("happymeal(PCI): Cannot register net device, aborting.\n"); + dev_err(&pdev->dev, "Cannot register net device, aborting.\n"); goto err_out_clear_quattro; } @@ -3117,8 +3111,9 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, int i = simple_strtoul(dev->name + 3, NULL, 10); sprintf(prom_name, "-%d", i + 3); } - pr_info("%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", - dev->name, prom_name); + netdev_info(dev, + "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", + prom_name); if (qpdev->vendor == PCI_VENDOR_ID_DEC && qpdev->device == PCI_DEVICE_ID_DEC_21153) printk("DEC 21153 PCI Bridge\n"); @@ -3128,11 +3123,12 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, } if (qfe_slot != -1) - pr_info("%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", - dev->name, qfe_slot); + netdev_info(dev, + "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", + qfe_slot); else - pr_info("%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", - dev->name); + netdev_info(dev, + "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet "); printk("%pM\n", dev->dev_addr); From patchwork Sat Sep 24 01:53:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987318 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7610DC6FA82 for ; Sat, 24 Sep 2022 01:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233230AbiIXBz0 (ORCPT ); Fri, 23 Sep 2022 21:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiIXBzE (ORCPT ); Fri, 23 Sep 2022 21:55:04 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D69B11C177; Fri, 23 Sep 2022 18:53:58 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id s9so1183340qkg.4; Fri, 23 Sep 2022 18:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=43SXffg/t7leRRsvtxKYneBrli3Hdm/u8KXwc6UYSMU=; b=nLfcoztZ3a6N0PvUWHzt96Jmss2I72Yc/0yHoxlo9P2da8lYhn4BMBKOL2cup9sTSa 9OGYChtVMW7LiiF4/Wg0L4hxGBnaj4keN4zSgRis6TWTFp/ZTOJx32kWWDQOL3VCE9ky q3SblV7xDJX3inoPz4WF06esH28E9ZPzM5/IYj5S5grX0Bs8TMp1vR/Mxl8jWZP3woV+ 97XphmZSv7wvdIgEji1+cN+9OIICrkplBCBPA85Q1vqB2cV+7hjScMtko59qgAUm9T7E cgpurR/2x3h7lmLOhEJZCFaMHlOQ44ttUBo9i57MvyuB1/ct5i5FsQm4YlqQpKMevTLP bvuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=43SXffg/t7leRRsvtxKYneBrli3Hdm/u8KXwc6UYSMU=; b=xq2p71XZPH9/vXf2NsRRxzRpjO8mVG2jrkcFtHKRQz4g2g4iFbcQZQySubd996D84t UAion88manjEYsH8Hh6vzzDT+jAgfP7fJQgpBunn7y0xuuXj+sJ2/i/Ks5dRjG20wIud RQbmX1mH49HOmnZGLKfhT+h4T/exAiurUisCFkoGibLUCCSVG+Dc3SJemO2fFOWVb0WY fuv2BEQHOb84tgmkB9flq3ycSE83w07xKCMS+KUZ2BuEa5aHZl5uUqkpDzC2eU0va+vi k596jsh2QNoicknj54J2y8JvayiQNfeZnPimZvS5mCf53ozhKbaCheJQZiFGNl0Y1X9C lqLg== X-Gm-Message-State: ACrzQf0/1WimgXJv7Z7akX9m88FTELIl1uVqNZftngD4YrSmsqE5WhDl QsNel3IroxZ7/Y2b12rYjPc= X-Google-Smtp-Source: AMsMyM6DLVIRzdiaNY0C4JhCW1387Q737dGQm3ilVzhgmyLNrur/Jo7IJuTO9xPZDBRWtxZ3r7U6zQ== X-Received: by 2002:a05:620a:750:b0:6ce:3d8e:3a1a with SMTP id i16-20020a05620a075000b006ce3d8e3a1amr7477558qki.590.1663984437409; Fri, 23 Sep 2022 18:53:57 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id s4-20020a05620a254400b006cf43968db6sm6955352qko.76.2022.09.23.18.53.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:57 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 11/13] sunhme: Combine continued messages Date: Fri, 23 Sep 2022 21:53:37 -0400 Message-Id: <20220924015339.1816744-12-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This driver seems to have been written under the assumption that messages can be continued arbitrarily. I'm not when this changed (if ever), but such ad-hoc continuations are liable to be rudely interrupted. Convert all such instances to single prints. This loses a bit of timing information (such as when a line was constructed piecemeal as the function executed), but it's easy to add a few prints if necessary. This also adds newlines to the ends of any prints without them. Since (almost every) debug print included the name of the function, include it automatically. Signed-off-by: Sean Anderson --- Changes in v2: - Remove repeated newline - Remove another excess debug drivers/net/ethernet/sun/sunhme.c | 278 +++++++++++------------------- 1 file changed, 105 insertions(+), 173 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index fad98e20a63f..51a04353e08e 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -80,32 +80,33 @@ static struct quattro *qfe_sbus_list; static struct quattro *qfe_pci_list; #endif -#define HMD pr_debug +#define hme_debug(fmt, ...) pr_debug("%s: " fmt, __func__, ##__VA_ARGS__) +#define HMD hme_debug /* "Auto Switch Debug" aka phy debug */ -#if 0 -#define ASD pr_debug +#if 1 +#define ASD hme_debug #else #define ASD(...) #endif /* Transmit debug */ -#if 0 -#define TXD pr_debug +#if 1 +#define TXD hme_debug #else #define TXD(...) #endif /* Skid buffer debug */ -#if 0 -#define SXD pr_debug +#if 1 +#define SXD hme_debug #else #define SXD(...) #endif /* Receive debug */ -#if 0 -#define RXD pr_debug +#if 1 +#define RXD hme_debug #else #define RXD(...) #endif @@ -330,8 +331,6 @@ static int happy_meal_bb_read(struct happy_meal *hp, int retval = 0; int i; - ASD("happy_meal_bb_read: reg=%d ", reg); - /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -365,7 +364,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); - ASD("value=%x\n", retval); + ASD("reg=%d value=%x\n", reg, retval); return retval; } @@ -376,7 +375,7 @@ static void happy_meal_bb_write(struct happy_meal *hp, u32 tmp; int i; - ASD("happy_meal_bb_write: reg=%d value=%x\n", reg, value); + ASD("reg=%d value=%x\n", reg, value); /* Enable the MIF BitBang outputs. */ hme_write32(hp, tregs + TCVR_BBOENAB, 1); @@ -420,7 +419,6 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, int tries = TCVR_READ_TRIES; int retval; - ASD("happy_meal_tcvr_read: reg=0x%02x ", reg); if (hp->tcvr_type == none) { ASD("no transceiver, value=TCVR_FAILURE\n"); return TCVR_FAILURE; @@ -440,7 +438,7 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, return TCVR_FAILURE; } retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; - ASD("value=%04x\n", retval); + ASD("reg=0x%02x value=%04x\n", reg, retval); return retval; } @@ -452,7 +450,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, { int tries = TCVR_WRITE_TRIES; - ASD("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value); + ASD("reg=0x%02x value=%04x\n", reg, value); /* Welcome to Sun Microsystems, can I take your order please? */ if (!(hp->happy_flags & HFLAG_FENABLE)) { @@ -817,7 +815,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = TX_RESET_TRIES; - HMD("happy_meal_tx_reset: reset, "); + HMD("reset...\n"); /* Would you like to try our SMCC Delux? */ hme_write32(hp, bregs + BMAC_TXSWRESET, 0); @@ -837,7 +835,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) { int tries = RX_RESET_TRIES; - HMD("happy_meal_rx_reset: reset, "); + HMD("reset...\n"); /* We have a special on GNU/Viking hardware bugs today. */ hme_write32(hp, bregs + BMAC_RXSWRESET, 0); @@ -846,7 +844,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) /* Will that be all? */ if (!tries) - netdev_err(hp->dev, "Receiver BigMac ATTACK!"); + netdev_err(hp->dev, "Receiver BigMac ATTACK!\n"); /* Don't forget your vik_1137125_wa. Have a nice day. */ HMD("done\n"); @@ -859,7 +857,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) { int tries = STOP_TRIES; - HMD("happy_meal_stop: reset, "); + HMD("reset...\n"); /* We're consolidating our STB products, it's your lucky day. */ hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); @@ -868,7 +866,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) /* Come back next week when we are "Sun Microelectronics". */ if (!tries) - netdev_err(hp->dev, "Fry guys."); + netdev_err(hp->dev, "Fry guys.\n"); /* Remember: "Different name, same old buggy as shit hardware." */ HMD("done\n"); @@ -900,21 +898,18 @@ static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) /* hp->happy_lock must be held */ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) { - ASD("happy_meal_poll_stop: "); - /* If polling disabled or not polling already, nothing to do. */ if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != (HFLAG_POLLENABLE | HFLAG_POLL)) { - HMD("not polling, return\n"); + ASD("not polling, return\n"); return; } /* Shut up the MIF. */ - ASD("were polling, mif ints off, "); + ASD("were polling, mif ints off, polling off\n"); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* Turn off polling. */ - ASD("polling off, "); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); @@ -939,29 +934,25 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) int result, tries = TCVR_RESET_TRIES; tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig); + ASD("tcfg=%08x\n", tconfig); if (hp->tcvr_type == external) { - ASD("external<"); hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; - ASD("ISOLATE,"); happy_meal_tcvr_write(hp, tregs, MII_BMCR, (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); if (result == TCVR_FAILURE) { - ASD("phyread_fail>\n"); + ASD("phyread_fail\n"); return -1; } - ASD("phyread_ok,PSELECT>"); + ASD("external: ISOLATE, phyread_ok, PSELECT\n"); hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->tcvr_type = external; hp->paddr = TCV_PADDR_ETX; } else { if (tconfig & TCV_CFG_MDIO1) { - ASD("internal\n"); return -1; } - ASD("phyread_ok,~PSELECT>"); + ASD("internal: PSELECT, ISOLATE, phyread_ok, ~PSELECT\n"); hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); hp->tcvr_type = internal; hp->paddr = TCV_PADDR_ITX; } } - ASD("BMCR_RESET "); + ASD("BMCR_RESET...\n"); happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); while (--tries) { @@ -1000,7 +991,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); - ASD("UNISOLATE"); + ASD("UNISOLATE...\n"); hp->sw_bmcr &= ~(BMCR_ISOLATE); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -1014,10 +1005,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) udelay(20); } if (!tries) { - ASD(" FAILED!\n"); + ASD("UNISOLATE FAILED!\n"); return -1; } - ASD(" SUCCESS and CSCONFIG_DFBYPASS\n"); + ASD("SUCCESS and CSCONFIG_DFBYPASS\n"); if (!is_lucent_phy(hp)) { result = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG); @@ -1035,61 +1026,55 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr { unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); - ASD("happy_meal_transceiver_check: tcfg=%08lx ", tconfig); + ASD("tcfg=%08lx\n", tconfig); if (hp->happy_flags & HFLAG_POLL) { /* If we are polling, we must stop to get the transceiver type. */ - ASD(" "); if (hp->tcvr_type == internal) { if (tconfig & TCV_CFG_MDIO1) { - ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD("\n"); tconfig &= ~(TCV_CFG_PENABLE); tconfig |= TCV_CFG_PSELECT; hme_write32(hp, tregs + TCVR_CFG, tconfig); + ASD("poll stop, internal->external\n"); } } else { if (hp->tcvr_type == external) { - ASD(" "); if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { - ASD(" "); happy_meal_poll_stop(hp, tregs); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD("\n"); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PSELECT)); + ASD("poll stop, external->internal\n"); } - ASD("\n"); } else { - ASD("\n"); + ASD("polling, none\n"); } } } else { u32 reread = hme_read32(hp, tregs + TCVR_CFG); /* Else we can just work off of the MDIO bits. */ - ASD(" "); if (reread & TCV_CFG_MDIO1) { hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hp->paddr = TCV_PADDR_ETX; hp->tcvr_type = external; - ASD("\n"); + ASD("not polling, external\n"); } else { if (reread & TCV_CFG_MDIO0) { hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hp->paddr = TCV_PADDR_ITX; hp->tcvr_type = internal; - ASD("\n"); + ASD("not polling, internal\n"); } else { netdev_err(hp->dev, "Transceiver and a coke please."); hp->tcvr_type = none; /* Grrr... */ - ASD("\n"); + ASD("not polling, none\n"); } } } @@ -1196,15 +1181,14 @@ static void happy_meal_init_rings(struct happy_meal *hp) struct hmeal_init_block *hb = hp->happy_block; int i; - HMD("happy_meal_init_rings: counters to zero, "); + HMD("counters to zero\n"); hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0; /* Free any skippy bufs left around in the rings. */ - HMD("clean, "); happy_meal_clean_rings(hp); /* Now get new skippy bufs for the receive ring. */ - HMD("init rxring, "); + HMD("init rxring\n"); for (i = 0; i < RX_RING_SIZE; i++) { struct sk_buff *skb; u32 mapping; @@ -1231,7 +1215,7 @@ static void happy_meal_init_rings(struct happy_meal *hp) skb_reserve(skb, RX_OFFSET); } - HMD("init txring, "); + HMD("init txring\n"); for (i = 0; i < TX_RING_SIZE; i++) hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); @@ -1282,17 +1266,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, * XXX so I completely skip checking for it in the BMSR for now. */ -#ifdef AUTO_SWITCH_DEBUG - ASD("%s: Advertising [ "); - if (hp->sw_advertise & ADVERTISE_10HALF) - ASD("10H "); - if (hp->sw_advertise & ADVERTISE_10FULL) - ASD("10F "); - if (hp->sw_advertise & ADVERTISE_100HALF) - ASD("100H "); - if (hp->sw_advertise & ADVERTISE_100FULL) - ASD("100F "); -#endif + ASD("Advertising [ %s%s%s%s]\n", + hp->sw_advertise & ADVERTISE_10HALF ? "10H " : "", + hp->sw_advertise & ADVERTISE_10FULL ? "10F " : "", + hp->sw_advertise & ADVERTISE_100HALF ? "100H " : "", + hp->sw_advertise & ADVERTISE_100FULL ? "100F " : ""); /* Enable Auto-Negotiation, this is usually on already... */ hp->sw_bmcr |= BMCR_ANENABLE; @@ -1371,15 +1349,15 @@ static int happy_meal_init(struct happy_meal *hp) void __iomem *erxregs = hp->erxregs; void __iomem *bregs = hp->bigmacregs; void __iomem *tregs = hp->tcvregs; + const char *bursts; u32 regtmp, rxcfg; /* If auto-negotiation timer is running, kill it. */ del_timer(&hp->happy_timer); - HMD("happy_meal_init: happy_flags[%08x] ", - hp->happy_flags); + HMD("happy_flags[%08x]\n", hp->happy_flags); if (!(hp->happy_flags & HFLAG_INIT)) { - HMD("set HFLAG_INIT, "); + HMD("set HFLAG_INIT\n"); hp->happy_flags |= HFLAG_INIT; happy_meal_get_counters(hp, bregs); } @@ -1389,26 +1367,26 @@ static int happy_meal_init(struct happy_meal *hp) happy_meal_poll_stop(hp, tregs); /* Stop transmitter and receiver. */ - HMD("happy_meal_init: to happy_meal_stop\n"); + HMD("to happy_meal_stop\n"); happy_meal_stop(hp, gregs); /* Alloc and reset the tx/rx descriptor chains. */ - HMD("happy_meal_init: to happy_meal_init_rings\n"); + HMD("to happy_meal_init_rings\n"); happy_meal_init_rings(hp); /* Shut up the MIF. */ - HMD("happy_meal_init: Disable all MIF irqs (old[%08x]), ", + HMD("Disable all MIF irqs (old[%08x])\n", hme_read32(hp, tregs + TCVR_IMASK)); hme_write32(hp, tregs + TCVR_IMASK, 0xffff); /* See if we can enable the MIF frame on this card to speak to the DP83840. */ if (hp->happy_flags & HFLAG_FENABLE) { - HMD("use frame old[%08x], ", + HMD("use frame old[%08x]\n", hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); } else { - HMD("use bitbang old[%08x], ", + HMD("use bitbang old[%08x]\n", hme_read32(hp, tregs + TCVR_CFG)); hme_write32(hp, tregs + TCVR_CFG, hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); @@ -1419,22 +1397,21 @@ static int happy_meal_init(struct happy_meal *hp) happy_meal_transceiver_check(hp, tregs); /* Put the Big Mac into a sane state. */ - HMD("happy_meal_init: "); switch(hp->tcvr_type) { case none: /* Cannot operate if we don't know the transceiver type! */ - HMD("AAIEEE no transceiver type, EAGAIN"); + HMD("AAIEEE no transceiver type, EAGAIN\n"); return -EAGAIN; case internal: /* Using the MII buffers. */ - HMD("internal, using MII, "); + HMD("internal, using MII\n"); hme_write32(hp, bregs + BMAC_XIFCFG, 0); break; case external: /* Not using the MII, disable it. */ - HMD("external, disable MII, "); + HMD("external, disable MII\n"); hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); break; } @@ -1443,18 +1420,16 @@ static int happy_meal_init(struct happy_meal *hp) return -EAGAIN; /* Reset the Happy Meal Big Mac transceiver and the receiver. */ - HMD("tx/rx reset, "); + HMD("tx/rx reset\n"); happy_meal_tx_reset(hp, bregs); happy_meal_rx_reset(hp, bregs); /* Set jam size and inter-packet gaps to reasonable defaults. */ - HMD("jsize/ipg1/ipg2, "); hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); /* Load up the MAC address and random seed. */ - HMD("rseed/macaddr, "); /* The docs recommend to use the 10LSB of our MAC here. */ hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); @@ -1463,7 +1438,6 @@ static int happy_meal_init(struct happy_meal *hp) hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); - HMD("htable, "); if ((hp->dev->flags & IFF_ALLMULTI) || (netdev_mc_count(hp->dev) > 64)) { hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); @@ -1513,9 +1487,6 @@ static int happy_meal_init(struct happy_meal *hp) | 0x4); /* Set the supported burst sizes. */ - HMD("happy_meal_init: old[%08x] bursts<", - hme_read32(hp, gregs + GREG_CFG)); - #ifndef CONFIG_SPARC /* It is always PCI and can handle 64byte bursts. */ hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64); @@ -1543,34 +1514,35 @@ static int happy_meal_init(struct happy_meal *hp) } #endif - HMD("64>"); + bursts = "64"; hme_write32(hp, gregs + GREG_CFG, gcfg); } else if (hp->happy_bursts & DMA_BURST32) { - HMD("32>"); + bursts = "32"; hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); } else if (hp->happy_bursts & DMA_BURST16) { - HMD("16>"); + bursts = "16"; hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); } else { - HMD("XXX>"); + bursts = "XXX"; hme_write32(hp, gregs + GREG_CFG, 0); } #endif /* CONFIG_SPARC */ + HMD("old[%08x] bursts<%s>\n", + hme_read32(hp, gregs + GREG_CFG), bursts); + /* Turn off interrupts we do not want to hear. */ - HMD(", enable global interrupts, "); hme_write32(hp, gregs + GREG_IMASK, (GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP | GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR)); /* Set the transmit ring buffer size. */ - HMD("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, + HMD("tx rsize=%d oreg[%08x]\n", (int)TX_RING_SIZE, hme_read32(hp, etxregs + ETX_RSIZE)); hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); /* Enable transmitter DVMA. */ - HMD("tx dma enable old[%08x], ", - hme_read32(hp, etxregs + ETX_CFG)); + HMD("tx dma enable old[%08x]\n", hme_read32(hp, etxregs + ETX_CFG)); hme_write32(hp, etxregs + ETX_CFG, hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); @@ -1594,7 +1566,7 @@ static int happy_meal_init(struct happy_meal *hp) } /* Enable Big Mac hash table filter. */ - HMD("happy_meal_init: enable hash rx_cfg_old[%08x], ", + HMD("enable hash rx_cfg_old[%08x]\n", hme_read32(hp, bregs + BMAC_RXCFG)); rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME; if (hp->dev->flags & IFF_PROMISC) @@ -1605,7 +1577,7 @@ static int happy_meal_init(struct happy_meal *hp) udelay(10); /* Ok, configure the Big Mac transmitter. */ - HMD("BIGMAC init, "); + HMD("BIGMAC init\n"); regtmp = 0; if (hp->happy_flags & HFLAG_FULL) regtmp |= BIGMAC_TXCFG_FULLDPLX; @@ -1629,8 +1601,7 @@ static int happy_meal_init(struct happy_meal *hp) if (hp->tcvr_type == external) regtmp |= BIGMAC_XCFG_MIIDISAB; - HMD("XIF config old[%08x], ", - hme_read32(hp, bregs + BMAC_XIFCFG)); + HMD("XIF config old[%08x]\n", hme_read32(hp, bregs + BMAC_XIFCFG)); hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); /* Start things up. */ @@ -1769,14 +1740,10 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { /* All sorts of DMA receive errors. */ - netdev_err(hp->dev, "Happy Meal rx DMA errors [ "); - if (status & GREG_STAT_RXERR) - printk("GenericError "); - if (status & GREG_STAT_RXPERR) - printk("ParityError "); - if (status & GREG_STAT_RXTERR) - printk("RxTagBotch "); - printk("]\n"); + netdev_err(hp->dev, "Happy Meal rx DMA errors [ %s%s%s]\n", + status & GREG_STAT_RXERR ? "GenericError " : "", + status & GREG_STAT_RXPERR ? "ParityError " : "", + status & GREG_STAT_RXTERR ? "RxTagBotch " : ""); reset = 1; } @@ -1797,16 +1764,11 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) if (status & (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { /* All sorts of transmit DMA errors. */ - netdev_err(hp->dev, "Happy Meal tx DMA errors [ "); - if (status & GREG_STAT_TXEACK) - printk("GenericError "); - if (status & GREG_STAT_TXLERR) - printk("LateError "); - if (status & GREG_STAT_TXPERR) - printk("ParityError "); - if (status & GREG_STAT_TXTERR) - printk("TagBotch "); - printk("]\n"); + netdev_err(hp->dev, "Happy Meal tx DMA errors [ %s%s%s%s]\n", + status & GREG_STAT_TXEACK ? "GenericError " : "", + status & GREG_STAT_TXLERR ? "LateError " : "", + status & GREG_STAT_TXPERR ? "ParityError " : "", + status & GREG_STAT_TXTERR ? "TagBotch " : ""); reset = 1; } @@ -1839,16 +1801,16 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) /* Use the fastest transmission protocol possible. */ if (hp->sw_lpa & LPA_100FULL) { - netdev_info(hp->dev, "Switching to 100Mbps at full duplex."); + netdev_info(hp->dev, "Switching to 100Mbps at full duplex.\n"); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); } else if (hp->sw_lpa & LPA_100HALF) { - netdev_info(hp->dev, "Switching to 100MBps at half duplex."); + netdev_info(hp->dev, "Switching to 100MBps at half duplex.\n"); hp->sw_bmcr |= BMCR_SPEED100; } else if (hp->sw_lpa & LPA_10FULL) { - netdev_info(hp->dev, "Switching to 10MBps at full duplex."); + netdev_info(hp->dev, "Switching to 10MBps at full duplex.\n"); hp->sw_bmcr |= BMCR_FULLDPLX; } else { - netdev_info(hp->dev, "Using 10Mbps at half duplex."); + netdev_info(hp->dev, "Using 10Mbps at half duplex.\n"); } happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); @@ -1865,13 +1827,12 @@ static void happy_meal_tx(struct happy_meal *hp) int elem; elem = hp->tx_old; - TXD("TX<"); while (elem != hp->tx_new) { struct sk_buff *skb; u32 flags, dma_addr, dma_len; int frag; - TXD("[%d]", elem); + TXD("TX[%d]\n", elem); this = &txbase[elem]; flags = hme_read_desc32(hp, &this->tx_flags); if (flags & TXFLAG_OWN) @@ -1907,7 +1868,6 @@ static void happy_meal_tx(struct happy_meal *hp) dev->stats.tx_packets++; } hp->tx_old = elem; - TXD(">"); if (netif_queue_stopped(dev) && TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) @@ -1930,7 +1890,6 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) int elem = hp->rx_new, drops = 0; u32 flags; - RXD("RX<"); this = &rxbase[elem]; while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { struct sk_buff *skb; @@ -1938,11 +1897,9 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) u16 csum = flags & RXFLAG_CSUM; u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); - RXD("[%d ", elem); - /* Check for errors. */ if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { - RXD("ERR(%08x)]", flags); + RXD("RX[%d ERR(%08x)]", elem, flags); dev->stats.rx_errors++; if (len < ETH_ZLEN) dev->stats.rx_length_errors++; @@ -2014,7 +1971,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->ip_summed = CHECKSUM_COMPLETE; - RXD("len=%d csum=%4x]", len, csum); + RXD("RX[%d len=%d csum=%4x]", elem, len, csum); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -2027,7 +1984,6 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) hp->rx_new = elem; if (drops) netdev_info(hp->dev, "Memory squeeze, deferring packet.\n"); - RXD(">"); } static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) @@ -2036,30 +1992,23 @@ static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD("happy_meal_interrupt: status=%08x ", happy_status); + HMD("status=%08x\n", happy_status); spin_lock(&hp->happy_lock); if (happy_status & GREG_STAT_ERRORS) { - HMD("ERRORS "); if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) goto out; } - if (happy_status & GREG_STAT_MIFIRQ) { - HMD("MIFIRQ "); + if (happy_status & GREG_STAT_MIFIRQ) happy_meal_mif_interrupt(hp); - } - if (happy_status & GREG_STAT_TXALL) { - HMD("TXALL "); + if (happy_status & GREG_STAT_TXALL) happy_meal_tx(hp); - } - if (happy_status & GREG_STAT_RXTOHOST) { - HMD("RXTOHOST "); + if (happy_status & GREG_STAT_RXTOHOST) happy_meal_rx(hp, dev); - } HMD("done\n"); out: @@ -2079,7 +2028,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); - HMD("quattro_interrupt: status=%08x ", happy_status); + HMD("status=%08x\n", happy_status); if (!(happy_status & (GREG_STAT_ERRORS | GREG_STAT_MIFIRQ | @@ -2089,26 +2038,18 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) spin_lock(&hp->happy_lock); - if (happy_status & GREG_STAT_ERRORS) { - HMD("ERRORS "); + if (happy_status & GREG_STAT_ERRORS) if (happy_meal_is_not_so_happy(hp, happy_status)) goto next; - } - if (happy_status & GREG_STAT_MIFIRQ) { - HMD("MIFIRQ "); + if (happy_status & GREG_STAT_MIFIRQ) happy_meal_mif_interrupt(hp); - } - if (happy_status & GREG_STAT_TXALL) { - HMD("TXALL "); + if (happy_status & GREG_STAT_TXALL) happy_meal_tx(hp); - } - if (happy_status & GREG_STAT_RXTOHOST) { - HMD("RXTOHOST "); + if (happy_status & GREG_STAT_RXTOHOST) happy_meal_rx(hp, dev); - } next: spin_unlock(&hp->happy_lock); @@ -2124,8 +2065,6 @@ static int happy_meal_open(struct net_device *dev) struct happy_meal *hp = netdev_priv(dev); int res; - HMD("happy_meal_open: "); - /* On SBUS Quattro QFE cards, all hme interrupts are concentrated * into a single source which we register handling at probe time. */ @@ -2238,7 +2177,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, } entry = hp->tx_new; - SXD("SX", len, entry); + SXD("SX\n", skb->len, entry); hp->tx_skbs[entry] = skb; if (skb_shinfo(skb)->nr_frags == 0) { @@ -2781,12 +2720,12 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) platform_set_drvdata(op, hp); if (qfe_slot != -1) - netdev_info(dev, "Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", - qfe_slot); + netdev_info(dev, + "Quattro HME slot %d (SBUS) 10/100baseT Ethernet %pM\n", + qfe_slot, dev->dev_addr); else - netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet "); - - printk("%pM\n", dev->dev_addr); + netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet %pM\n", + dev->dev_addr); return 0; @@ -3112,25 +3051,18 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, sprintf(prom_name, "-%d", i + 3); } netdev_info(dev, - "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", - prom_name); - if (qpdev->vendor == PCI_VENDOR_ID_DEC && - qpdev->device == PCI_DEVICE_ID_DEC_21153) - printk("DEC 21153 PCI Bridge\n"); - else - printk("unknown bridge %04x.%04x\n", - qpdev->vendor, qpdev->device); + "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet bridge %04x.%04x\n", + prom_name, qpdev->vendor, qpdev->device); } if (qfe_slot != -1) netdev_info(dev, - "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", - qfe_slot); + "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet %pM\n", + qfe_slot, dev->dev_addr); else netdev_info(dev, - "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet "); - - printk("%pM\n", dev->dev_addr); + "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet %pM\n", + dev->dev_addr); return 0; From patchwork Sat Sep 24 01:53:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987317 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19A91C04A95 for ; Sat, 24 Sep 2022 01:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233225AbiIXBzY (ORCPT ); Fri, 23 Sep 2022 21:55:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233146AbiIXByy (ORCPT ); Fri, 23 Sep 2022 21:54:54 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537AA145977; Fri, 23 Sep 2022 18:53:59 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id c11so1120274qtw.8; Fri, 23 Sep 2022 18:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=3bs0N5FwO/r0I3aQCR6SfwM41fBZ9Ic0KQjMl09QWjk=; b=ZXHC5ypKv1ZGjdXJiWNL8dsr0d1r67+YgujjKk6DxMNlj1+9ggIx05H0bYS1dUJnjy +iONTkuPuP579bZtaM2znKhSdOiOEkWw+gjoFEHQHXPUc2KD//K4FGNDvAbdcxCWlBm1 1RExhs3HZEnN+pRMmrAzrxPz7zTgLjb3lodZAs7cHTumjqDMzTAksFz6tr5pIWX7BDaa IJ0uEcXg10LlBEBraG1+f6cHgzVKdwk+JEB3tQEtO8Z1+HwxiGDEt8syre9skftm9gOt zK7Z7IjHukvG7vLoJmdTSBP7uP9d7DJsTaHfGjvZDv8sf27DIvUQoL6KmOzJvKPYwSon Tjnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=3bs0N5FwO/r0I3aQCR6SfwM41fBZ9Ic0KQjMl09QWjk=; b=TPEyLy0+U5A02V5HLNXv3Fxt9XggtDZS4m6yRxvkFK6jtV0uEdWqTH30Tz6NbIhedG r3crKqwfAWa5VhFKV75ynYUn8ttuIArvhTbXDXFLpnczX/jlvNYzX16Vi0gckVl+ViOB xPzVcBUHm3vu8xBREvAmanEIQ2y33RV6siFFCtHAsVkyMP3wQleoMYeDRetjcOYuGDKZ PI67RmV+PWBwWbW9UwR+B9ME50ynko6UqFF9gBs4as4IeiecEl8eIwBvoyf1+sABgPo8 g7MgQoOKaMU+viFfF1wGOIYZA8vJs0NhCgujS+0JGkBXH3nzwmN6JAkozqMTb/O2xdtf w02A== X-Gm-Message-State: ACrzQf0yT621eUIKbbImEMwea+gi/wiaV2+gWyKC4TuZVGr/TeTYe29b ilcAHruD+cOcEJIztvLBuJk= X-Google-Smtp-Source: AMsMyM4NoqWWbAyhrpxWzm3iSHZn5UKo/dspK1DtGupdppRMRjesNg5E8ydEvbkdy1BnUPDOekYf+g== X-Received: by 2002:a05:622a:1a1b:b0:35c:d51b:505b with SMTP id f27-20020a05622a1a1b00b0035cd51b505bmr10097224qtb.308.1663984438720; Fri, 23 Sep 2022 18:53:58 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id bb4-20020a05622a1b0400b0035cf2995ad8sm6183121qtb.51.2022.09.23.18.53.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:58 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 12/13] sunhme: Use vdbg for spam-y prints Date: Fri, 23 Sep 2022 21:53:38 -0400 Message-Id: <20220924015339.1816744-13-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The SXD, TXD, and RXD macros are used only once (or twice). Just use the vdbg print, which seems to have been devised for these sorts of very verbose messages. Signed-off-by: Sean Anderson --- (no changes since v1) drivers/net/ethernet/sun/sunhme.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 51a04353e08e..3afa73db500c 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -90,27 +90,6 @@ static struct quattro *qfe_pci_list; #define ASD(...) #endif -/* Transmit debug */ -#if 1 -#define TXD hme_debug -#else -#define TXD(...) -#endif - -/* Skid buffer debug */ -#if 1 -#define SXD hme_debug -#else -#define SXD(...) -#endif - -/* Receive debug */ -#if 1 -#define RXD hme_debug -#else -#define RXD(...) -#endif - #if 0 struct hme_tx_logent { unsigned int tstamp; @@ -1832,7 +1811,7 @@ static void happy_meal_tx(struct happy_meal *hp) u32 flags, dma_addr, dma_len; int frag; - TXD("TX[%d]\n", elem); + netdev_vdbg(hp->dev, "TX[%d]\n", elem); this = &txbase[elem]; flags = hme_read_desc32(hp, &this->tx_flags); if (flags & TXFLAG_OWN) @@ -1899,7 +1878,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) /* Check for errors. */ if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { - RXD("RX[%d ERR(%08x)]", elem, flags); + netdev_vdbg(dev, "RX[%d ERR(%08x)]", elem, flags); dev->stats.rx_errors++; if (len < ETH_ZLEN) dev->stats.rx_length_errors++; @@ -1971,7 +1950,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->ip_summed = CHECKSUM_COMPLETE; - RXD("RX[%d len=%d csum=%4x]", elem, len, csum); + netdev_vdbg(dev, "RX[%d len=%d csum=%4x]", elem, len, csum); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -2177,7 +2156,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, } entry = hp->tx_new; - SXD("SX\n", skb->len, entry); + netdev_vdbg(dev, "SX\n", skb->len, entry); hp->tx_skbs[entry] = skb; if (skb_shinfo(skb)->nr_frags == 0) { From patchwork Sat Sep 24 01:53:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12987319 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8977C07E9D for ; Sat, 24 Sep 2022 01:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbiIXBzm (ORCPT ); Fri, 23 Sep 2022 21:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233172AbiIXBzF (ORCPT ); Fri, 23 Sep 2022 21:55:05 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9759E146633; Fri, 23 Sep 2022 18:54:01 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id mi14so1020580qvb.12; Fri, 23 Sep 2022 18:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Nte7p+jnLyhkSvGVt/N5dUvnml7WCMzO6Xtu7Rr0z68=; b=KPrT3VeZVs4usk0B+/Ed1ZSzBe93N+XZaNfdL41TvLKa9Q2oFNfPB79yrIxBFkcQks Wxa/8pVayj+tgP/pwxSSNBysdrs19uYNRlwVkff3YiMVv3NdfgkUuaUKR6Wp2a7YqyXf zF7NyR9C7uMb42nJCcNW3BxtrG/HebhxqkB91bIHPlV8V/wthEfqvUVBrsXYZarKzt5B FwrASmtcJOotX+rOeM9FEgPuBK0a7kao+T7Ae2s0TinAppb1grrrGUM0pz1TELpBZnvE wASAP1MapudTpyd3PsZZERrrIfZ7GV5nxPTdvhnHXuQwLcZ+DjfoLF0Qz2j4OPg4qBBA vkug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Nte7p+jnLyhkSvGVt/N5dUvnml7WCMzO6Xtu7Rr0z68=; b=4FSI5JzNEf+WGY1D8qfAu7Kn9x+J8FaoZh0b/UqjeOmd0cz0L4/9+m5aHbzX0L/sDd 7FN9TQILMUye2yBYOuilIyVOik1QeuVPS9CM3KPDnOuWgOKn4biZtshByvARYe6E6OlP MYk+rTo6x2wPbtonKEFPyBp01TxuHjGUNP0dKuuSmsRjtF09tLnmvIC0ecLXetFNeVQG TnbXrtxBkid7rttCffmYiS/kkZTykmiPDTszz86R9ZsMJ6O+U5BwulOzQ/FOfnynuVZw XYKruVjNltQbwd2LySGClK+QgRs3+aq2sFMef9tIWoDixSiI9duXOG/OcYMJbir1fkb7 XG9Q== X-Gm-Message-State: ACrzQf2EYw4aXjuCN1CngmVxJcns3lhcwqImZ+QhcvWimkSn7AmcVfAK rnqXvm3h3HFWghr76dUy1FM= X-Google-Smtp-Source: AMsMyM5lwDv2RVyoB9OOg3yvdYPKo12pYK4CJOJ7lq2QPZ/AMtntKppUorx/ZW6ZUiIIFtUlxMUL/g== X-Received: by 2002:a05:6214:f26:b0:4ac:7bf9:21d4 with SMTP id iw6-20020a0562140f2600b004ac7bf921d4mr9539214qvb.98.1663984440218; Fri, 23 Sep 2022 18:54:00 -0700 (PDT) Received: from localhost (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with UTF8SMTPSA id h6-20020a05620a400600b006b9ab3364ffsm7223719qko.11.2022.09.23.18.53.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 18:53:59 -0700 (PDT) From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Nick Bowler , Rolf Eike Beer , Zheyu Ma , linux-kernel@vger.kernel.org (open list), Sean Anderson Subject: [PATCH net-next v2 13/13] sunhme: Add myself as a maintainer Date: Fri, 23 Sep 2022 21:53:39 -0400 Message-Id: <20220924015339.1816744-14-seanga2@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220924015339.1816744-1-seanga2@gmail.com> References: <20220924015339.1816744-1-seanga2@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org I have the hardware so at the very least I can test things. Signed-off-by: Sean Anderson --- (no changes since v1) MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 74036b51911d..381e1457f601 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19491,6 +19491,11 @@ L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/dlink/sundance.c +SUN HAPPY MEAL ETHERNET DRIVER +M: Sean Anderson +S: Maintained +F: drivers/net/ethernet/sun/sunhme.* + SUNPLUS ETHERNET DRIVER M: Wells Lu L: netdev@vger.kernel.org