Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2132456pxa; Mon, 17 Aug 2020 01:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn+E6fL8H+CoAktEW6kUzB9LVQVPvdVr3DkTlC2OOXASt0t67MalZgn29jpoMGgms3F3zM X-Received: by 2002:a17:906:3b83:: with SMTP id u3mr13836345ejf.55.1597652793717; Mon, 17 Aug 2020 01:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597652793; cv=none; d=google.com; s=arc-20160816; b=Je6cDkejVgg4E4bfbH1FBiZyYFn3uNMfSU6R32cAtoapMFd4xMEeovIz+J7SyyudKM bl3wV3Ov3aGtx47yhhH3Oo00aMCunOBbzIARqY0gsBuU4dbUwibPKelk9prqeas6kone C5r77NsikBUnDhKTJpVzpfbgK/hg59LOgUU6YMiobnrZpQ0SpPEiPJuQ9DazeClIUhCh 4zdvBRG5ls/9qzWkJvzpNpWvwrw6KJ77aM9QOS0aifJlqQfff8Coxayld/cEcFJpkAHG rK75nlv26dBZ7vyi4fg+oyCD3Jpjv4TA8SjMSBYryJU/Ctvh1DmDmQ0MDbv+w9g5reLw kADA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=t98B3iZn1A9NLqkiUAje/weBgNoNpyefzZebYfgmTtE=; b=ygZKTf8FdVkZwB9KofsIp1XLqRdWpD49emUej3yYnpwBvG2l4fQmxr1ediEeZiIuFe KoWBtMzA0KM+6quey80t0wUX8aP/zNoQ9M78wXaAjgdVYRpuSSuhRJr5TcNxPcTmzMdN 3H4yBEQJ6cnAWsbryG3f0UPUYBsOCpYne37q+rI3PIHXl3RDCkw+to5fNfqQifwdE6AY 2A1nXHUB8sFhWKD7TAh1NVkgqHg32VSwSPkxwq1518Zm5dBktehITxNw8bBk6E5d2jsc taW2WDuqn8RO8s9KFZhQCYHKmFVr6jMsoug69QMbA9MY5ctjWGA7MqlxWSGprD1ZAgl+ 8V9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZLuecL8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si10427723edm.555.2020.08.17.01.26.11; Mon, 17 Aug 2020 01:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZLuecL8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728286AbgHQIZm (ORCPT + 99 others); Mon, 17 Aug 2020 04:25:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728155AbgHQIZg (ORCPT ); Mon, 17 Aug 2020 04:25:36 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A509FC061388; Mon, 17 Aug 2020 01:25:36 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id mw10so7346717pjb.2; Mon, 17 Aug 2020 01:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t98B3iZn1A9NLqkiUAje/weBgNoNpyefzZebYfgmTtE=; b=jZLuecL8IeUDv5a24d46K3rjLGWcoQJj69HmdPY/DPKCZxH5u+GyxjZZU0tHjy6TcL q4HpfCzSZMtxa61vEN7/e/eDdpbmaZVqSDB73eonA+uwHWobDX7xGEC0NjwH81/fXTVK 7ff3VxfI4HmSAE+59SQ7UN6yt952R0GQc/s9UOWICylm4KiIaXzaPAUDZFNUpWcFYUQ4 h4QkOSWETXpxWR04vhc42wXGtQl7Pflsu2sYnuQWpvyDpJoPvYC6WGr5KRgcK/CANL8x VKrhuEQhsp7U8rTTGURn1Uij6MXbcuyNQQ9WVswpOdCZJH1lpE33edBog9aESZmbcyLV crfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t98B3iZn1A9NLqkiUAje/weBgNoNpyefzZebYfgmTtE=; b=ew/NFMYo4yOg+f5YNKkp0JqgLNC2D5+EsSy84q/hdcZUT7iks3vWMfr5Q69C960QrQ kdsTl4xLi/m0ZDxv+vQir9FNzhrAMPI8YSbGimgxbNleyZYu5vrskLEYARHbqd/um52p gfprTsai93UwRdFP32tPh2gm8QBHi0NZt45R1UI0fksdaVg0Nggb1IagqfdoeHlSi3Oi WlOrZsRnVmp4EjtnspGMG9VnZd+GT2QSp1CzHbPFz99QR/HJNTe/4624g+7Sww1tDuod cLVV0cUqp8ZSQ+A7TkgibIguAwvCWlLejl6ix/MyXesquR0IjoR+ypoJxgPn1e7Mbeq6 YR9Q== X-Gm-Message-State: AOAM533SWs+mVWRRLc3hfKVnPFoa7+Ai/j7tk7EqCIiDTbmbf7i3Einz KsrjOp4QcJ3/O1n1VrJlGaE= X-Received: by 2002:a17:90a:ff85:: with SMTP id hf5mr11460448pjb.79.1597652736154; Mon, 17 Aug 2020 01:25:36 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id r186sm19928482pfr.162.2020.08.17.01.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:25:35 -0700 (PDT) From: Allen Pais To: jes@trained-monkey.org, davem@davemloft.net, kuba@kernel.org, kda@linux-powerpc.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, borisp@mellanox.com Cc: keescook@chromium.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, oss-drivers@netronome.com, Allen Pais , Romain Perier Subject: [PATCH 07/20] ethernet: dlink: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:54:21 +0530 Message-Id: <20200817082434.21176-9-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817082434.21176-1-allen.lkml@gmail.com> References: <20200817082434.21176-1-allen.lkml@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/ethernet/dlink/sundance.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c index b3f8597e77aa..58022396b053 100644 --- a/drivers/net/ethernet/dlink/sundance.c +++ b/drivers/net/ethernet/dlink/sundance.c @@ -429,8 +429,8 @@ static void init_ring(struct net_device *dev); static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); static int reset_tx (struct net_device *dev); static irqreturn_t intr_handler(int irq, void *dev_instance); -static void rx_poll(unsigned long data); -static void tx_poll(unsigned long data); +static void rx_poll(struct tasklet_struct *t); +static void tx_poll(struct tasklet_struct *t); static void refill_rx (struct net_device *dev); static void netdev_error(struct net_device *dev, int intr_status); static void netdev_error(struct net_device *dev, int intr_status); @@ -537,8 +537,8 @@ static int sundance_probe1(struct pci_dev *pdev, np->msg_enable = (1 << debug) - 1; spin_lock_init(&np->lock); spin_lock_init(&np->statlock); - tasklet_init(&np->rx_tasklet, rx_poll, (unsigned long)dev); - tasklet_init(&np->tx_tasklet, tx_poll, (unsigned long)dev); + tasklet_setup(&np->rx_tasklet, rx_poll); + tasklet_setup(&np->tx_tasklet, tx_poll); ring_space = dma_alloc_coherent(&pdev->dev, TX_TOTAL_SIZE, &ring_dma, GFP_KERNEL); @@ -1054,10 +1054,9 @@ static void init_ring(struct net_device *dev) } } -static void tx_poll (unsigned long data) +static void tx_poll(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = netdev_priv(dev); + struct netdev_private *np = from_tasklet(np, t, tx_tasklet); unsigned head = np->cur_task % TX_RING_SIZE; struct netdev_desc *txdesc = &np->tx_ring[(np->cur_tx - 1) % TX_RING_SIZE]; @@ -1312,10 +1311,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) return IRQ_RETVAL(handled); } -static void rx_poll(unsigned long data) +static void rx_poll(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = netdev_priv(dev); + struct netdev_private *np = from_tasklet(np, t, rx_tasklet); + struct net_device *dev = (struct net_device *)((char *)np - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); int entry = np->cur_rx % RX_RING_SIZE; int boguscnt = np->budget; void __iomem *ioaddr = np->base; -- 2.17.1