mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: sep: Cleanup
@ 2012-06-29  4:19 Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 1/3] staging: sep: sep_crypto.c: Remove useless function crypto_sep_dump_message Marcos Paulo de Souza
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2012-06-29  4:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Marcos Paulo de Souza

Hi Kernel folks!

These patches makes a little cleanup in the sep module, removing some functions and macros.
These changes were just compile tested. So, if someone could review or test, I will be grateful!

Marcos Paulo de Souza (3):
  staging: sep: sep_crypto.c: Remove useless function crypto_sep_dump_message
  staging: sep: sep_crypto.c: Remove useless functions sep_dump and
    sep_dump_sg
  staging: sep: sep_driver_config.h: Remove unused macros

 drivers/staging/sep/sep_crypto.c        |  100 -------------------------------
 drivers/staging/sep/sep_driver_config.h |   65 --------------------
 2 files changed, 165 deletions(-)

-- 
1.7.10.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] staging: sep: sep_crypto.c: Remove useless function crypto_sep_dump_message
  2012-06-29  4:19 [PATCH 0/3] staging: sep: Cleanup Marcos Paulo de Souza
@ 2012-06-29  4:19 ` Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 2/3] staging: sep: sep_crypto.c: Remove useless functions sep_dump and sep_dump_sg Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 3/3] staging: sep: sep_driver_config.h: Remove unused macros Marcos Paulo de Souza
  2 siblings, 0 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2012-06-29  4:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Marcos Paulo de Souza, Greg Kroah-Hartman, devel

The function crypto_sep_dump_message don't have any use in this driver. So remove it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/staging/sep/sep_crypto.c |   23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/staging/sep/sep_crypto.c b/drivers/staging/sep/sep_crypto.c
index 1cc790e..e87b4fc 100644
--- a/drivers/staging/sep/sep_crypto.c
+++ b/drivers/staging/sep/sep_crypto.c
@@ -85,28 +85,6 @@ static void sep_dequeuer(void *data);
 
 /* TESTING */
 /**
- * crypto_sep_dump_message - dump the message that is pending
- * @sep: SEP device
- * This will only print dump if DEBUG is set; it does
- * follow kernel debug print enabling
- */
-static void crypto_sep_dump_message(struct sep_device *sep, void *msg)
-{
-#if 0
-	u32 *p;
-	u32 *i;
-	int count;
-
-	p = sep->shared_addr;
-	i = (u32 *)msg;
-	for (count = 0; count < 10 * 4; count += 4)
-		dev_dbg(&sep->pdev->dev,
-			"[PID%d] Word %d of the message is %x (local)%x\n",
-				current->pid, count/4, *p++, *i++);
-#endif
-}
-
-/**
  *	sep_do_callback
  *	@work: pointer to work_struct
  *	This is what is called by the queue; it is generic so that it
@@ -1646,7 +1624,6 @@ static u32 crypto_post_op(struct sep_device *sep)
 
 	dev_dbg(&ta_ctx->sep_used->pdev->dev, "crypto post_op\n");
 	dev_dbg(&ta_ctx->sep_used->pdev->dev, "crypto post_op message dump\n");
-	crypto_sep_dump_message(ta_ctx->sep_used, ta_ctx->msg);
 
 	/* first bring msg from shared area to local area */
 	memcpy(ta_ctx->msg, sep->shared_addr,
-- 
1.7.10.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] staging: sep: sep_crypto.c: Remove useless functions sep_dump and sep_dump_sg
  2012-06-29  4:19 [PATCH 0/3] staging: sep: Cleanup Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 1/3] staging: sep: sep_crypto.c: Remove useless function crypto_sep_dump_message Marcos Paulo de Souza
@ 2012-06-29  4:19 ` Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 3/3] staging: sep: sep_driver_config.h: Remove unused macros Marcos Paulo de Souza
  2 siblings, 0 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2012-06-29  4:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Marcos Paulo de Souza, Greg Kroah-Hartman, devel

These two functions only has commented code, so remove it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/staging/sep/sep_crypto.c |   77 --------------------------------------
 1 file changed, 77 deletions(-)

diff --git a/drivers/staging/sep/sep_crypto.c b/drivers/staging/sep/sep_crypto.c
index e87b4fc..4453bae 100644
--- a/drivers/staging/sep/sep_crypto.c
+++ b/drivers/staging/sep/sep_crypto.c
@@ -465,55 +465,6 @@ static int partial_overlap(void *src_ptr, void *dst_ptr, u32 nbytes)
 	return 0;
 }
 
