[PATCH v2 15/30] crypto: sa2ul - remove unused SC ID range tracking
From: Manorit Chawdhry
Date: Wed Nov 04 2026 - 00:46:47 EST
Remove unused sc_id_start and sc_id_end fields from sa_dev_data.
These were intended for security context ID management but were
never used in the driver.
Signed-off-by: Manorit Chawdhry <m-chawdhry@xxxxxx>
---
drivers/crypto/sa2ul.c | 4 ++--
drivers/crypto/sa2ul.h | 4 ----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 30ddefd4c0b5..022a95e40698 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -690,7 +690,7 @@ static void sa_free_ctx_info(struct sa_ctx_info *ctx,
{
unsigned long bn;
- bn = ctx->sc_id - data->sc_id_start;
+ bn = ctx->sc_id;
spin_lock(&data->scid_lock);
__clear_bit(bn, data->ctx_bm);
data->sc_id--;
@@ -715,7 +715,7 @@ static int sa_init_ctx_info(struct sa_ctx_info *ctx,
data->sc_id++;
spin_unlock(&data->scid_lock);
- ctx->sc_id = (u16)(data->sc_id_start + bn);
+ ctx->sc_id = (u16)bn;
ctx->sc = dma_pool_alloc(data->sc_pool, GFP_KERNEL, &ctx->sc_phys);
if (!ctx->sc) {
diff --git a/drivers/crypto/sa2ul.h b/drivers/crypto/sa2ul.h
index a717c5bcf061..0788d68bc30b 100644
--- a/drivers/crypto/sa2ul.h
+++ b/drivers/crypto/sa2ul.h
@@ -180,8 +180,6 @@ struct sa_match_data;
* @sc_pool: security context pool
* @dev: Device pointer
* @scid_lock: secure context ID lock
- * @sc_id_start: starting index for SC ID
- * @sc_id_end: Ending index for SC ID
* @sc_id: Security Context ID
* @ctx_bm: Bitmap to keep track of Security context ID's
* @dma_rx1: Pointer to DMA rx channel for sizes < 256 Bytes
@@ -195,8 +193,6 @@ struct sa_crypto_data {
struct device *dev;
spinlock_t scid_lock; /* lock for SC-ID allocation */
/* Security context data */
- u16 sc_id_start;
- u16 sc_id_end;
u16 sc_id;
unsigned long ctx_bm[DIV_ROUND_UP(SA_MAX_NUM_CTX,
BITS_PER_LONG)];
--
2.43.0