Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2127587pxa; Mon, 17 Aug 2020 01:14:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/c3an/6z2qxWZVVAmugCMZjDgOFT3JC0iLryOcuA0U+SwMt4zHWxMqfjUNxS49iMsxugx X-Received: by 2002:a17:906:7153:: with SMTP id z19mr13550962ejj.319.1597652089243; Mon, 17 Aug 2020 01:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597652089; cv=none; d=google.com; s=arc-20160816; b=gHYe4rk0qTC/3quOdLBjxxY3d8tD6snMp7ly3heooEMC4Io6EFq4aCtWWrn2Y03nvn V1gRyAS4mWnETzcyxbEdQZroAGppPusa4rN39UrSeoTfrPuJ/YQN82G2duLAFmzaes6y hGiaPcCL0iZA61Uib0z/+ODVewgy8TIiruYn/wGMLnO0SWHpd1wClKSZhdMUCzIIOwAK sESJV5fFnmA+eviOaBWlk6TTxI9Rn2UM0y63EDfZP2XBf/iGwQRtmvcaLiCGkCqtpTYe VBq9d2PIPNbuOSzY49MtR6XxEdNTgwUD3z7kou6Uk+AJBq+hmtNtcIozgI46m1ZyB4Hd 6XHA== 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=29Cc8iNRVO8G7DTd5+GqkXPX7Kx0cyS5m7DjP0Ag8Mc=; b=zJmoDNjKcC7PdeKrftn7O2K3miezNMwa3njCHIDXkUxFANP+w4zptu398lnf/NJeds TL3xxmgnf4GyDBHIFCcDw63Qm5yxA1oF7ciO/p+TzHWe6YDruZCj5Z5HOg9LN5a0hF7g GWnNJWK4N2GZyhZNXKM9sQrANsXaeV7OchBXC67TLhWVUk5VKVXE7G48j648HTyejIKr ovRu/dLWtergoq5Z4iiJKR8EnRmmrca0WA1kyOYF/o9+7iPqwkEbVb4ZCe9clKkG2bJQ xvfaWHvO+H4566pDVA2ZQQBxYKcvjpBhHPowVzzXIteNZxE/2jt0+OkeW7ggFq+nmuur ynUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vCNVuFix; 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 ec14si11112301ejb.320.2020.08.17.01.14.26; Mon, 17 Aug 2020 01:14:49 -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=vCNVuFix; 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 S1727833AbgHQILH (ORCPT + 99 others); Mon, 17 Aug 2020 04:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbgHQIK5 (ORCPT ); Mon, 17 Aug 2020 04:10:57 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1380C061388 for ; Mon, 17 Aug 2020 01:10:56 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id k18so7842978pfp.7 for ; Mon, 17 Aug 2020 01:10:56 -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=29Cc8iNRVO8G7DTd5+GqkXPX7Kx0cyS5m7DjP0Ag8Mc=; b=vCNVuFixVNNuPta5SWwJK9d836N/VbFNSDLfBVrJ+w7kEFV4M1HRgPNUepgKRBAI9r 76I/bxaGXC2mtUM/L5Vd4gs/MNuPEFoap605rvDEtJKjMAVfRlEP6Mydb+oWCaXvubnP 35/5l+nVtv21Mu3YfVXv2sAMBsufHBRv2NwnTCMcA58uf3F5aBIbsLG0JK9111705ahS C+oxNgzu76baSmk20w8WaujscxrfWbzSdvVfl3U6gP3jEbD4Z0fVygrOX3zwD3wuJMvF 4NBdiEIGBNFq0B6p7hWTA9M62hUaaq7rJTAfKdk3lt79uL0EGyju9EzTXxjmoqwOAsn/ G+Gg== 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=29Cc8iNRVO8G7DTd5+GqkXPX7Kx0cyS5m7DjP0Ag8Mc=; b=TmvKwiGb5icmAjZubzBYCiMZXw2napLtNIzvDvGugkErGFJz1qNYT/jCnZ+cPyxf7d 3C2URlgYHtBKIYavycXFGRhzg/eShUoOSWIs4hOtTQXFhOddMu0lPrlvYL0RG5v1o+iw ai8N0mi1Mn0WvzzzmtBFWXpoe4W1OB0PX7IWtaPlqOStsYdNJjeruyfwUcw9AcodPBuW /O5lYS4qPnWvoUeS+B0C96ZRR2RtaA7SX8RXgviRYm7+FBH/ScAj4itkpHMIY0zlIaV5 8ie4bEu4PAe4TyzUvmCQf2XARcp7iQWk1+s0iTBe0jqkb8q3gtcLrEacgVobXpKYt2wJ UQEg== X-Gm-Message-State: AOAM530D0wofVjI5Krby70tQJ/p8HVzAhcUul6EKzPLrFzzyQ+fNoy2T Bh7RhLnhAWj3RciMtt4IiJM= X-Received: by 2002:aa7:8751:: with SMTP id g17mr10333709pfo.109.1597651853965; Mon, 17 Aug 2020 01:10:53 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id 77sm18499751pfx.85.2020.08.17.01.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:10:53 -0700 (PDT) From: Allen Pais To: nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, heiko@sntech.de, matthias.bgg@gmail.com Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, inux-mediatek@lists.infradead.org, Allen Pais , Romain Perier Subject: [PATCH 11/19] crypto: mediatek: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:39:33 +0530 Message-Id: <20200817080941.19227-12-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817080941.19227-1-allen.lkml@gmail.com> References: <20200817080941.19227-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/crypto/mediatek/mtk-aes.c | 14 ++++++-------- drivers/crypto/mediatek/mtk-sha.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c index 4ad3571ab6af..5557359f105c 100644 --- a/drivers/crypto/mediatek/mtk-aes.c +++ b/drivers/crypto/mediatek/mtk-aes.c @@ -1089,16 +1089,16 @@ static struct aead_alg aes_gcm_alg = { }, }; -static void mtk_aes_queue_task(unsigned long data) +static void mtk_aes_queue_task(struct tasklet_struct *t) { - struct mtk_aes_rec *aes = (struct mtk_aes_rec *)data; + struct mtk_aes_rec *aes = from_tasklet(aes, t, queue_task); mtk_aes_handle_queue(aes->cryp, aes->id, NULL); } -static void mtk_aes_done_task(unsigned long data) +static void mtk_aes_done_task(struct tasklet_struct *t) { - struct mtk_aes_rec *aes = (struct mtk_aes_rec *)data; + struct mtk_aes_rec *aes = from_tasklet(aes, t, done_task); struct mtk_cryp *cryp = aes->cryp; mtk_aes_unmap(cryp, aes); @@ -1151,10 +1151,8 @@ static int mtk_aes_record_init(struct mtk_cryp *cryp) spin_lock_init(&aes[i]->lock); crypto_init_queue(&aes[i]->queue, AES_QUEUE_SIZE); - tasklet_init(&aes[i]->queue_task, mtk_aes_queue_task, - (unsigned long)aes[i]); - tasklet_init(&aes[i]->done_task, mtk_aes_done_task, - (unsigned long)aes[i]); + tasklet_setup(&aes[i]->queue_task, mtk_aes_queue_task); + tasklet_setup(&aes[i]->done_task, mtk_aes_done_task); } /* Link to ring0 and ring1 respectively */ diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c index da3f0b8814aa..ea0ae45cde93 100644 --- a/drivers/crypto/mediatek/mtk-sha.c +++ b/drivers/crypto/mediatek/mtk-sha.c @@ -1163,16 +1163,16 @@ static struct ahash_alg algs_sha384_sha512[] = { }, }; -static void mtk_sha_queue_task(unsigned long data) +static void mtk_sha_queue_task(struct tasklet_struct *t) { - struct mtk_sha_rec *sha = (struct mtk_sha_rec *)data; + struct mtk_sha_rec *sha = from_tasklet(sha, t, queue_task); mtk_sha_handle_queue(sha->cryp, sha->id - MTK_RING2, NULL); } -static void mtk_sha_done_task(unsigned long data) +static void mtk_sha_done_task(struct tasklet_struct *t) { - struct mtk_sha_rec *sha = (struct mtk_sha_rec *)data; + struct mtk_sha_rec *sha = from_tasklet(sha, t, done_task); struct mtk_cryp *cryp = sha->cryp; mtk_sha_unmap(cryp, sha); @@ -1218,10 +1218,8 @@ static int mtk_sha_record_init(struct mtk_cryp *cryp) spin_lock_init(&sha[i]->lock); crypto_init_queue(&sha[i]->queue, SHA_QUEUE_SIZE); - tasklet_init(&sha[i]->queue_task, mtk_sha_queue_task, - (unsigned long)sha[i]); - tasklet_init(&sha[i]->done_task, mtk_sha_done_task, - (unsigned long)sha[i]); + tasklet_setup(&sha[i]->queue_task, mtk_sha_queue_task); + tasklet_setup(&sha[i]->done_task, mtk_sha_done_task); } /* Link to ring2 and ring3 respectively */ -- 2.17.1