-/* Debug - prints only if DEBUG is defined; follows kernel debug model */
-static void sep_dump(struct sep_device *sep, char *stg, void *start, int len)
-{
-#if 0
-	int ct1;
-	u8 *ptt;
-
-	dev_dbg(&sep->pdev->dev,
-		"Dump of %s starting at %08lx for %08x bytes\n",
-		stg, (unsigned long)start, len);
-	for (ct1 = 0; ct1 < len; ct1 += 1) {
-		ptt = (u8 *)(start + ct1);
-		dev_dbg(&sep->pdev->dev, "%02x ", *ptt);
-		if (ct1 % 16 == 15)
-			dev_dbg(&sep->pdev->dev, "\n");
-	}
-	dev_dbg(&sep->pdev->dev, "\n");
-#endif
-}
-
-/* Debug - prints only if DEBUG is defined; follows kernel debug model */
-static void sep_dump_sg(struct sep_device *sep, char *stg,
-			struct scatterlist *sg)
-{
-#if 0
-	int ct1, ct2;
-	u8 *ptt;
-
-	dev_dbg(&sep->pdev->dev, "Dump of scatterlist %s\n", stg);
-
-	ct1 = 0;
-	while (sg) {
-		dev_dbg(&sep->pdev->dev, "page %x\n size %x", ct1,
-			sg->length);
-		dev_dbg(&sep->pdev->dev, "phys addr is %lx",
-			(unsigned long)sg_phys(sg));
-		ptt = sg_virt(sg);
-		for (ct2 = 0; ct2 < sg->length; ct2 += 1) {
-			dev_dbg(&sep->pdev->dev, "byte %x is %02x\n",
-				ct2, (unsigned char)*(ptt + ct2));
-		}
-
-		ct1 += 1;
-		sg = sg_next(sg);
-	}
-	dev_dbg(&sep->pdev->dev, "\n");
-#endif
-}
-
 /* Debug - prints only if DEBUG is defined */
 static void sep_dump_ivs(struct ablkcipher_request *req, char *reason)
 
@@ -1216,9 +1167,6 @@ static int sep_crypto_block_data(struct ablkcipher_request *req)
 	/* Key already done; this is for data */
 	dev_dbg(&ta_ctx->sep_used->pdev->dev, "sending data\n");
 
-	sep_dump_sg(ta_ctx->sep_used,
-		"block sg in", ta_ctx->src_sg);
-
 	/* check for valid data and proper spacing */
 	src_ptr = sg_virt(ta_ctx->src_sg);
 	dst_ptr = sg_virt(ta_ctx->dst_sg);
@@ -1340,14 +1288,10 @@ static int sep_crypto_block_data(struct ablkcipher_request *req)
 		sep_write_context(ta_ctx, &msg_offset,
 			&sctx->des_private_ctx,
 			sizeof(struct sep_des_private_context));
-		sep_dump(ta_ctx->sep_used, "ctx to block des",
-			&sctx->des_private_ctx, 40);
 	} else {
 		sep_write_context(ta_ctx, &msg_offset,
 			&sctx->aes_private_ctx,
 			sizeof(struct sep_aes_private_context));
-		sep_dump(ta_ctx->sep_used, "ctx to block aes",
-			&sctx->aes_private_ctx, 20);
 	}
 
 	/* conclude message */
@@ -1404,8 +1348,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
 		}
 
 		memcpy(ta_ctx->iv, ta_ctx->walk.iv, SEP_DES_IV_SIZE_BYTES);
-		sep_dump(ta_ctx->sep_used, "iv",
-			ta_ctx->iv, SEP_DES_IV_SIZE_BYTES);
 	}
 
 	if ((ta_ctx->current_request == AES_CBC) &&
@@ -1416,8 +1358,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
 		}
 
 		memcpy(ta_ctx->iv, ta_ctx->walk.iv, SEP_AES_IV_SIZE_BYTES);
-		sep_dump(ta_ctx->sep_used, "iv",
-			ta_ctx->iv, SEP_AES_IV_SIZE_BYTES);
 	}
 
 	/* put together message to SEP */
@@ -1430,8 +1370,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
 			sep_write_msg(ta_ctx, ta_ctx->iv,
 				SEP_DES_IV_SIZE_BYTES, sizeof(u32) * 4,
 				&msg_offset, 1);
-			sep_dump(ta_ctx->sep_used, "initial IV",
-				ta_ctx->walk.iv, SEP_DES_IV_SIZE_BYTES);
 		} else {
 			/* Skip if ECB */
 			msg_offset += 4 * sizeof(u32);
@@ -1443,8 +1381,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
 			sep_write_msg(ta_ctx, ta_ctx->iv,
 				SEP_AES_IV_SIZE_BYTES, max_length,
 				&msg_offset, 1);
-			sep_dump(ta_ctx->sep_used, "initial IV",
-				ta_ctx->walk.iv, SEP_AES_IV_SIZE_BYTES);
 		} else {
 				/* Skip if ECB */
 				msg_offset += max_length;
@@ -1647,16 +1583,10 @@ static u32 crypto_post_op(struct sep_device *sep)
 			sep_read_context(ta_ctx, &msg_offset,
 			&sctx->des_private_ctx,
 			sizeof(struct sep_des_private_context));
-
-			sep_dump(ta_ctx->sep_used, "ctx init des",
-				&sctx->des_private_ctx, 40);
 		} else {
 			sep_read_context(ta_ctx, &msg_offset,
 			&sctx->aes_private_ctx,
 			sizeof(struct sep_aes_private_context));
-
-			sep_dump(ta_ctx->sep_used, "ctx init aes",
-				&sctx->aes_private_ctx, 20);
 		}
 
 		sep_dump_ivs(req, "after sending key to sep\n");
