From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9E96319859 for ; Thu, 9 Jul 2026 19:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783625409; cv=none; b=ShdNwnSxAbE5+86cIGijzrC2dOtyqUZxHCbQp0zm7a0B7oMeUzytpFga9O0JUfBUH05Y66azzWH830KLzi2O7BkdNzOZo3b1FZ8a6XgK9BuFK+JQtGFjWHy5BgRNwwSTMv4xdwl4+hi1VPGlGvjBnJRA1/UkEGG3SnWofJC66zU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783625409; c=relaxed/simple; bh=UhcV2HdpQ+a1WeL2yh6GXWRx4nW2TmUkpOWjjAelJEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pG0kCu0thcMfa3biIctsoUzvt85+x5rI6rqarWtX70OP/lj59CvV7wpFi+0eBTIoULeI4eUlK9OXMF23pE0bw35K32GfrXqHlfMS4EvdN7vtRBc9JWGJSPF3sWqTwRQrSAUGYpQgLvJ1P7FTroeyLtdvXq1anoxRcaOvlamgiZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cjMkh9dj; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cjMkh9dj" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-475881b9a4bso215910f8f.3 for ; Thu, 09 Jul 2026 12:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783625406; x=1784230206; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nw29HGfKQpelf6EJNW+UfbygqyH8IA9037buMtMPBXs=; b=cjMkh9dj3IjhjmDD1koRYWSXo0DimTM8ZBQHihuGV1uIATvfYBn8AORLBsUfqsKWPD zhvlmmOlCJLcn5DcjpD+hnK0CgUQ+9kOZDqTrn8PFW6nC0UTwuraA698SEIsTl/bRvO5 cVW22oifQjaFjOUGByCey0FE848bmA7vcQS5Y7CTOAlCVNt5NwBLP/0yW9QsDdlL0F/3 8AaQR5aPrI4l2Kc+WkuT56J2k9nYPeB1FJ1A0wxq4C7uKcwYQR6w1yMfaXqNHAZZCDMd OoA94881rGDFxwYuRJrWuxRpZjK3ZM6KJODGVmXOETwNxNb5J7uqgr/Pibkbc9APVAUz 2Lnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783625406; x=1784230206; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=nw29HGfKQpelf6EJNW+UfbygqyH8IA9037buMtMPBXs=; b=aLSJO8Gt2M56gUs/XLrevOj5e2pYyv2z6/Vqh5LQDvsCz+rVElOdrFXIJkPvPBLvuO vsXvaJNxedJuXWmtIleESI1dny6XQwoouKA+SFrTT3xHSIts6+wMdDv171gDNogNTOg2 w7nA1r14MOG+kAeXOPIDNa15YruLrI/TDlyuJ+gFHs7jrWOt4tuwDu0WFBeG655Td/JD dDIVXdgR33WPcChpA+4PxMtvwHMdHL63daMd0mB4k5+XyGb86Owkum2dlHykbiYul2Gs 1oS2HaBJQQkNQYdUQyzWZphGT7RM5KbJ1c8HkIxCb2HMXASlvAU51+ZZoqa+G7eF0zie i4SQ== X-Forwarded-Encrypted: i=1; AHgh+RoBKObke8q30vXJ0sxh9gwTAHny81wz24UIoOFvf+VLn7xC+ErrkbO7+rm/IL+Af9+v1dHHP7JyLyVB4ME=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0kYc98b30QoLXQWC5zvD0SGtqlkkOY0KLETtNfgOH5w+ZIvmd jy0ocsZaaQxheMe7lqY1MfSj+tDtFKg8XF3aRVLvdvRaQ0XoklzWErSc X-Gm-Gg: AfdE7cntVKd4HiuuMbkY1j0tZJJY9rp9DOwrijrpy1vdsAJe4tHkGPA5p5+LKJM1PnM 68rq4N0v9UcxIX7tyg+g8xv6X0W6yOXUemobfPfYjLQckZHgZvJnm46RdUt+98CdJ6QuuLxGr4A Pja1y2i9qVg6yEE539WdjBCx4pv46KkrrweZBdCUk/3EyyK71cOo/3hRqbya1157thHOtoFOxEW F3s/jOY5d00AMFthM7jKOuQIE2LuIg6qmpI20Fo1lrjb9Pv/321Pzixu2x9O/8yvbQCKXMQj1Ea ci0ex6Z+iCRF3YSWy4FhRywwnco1IR9L/dT4sBEDYSBzAHCYuenYHTfM6+RJqq83UvJnIyNH219 NcF37i8A+x+/ixEgOgJb4YsmjIClAlD5dmk2FYHnHYQLtzQt2UXnw2RBBgECN45uUI/+p/t153h COeFQQHHauj0/Rh0gZstB2bJTC X-Received: by 2002:a05:6000:711:b0:474:2929:474c with SMTP id ffacd0b85a97d-47df075c5fbmr8524397f8f.36.1783625406070; Thu, 09 Jul 2026 12:30:06 -0700 (PDT) Received: from mini.main.internal ([2a02:908:c211:cd18:d9f3:ab2b:ac6e:fc84]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9de1e6ccsm53873509f8f.5.2026.07.09.12.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 12:30:05 -0700 (PDT) From: Goetz Goerisch To: gregkh@linuxfoundation.org Cc: ggoerisch@gmail.com, herbert@gondor.apana.org.au, herve.codina@bootlin.com, linux-crypto@vger.kernel.org, miquel.raynal@bootlin.com, paul.louvel@bootlin.com, sashal@kernel.org, stable@vger.kernel.org, thomas.petazzoni@bootlin.com Subject: [PATCH 5/5] crypto: talitos - rename first/last to first_desc/last_desc Date: Thu, 9 Jul 2026 21:28:26 +0200 Message-ID: <20260709192826.12699-6-ggoerisch@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260709192826.12699-1-ggoerisch@gmail.com> References: <2026070912-pluck-bagful-2a71@gregkh> <20260709192826.12699-1-ggoerisch@gmail.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Paul Louvel commit a1b80018b8cec27fc06a8b04a7f8b5f6cfe86eae upstream. Previous commit introduces a new last_request variable in the context structure. Renaming the first/last existing member variable in the context structure to improve readability. Cc: stable@vger.kernel.org Signed-off-by: Paul Louvel Signed-off-by: Herbert Xu --- drivers/crypto/talitos.c | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index ea6ae72c71ad..fb1adc2956b8 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -869,8 +869,8 @@ struct talitos_ahash_req_ctx { u8 buf[2][HASH_MAX_BLOCK_SIZE]; int buf_idx; unsigned int swinit; - unsigned int first; - unsigned int last; + unsigned int first_desc; + unsigned int last_desc; unsigned int last_request; unsigned int to_hash_later; unsigned int nbuf; @@ -889,8 +889,8 @@ struct talitos_export_state { u32 hw_context[TALITOS_MDEU_MAX_CONTEXT_SIZE / sizeof(u32)]; u8 buf[HASH_MAX_BLOCK_SIZE]; unsigned int swinit; - unsigned int first; - unsigned int last; + unsigned int first_desc; + unsigned int last_desc; unsigned int to_hash_later; unsigned int nbuf; }; @@ -1722,7 +1722,7 @@ static void common_nonsnoop_hash_unmap(struct device *dev, if (desc->next_desc && desc->ptr[5].ptr != desc2->ptr[5].ptr) unmap_single_talitos_ptr(dev, &desc2->ptr[5], DMA_FROM_DEVICE); - if (req_ctx->last) + if (req_ctx->last_desc) memcpy(areq->result, req_ctx->hw_context, crypto_ahash_digestsize(tfm)); @@ -1759,7 +1759,7 @@ static void ahash_done(struct device *dev, container_of(desc, struct talitos_edesc, desc); struct talitos_ahash_req_ctx *req_ctx = ahash_request_ctx(areq); - if (!req_ctx->last && req_ctx->to_hash_later) { + if (!req_ctx->last_desc && req_ctx->to_hash_later) { /* Position any partial block for next update/final/finup */ req_ctx->buf_idx = (req_ctx->buf_idx + 1) & 1; req_ctx->nbuf = req_ctx->to_hash_later; @@ -1825,7 +1825,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, /* first DWORD empty */ /* hash context in */ - if (!req_ctx->first || req_ctx->swinit) { + if (!req_ctx->first_desc || req_ctx->swinit) { map_single_talitos_ptr_nosync(dev, &desc->ptr[1], req_ctx->hw_context_size, req_ctx->hw_context, @@ -1833,7 +1833,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, req_ctx->swinit = 0; } /* Indicate next op is not the first. */ - req_ctx->first = 0; + req_ctx->first_desc = 0; /* HMAC key */ if (ctx->keylen) @@ -1866,7 +1866,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, /* fifth DWORD empty */ /* hash/HMAC out -or- hash context out */ - if (req_ctx->last) + if (req_ctx->last_desc) map_single_talitos_ptr(dev, &desc->ptr[5], crypto_ahash_digestsize(tfm), req_ctx->hw_context, DMA_FROM_DEVICE); @@ -1908,7 +1908,7 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, if (sg_count > 1) sync_needed = true; copy_talitos_ptr(&desc2->ptr[5], &desc->ptr[5], is_sec1); - if (req_ctx->last) + if (req_ctx->last_desc) map_single_talitos_ptr_nosync(dev, &desc->ptr[5], req_ctx->hw_context_size, req_ctx->hw_context, @@ -1964,7 +1964,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes bool is_sec1 = has_ftr_sec1(priv); u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx]; - if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) { + if (!req_ctx->last_desc && (nbytes + req_ctx->nbuf <= blocksize)) { /* Buffer up to one whole block */ nents = sg_nents_for_len(req_ctx->request_sl, nbytes); if (nents < 0) { @@ -1981,7 +1981,7 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes nbytes_to_hash = nbytes + req_ctx->nbuf; to_hash_later = nbytes_to_hash & (blocksize - 1); - if (req_ctx->last) + if (req_ctx->last_desc) to_hash_later = 0; else if (to_hash_later) /* There is a partial block. Hash the full block(s) now */ @@ -2041,19 +2041,19 @@ static int ahash_process_req_one(struct ahash_request *areq, unsigned int nbytes edesc->desc.hdr = ctx->desc_hdr_template; /* On last one, request SEC to pad; otherwise continue */ - if (req_ctx->last) + if (req_ctx->last_desc) edesc->desc.hdr |= DESC_HDR_MODE0_MDEU_PAD; else edesc->desc.hdr |= DESC_HDR_MODE0_MDEU_CONT; /* request SEC to INIT hash. */ - if (req_ctx->first && !req_ctx->swinit) + if (req_ctx->first_desc && !req_ctx->swinit) edesc->desc.hdr |= DESC_HDR_MODE0_MDEU_INIT; /* When the tfm context has a keylen, it's an HMAC. * A first or last (ie. not middle) descriptor must request HMAC. */ - if (ctx->keylen && (req_ctx->first || req_ctx->last)) + if (ctx->keylen && (req_ctx->first_desc || req_ctx->last_desc)) edesc->desc.hdr |= DESC_HDR_MODE0_MDEU_HMAC; return common_nonsnoop_hash(edesc, req_ctx->areq, nbytes_to_hash, ahash_done); @@ -2076,7 +2076,7 @@ static void sec1_ahash_process_remaining(struct work_struct *work) req_ctx->remaining_ahash_request_bytes; if (req_ctx->last_request) - req_ctx->last = 1; + req_ctx->last_desc = 1; } err = ahash_process_req_one(req_ctx->areq, @@ -2103,7 +2103,7 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes) if (nbytes > TALITOS1_MAX_DATA_LEN) nbytes = TALITOS1_MAX_DATA_LEN; else if (req_ctx->last_request) - req_ctx->last = 1; + req_ctx->last_desc = 1; } req_ctx->current_ahash_request_bytes = nbytes; @@ -2124,14 +2124,14 @@ static int ahash_init(struct ahash_request *areq) /* Initialize the context */ req_ctx->buf_idx = 0; req_ctx->nbuf = 0; - req_ctx->first = 1; /* first indicates h/w must init its context */ + req_ctx->first_desc = 1; /* first_desc indicates h/w must init its context */ req_ctx->swinit = 0; /* assume h/w init of context */ size = (crypto_ahash_digestsize(tfm) <= SHA256_DIGEST_SIZE) ? TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 : TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512; req_ctx->hw_context_size = size; req_ctx->last_request = 0; - req_ctx->last = 0; + req_ctx->last_desc = 0; INIT_WORK(&req_ctx->sec1_ahash_process_remaining, sec1_ahash_process_remaining); dma = dma_map_single(dev, req_ctx->hw_context, req_ctx->hw_context_size, @@ -2224,8 +2224,8 @@ static int ahash_export(struct ahash_request *areq, void *out) req_ctx->hw_context_size); memcpy(export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf); export->swinit = req_ctx->swinit; - export->first = req_ctx->first; - export->last = req_ctx->last; + export->first_desc = req_ctx->first_desc; + export->last_desc = req_ctx->last_desc; export->to_hash_later = req_ctx->to_hash_later; export->nbuf = req_ctx->nbuf; @@ -2250,8 +2250,8 @@ static int ahash_import(struct ahash_request *areq, const void *in) memcpy(req_ctx->hw_context, export->hw_context, size); memcpy(req_ctx->buf[0], export->buf, export->nbuf); req_ctx->swinit = export->swinit; - req_ctx->first = export->first; - req_ctx->last = export->last; + req_ctx->first_desc = export->first_desc; + req_ctx->last_desc = export->last_desc; req_ctx->to_hash_later = export->to_hash_later; req_ctx->nbuf = export->nbuf; -- 2.54.0