Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp743249pxb; Wed, 20 Jan 2021 20:54:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmk0O22UBDkBjx6fNM+S9dHL3Ahy7PVB1J6Watc0DtywgYXD/HCcWmDIyvrFzLi64TqSXf X-Received: by 2002:a17:906:4bc1:: with SMTP id x1mr8132506ejv.509.1611204865657; Wed, 20 Jan 2021 20:54:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611204865; cv=none; d=google.com; s=arc-20160816; b=FKAHq9YwyR9/q+Cc+43Djq5VP0iDZOVjpyOvXG8EDCqtzGNkFr0a6wsFnTWI2ZxLeG n7OtxBMmGB+yILTpoZCnfC4SrB38DAoMWVZAzC4PLonp1I0b2WpNbLm3FfHKVBaEyG9y 4C8u+GLyb3jI+0spZ8DFSLfzUaqqKI7JJCnbr+QK4dVljV/OIJfz7g/Cg/UnLVYF4DvW W4VF563JUh6HzLhL/tqFlRo+rVzEr1dNPnIQ9TO6Dloi+fNeUHh3Nyvq+Ut/5Ezaz8lm Bjf6tdQcw+xFY1W6Gfh77lLVsr2AVjo8tDtIzpqz+xkdqiZ7GY1EcJGYbXNWGDYTWi+q QNaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+bF0wgyuousrsBjw1bti5ZYiRgHZLvFxR0KyJROcYJo=; b=Oifykmn/TlXEPVID0KgT1BbvdNh5FBTz+3RCBH+o9G/9aQR6CRthkVDAKwRHpbHm20 X0SBDx5K/Ud/XIrY3jsqOQhNv7hS2MXfSevJWyrd1zcGaLQlarGLCx8TMRpo1HmHiDsJ RYOm7nk/GCJMXxlarUKw46X2AlreBxiajLbsZ8JRwJJQVX/lzYseAGHvOf15797NhGmx NHBsI51PftSc8TqzvsVg6+arVf71Flbxy3Wg8lha0YIjXPXnzouguppYo8R6O7EyEeGW u3jJpE5cVrYPk5aalrF7KeeocwYuPPxkFMOyidSHAVzKpqy8TtKQlDefypFRk4obTvNm Hdsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rbNcyjH3; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 r25si1649123edy.156.2021.01.20.20.54.02; Wed, 20 Jan 2021 20:54:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=rbNcyjH3; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S1726698AbhAUEwj (ORCPT + 99 others); Wed, 20 Jan 2021 23:52:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732155AbhAUEnh (ORCPT ); Wed, 20 Jan 2021 23:43:37 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3863CC0613C1; Wed, 20 Jan 2021 20:42:51 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id o20so794402pfu.0; Wed, 20 Jan 2021 20:42:51 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=+bF0wgyuousrsBjw1bti5ZYiRgHZLvFxR0KyJROcYJo=; b=rbNcyjH3IL4S4axnopSH3rjUZzG7W/bGtWViPzFEL1hiac5X86w8YnlDIgVeXJRr6F OV2okXzwTQgN327lmN3MWR7Pcs4xBjG9pwYEIEKeU9D3X8lBYp4qqm6dF+b8BT2SaWAl lWPZBptY6sjp4OGHAEP8cy6ijE9UJV/3cK27KWbwm9XBAQU4dxTAnoCYL7cPF9dwAnFH FNQkM7sFo5pVX3xvjZB0ctPvnIFu1OIFqk+IS3j7h3bMRsD6j+mMxothtt+U9kHcx0aG NrH2u6uZ1O2wqljS2HDaw2TxFOFvBFiE8CFlmgZSWvDDv27217mb4xd4OTz8AoBWm8gN FGUQ== 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:mime-version:content-transfer-encoding; bh=+bF0wgyuousrsBjw1bti5ZYiRgHZLvFxR0KyJROcYJo=; b=tjnxWKyxMq5oTIIz3QGdetLzSuiTvsQsnP5jA6SL8R57DaT4tOiEGda09QzWrHeOcK GqgDRIBtoKcTc707BJ7Ab9NlMFP6hqdGqXHyMT+EiOEl7JJAvzVt+HlegaRo2BsVt7AX g4ijh5F8f94eVzLSFyEQE3/67UPR0bn9QpFcMXdKcPuPJEt8qTMGVOlF4HGNum7jneE9 TZsPyW/bm9T4mmhLa7g3ynBNjbLjzHAAvFax6A3elPlHb3G9T2gfZmlqThjiMr8mhfk3 E6ybVobDevjQs6oWg8qECC9S+onY1kUW/tv2HGoj9nKyYvpeegeudoqfyWgBAwWHAMFv fo3Q== X-Gm-Message-State: AOAM533j69m5/7wjf3sS2jRyVcUdl8F+xgCFumvNT1aKb+g7lKeQnVJv dvxK4ErR3GThz7fhCQMx1Sg= X-Received: by 2002:a62:87c9:0:b029:1a5:9d56:7e24 with SMTP id i192-20020a6287c90000b02901a59d567e24mr12007053pfe.56.1611204170775; Wed, 20 Jan 2021 20:42:50 -0800 (PST) Received: from localhost.localdomain ([49.207.210.174]) by smtp.gmail.com with ESMTPSA id jx15sm3916014pjb.17.2021.01.20.20.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 20:42:50 -0800 (PST) From: Allen Pais To: herbert@gondor.apana.org.au Cc: davem@davemloft.net, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, jesper.nilsson@axis.com, lars.persson@axis.com, horia.geanta@nxp.com, aymen.sghaier@nxp.com, gcherian@marvell.com, thomas.lendacky@amd.com, john.allen@amd.com, gilad@benyossef.com, bbrezillon@kernel.org, arno@natisbad.org, schalla@marvell.com, matthias.bgg@gmail.com, jamie@jamieiles.com, giovanni.cabiddu@intel.com, heiko@sntech.de, krzk@kernel.org, vz@mleia.com, k.konieczny@samsung.com, linux-crypto@vger.kernel.org, linux-mediatek@lists.infradead.org, qat-linux@intel.com, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v4 06/19] crypto: ccp: convert tasklets to use new tasklet_setup() API Date: Thu, 21 Jan 2021 10:11:13 +0530 Message-Id: <20210121044126.152274-7-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210121044126.152274-1-allen.lkml@gmail.com> References: <20210121044126.152274-1-allen.lkml@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Allen Pais 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. Acked-by: John Allen Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/ccp/ccp-dev-v3.c | 9 ++++----- drivers/crypto/ccp/ccp-dev-v5.c | 9 ++++----- drivers/crypto/ccp/ccp-dmaengine.c | 7 +++---- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c index 0d5576f6ad21..858566867fa3 100644 --- a/drivers/crypto/ccp/ccp-dev-v3.c +++ b/drivers/crypto/ccp/ccp-dev-v3.c @@ -321,9 +321,9 @@ static void ccp_enable_queue_interrupts(struct ccp_device *ccp) iowrite32(ccp->qim, ccp->io_regs + IRQ_MASK_REG); } -static void ccp_irq_bh(unsigned long data) +static void ccp_irq_bh(struct tasklet_struct *t) { - struct ccp_device *ccp = (struct ccp_device *)data; + struct ccp_device *ccp = from_tasklet(ccp, t, irq_tasklet); struct ccp_cmd_queue *cmd_q; u32 q_int, status; unsigned int i; @@ -361,7 +361,7 @@ static irqreturn_t ccp_irq_handler(int irq, void *data) if (ccp->use_tasklet) tasklet_schedule(&ccp->irq_tasklet); else - ccp_irq_bh((unsigned long)ccp); + ccp_irq_bh(&ccp->irq_tasklet); return IRQ_HANDLED; } @@ -457,8 +457,7 @@ static int ccp_init(struct ccp_device *ccp) /* Initialize the ISR tasklet? */ if (ccp->use_tasklet) - tasklet_init(&ccp->irq_tasklet, ccp_irq_bh, - (unsigned long)ccp); + tasklet_setup(&ccp->irq_tasklet, ccp_irq_bh); dev_dbg(dev, "Starting threads...\n"); /* Create a kthread for each queue */ diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c index 7838f63bab32..e68b05a3169b 100644 --- a/drivers/crypto/ccp/ccp-dev-v5.c +++ b/drivers/crypto/ccp/ccp-dev-v5.c @@ -733,9 +733,9 @@ static void ccp5_enable_queue_interrupts(struct ccp_device *ccp) iowrite32(SUPPORTED_INTERRUPTS, ccp->cmd_q[i].reg_int_enable); } -static void ccp5_irq_bh(unsigned long data) +static void ccp5_irq_bh(struct tasklet_struct *t) { - struct ccp_device *ccp = (struct ccp_device *)data; + struct ccp_device *ccp = from_tasklet(ccp, t, irq_tasklet); u32 status; unsigned int i; @@ -772,7 +772,7 @@ static irqreturn_t ccp5_irq_handler(int irq, void *data) if (ccp->use_tasklet) tasklet_schedule(&ccp->irq_tasklet); else - ccp5_irq_bh((unsigned long)ccp); + ccp5_irq_bh(&ccp->irq_tasklet); return IRQ_HANDLED; } @@ -894,8 +894,7 @@ static int ccp5_init(struct ccp_device *ccp) } /* Initialize the ISR tasklet */ if (ccp->use_tasklet) - tasklet_init(&ccp->irq_tasklet, ccp5_irq_bh, - (unsigned long)ccp); + tasklet_setup(&ccp->irq_tasklet, ccp5_irq_bh); dev_dbg(dev, "Loading LSB map...\n"); /* Copy the private LSB mask to the public registers */ diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c index 0770a83bf1a5..a85690866b05 100644 --- a/drivers/crypto/ccp/ccp-dmaengine.c +++ b/drivers/crypto/ccp/ccp-dmaengine.c @@ -121,9 +121,9 @@ static void ccp_cleanup_desc_resources(struct ccp_device *ccp, } } -static void ccp_do_cleanup(unsigned long data) +static void ccp_do_cleanup(struct tasklet_struct *t) { - struct ccp_dma_chan *chan = (struct ccp_dma_chan *)data; + struct ccp_dma_chan *chan = from_tasklet(chan, t, cleanup_tasklet); unsigned long flags; dev_dbg(chan->ccp->dev, "%s - chan=%s\n", __func__, @@ -712,8 +712,7 @@ int ccp_dmaengine_register(struct ccp_device *ccp) INIT_LIST_HEAD(&chan->active); INIT_LIST_HEAD(&chan->complete); - tasklet_init(&chan->cleanup_tasklet, ccp_do_cleanup, - (unsigned long)chan); + tasklet_setup(&chan->cleanup_tasklet, ccp_do_cleanup); dma_chan->device = dma_dev; dma_cookie_init(dma_chan); -- 2.25.1