@@ -1735,9 +1665,6 @@ static u32 crypto_post_op(struct sep_device *sep)
 				sizeof(struct sep_aes_private_context));
 		}
 
-		sep_dump_sg(ta_ctx->sep_used,
-			"block sg out", ta_ctx->dst_sg);
-
 		/* Copy to correct sg if this block had oddball pages */
 		if (ta_ctx->dst_sg_hold)
 			sep_copy_sg(ta_ctx->sep_used,
@@ -2251,8 +2178,6 @@ static void sep_hash_update(void *data)
 		src_ptr = NULL;
 	}
 
-	sep_dump_sg(ta_ctx->sep_used, "hash block sg in", ta_ctx->src_sg);
-
 	ta_ctx->dcb_input_data.app_in_address = src_ptr;
 	ta_ctx->dcb_input_data.data_in_size =
 		req->nbytes - (head_len + tail_len);
@@ -2484,8 +2409,6 @@ static void sep_hash_digest(void *data)
 		src_ptr = NULL;
 	}
 
-	sep_dump_sg(ta_ctx->sep_used, "hash block sg in", ta_ctx->src_sg);
-
 	ta_ctx->dcb_input_data.app_in_address = src_ptr;
 	ta_ctx->dcb_input_data.data_in_size = req->nbytes - tail_len;
 	ta_ctx->dcb_input_data.app_out_address = NULL;
-- 
1.7.10.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] staging: sep: sep_driver_config.h: Remove unused macros
  2012-06-29  4:19 [PATCH 0/3] staging: sep: Cleanup Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 1/3] staging: sep: sep_crypto.c: Remove useless function crypto_sep_dump_message Marcos Paulo de Souza
  2012-06-29  4:19 ` [PATCH 2/3] staging: sep: sep_crypto.c: Remove useless functions sep_dump and sep_dump_sg Marcos Paulo de Souza
@ 2012-06-29  4:19 ` Marcos Paulo de Souza
  2 siblings, 0 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2012-06-29  4:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Marcos Paulo de Souza, Greg Kroah-Hartman, devel

All these macros are not used, so remove it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/staging/sep/sep_driver_config.h |   65 -------------------------------
 1 file changed, 65 deletions(-)

diff --git a/drivers/staging/sep/sep_driver_config.h b/drivers/staging/sep/sep_driver_config.h
index 9d9fc7c..499664f 100644
--- a/drivers/staging/sep/sep_driver_config.h
+++ b/drivers/staging/sep/sep_driver_config.h
@@ -38,17 +38,6 @@
   DRIVER CONFIGURATION FLAGS
   -------------------------------------*/
 
-/* if flag is on , then the driver is running in polling and
-	not interrupt mode */
-#define SEP_DRIVER_POLLING_MODE                         0
-
-/* flag which defines if the shared area address should be
-	reconfiged (send to SEP anew) during init of the driver */
-#define SEP_DRIVER_RECONFIG_MESSAGE_AREA                0
-
-/* the mode for running on the ARM1172 Evaluation platform (flag is 1) */
-#define SEP_DRIVER_ARM_DEBUG_MODE                       0
-
 /* Critical message area contents for sanity checking */
 #define SEP_START_MSG_TOKEN				0x02558808
 /*-------------------------------------------
@@ -67,18 +56,6 @@
 /* minimum data size of the MLLI table */
 #define SEP_DRIVER_MIN_DATA_SIZE_PER_TABLE		16
 
-/* flag that signifies tah the lock is
-currently held by the process (struct file) */
-#define SEP_DRIVER_OWN_LOCK_FLAG                        1
-
-/* flag that signifies tah the lock is currently NOT
-held by the process (struct file) */
-#define SEP_DRIVER_DISOWN_LOCK_FLAG                     0
-
-/* indicates whether driver has mapped/unmapped shared area */
-#define SEP_REQUEST_DAEMON_MAPPED 1
-#define SEP_REQUEST_DAEMON_UNMAPPED 0
-
 /*--------------------------------------------------------
 	SHARED AREA  memory total size is 36K
 	it is divided is following:
@@ -140,12 +117,6 @@ held by the process (struct file) */
 /* Offset of the sep printf buffer in the message area */
 #define SEP_DRIVER_PRINTF_OFFSET_IN_BYTES			(5888)
 
-/* the size in bytes of the time memory */
-#define SEP_DRIVER_TIME_MEMORY_SIZE_IN_BYTES			8
-
-/* the size in bytes of the RAR parameters memory */
-#define SEP_DRIVER_SYSTEM_RAR_MEMORY_SIZE_IN_BYTES		8
-
 /* area size that is mapped  - we map the MESSAGE AREA, STATIC POOL and
 	DATA POOL areas. area must be module 4k */
 #define SEP_DRIVER_MMMAP_AREA_SIZE				(1024 * 28)
@@ -154,9 +125,6 @@ held by the process (struct file) */
 	offsets of the areas starting from the shared area start address
 */
 
-/* message area offset */
-#define SEP_DRIVER_MESSAGE_AREA_OFFSET_IN_BYTES			0
-
 /* static pool area offset */
 #define SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES \
 	(SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES)
@@ -180,56 +148,23 @@ held by the process (struct file) */
 #define SEP_DRIVER_SYSTEM_TIME_MEMORY_OFFSET_IN_BYTES \
 	(SEP_DRIVER_SYSTEM_DATA_MEMORY_OFFSET_IN_BYTES)
 
-/* offset of the RAR area */
-#define SEP_DRIVER_SYSTEM_RAR_MEMORY_OFFSET_IN_BYTES \
-	(SEP_DRIVER_SYSTEM_TIME_MEMORY_OFFSET_IN_BYTES + \
-	SEP_DRIVER_TIME_MEMORY_SIZE_IN_BYTES)
-
-/* offset of the caller id area */
-#define SEP_CALLER_ID_OFFSET_BYTES \
-	(SEP_DRIVER_SYSTEM_RAR_MEMORY_OFFSET_IN_BYTES + \
-	SEP_DRIVER_SYSTEM_RAR_MEMORY_SIZE_IN_BYTES)
-
 /* offset of the DCB area */
 #define SEP_DRIVER_SYSTEM_DCB_MEMORY_OFFSET_IN_BYTES \
 	(SEP_DRIVER_SYSTEM_DATA_MEMORY_OFFSET_IN_BYTES + \
 	0x400)
 
-/* offset of the ext cache area */
-#define SEP_DRIVER_SYSTEM_EXT_CACHE_ADDR_OFFSET_IN_BYTES \
-	SEP_DRIVER_SYSTEM_RAR_MEMORY_OFFSET_IN_BYTES
-
-/* offset of the allocation data pointer area */
-#define SEP_DRIVER_DATA_POOL_ALLOCATION_OFFSET_IN_BYTES \
-	(SEP_CALLER_ID_OFFSET_BYTES + \
-	SEP_CALLER_ID_HASH_SIZE_IN_BYTES)
-
 /* the token that defines the start of time address */
 #define SEP_TIME_VAL_TOKEN                                    0x12345678
 
-#define FAKE_RAR_SIZE (1024*1024) /* used only for mfld */
 /* DEBUG LEVEL MASKS */
 
-/* size of the caller id hash (sha2) */
-#define SEP_CALLER_ID_HASH_SIZE_IN_BYTES                      32
-
 /* size of the caller id hash (sha2) in 32 bit words */
 #define SEP_CALLER_ID_HASH_SIZE_IN_WORDS                8
 
-/* maximum number of entries in the caller id table */
-#define SEP_CALLER_ID_TABLE_NUM_ENTRIES                       20
-
 /* maximum number of symetric operation (that require DMA resource)
 	per one message */
 #define SEP_MAX_NUM_SYNC_DMA_OPS			16
 
-/* the token that defines the start of time address */
-#define SEP_RAR_VAL_TOKEN                                     0xABABABAB
-
-/* ioctl error that should be returned when trying
-   to realloc the cache/resident second time */
-#define SEP_ALREADY_INITIALIZED_ERR                           12
-
 /* bit that locks access to the shared area */
 #define SEP_TRANSACTION_STARTED_LOCK_BIT                      0
 
-- 
1.7.10.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-29  4:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-29  4:19 [PATCH 0/3] staging: sep: Cleanup Marcos Paulo de Souza
2012-06-29  4:19 ` [PATCH 1/3] staging: sep: sep_crypto.c: Remove useless function crypto_sep_dump_message Marcos Paulo de Souza
2012-06-29  4:19 ` [PATCH 2/3] staging: sep: sep_crypto.c: Remove useless functions sep_dump and sep_dump_sg Marcos Paulo de Souza
2012-06-29  4:19 ` [PATCH 3/3] staging: sep: sep_driver_config.h: Remove unused macros Marcos Paulo de Souza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®