[1/5] crypto/nx: Rename nx842_powernv_function as icswx function
diff mbox

Message ID 1491065941.29552.26.camel@hbabu-laptop
State Changes Requested
Delegated to: Herbert Xu
Headers show

Commit Message

Haren Myneni April 1, 2017, 4:59 p.m. UTC
[PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function

nx842_powernv_function is points to nx842_icswx_function and
will be point to VAS function which will be added later for
P9 NX support.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
---
 drivers/crypto/nx/nx-842-powernv.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

Comments

Michael Ellerman April 4, 2017, 11:11 a.m. UTC | #1
Haren Myneni <haren@linux.vnet.ibm.com> writes:

> [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
>
> nx842_powernv_function is points to nx842_icswx_function and
> will be point to VAS function which will be added later for
> P9 NX support.

I know it's nit-picking but can you give it a better name while you're
there.

I was thinking it should be called "send" or something, but it actually
synchronously sends and waits for a request.

So perhaps just nx842_exec(), for "execute a request", and then you can
have nx842_exec_icswx() and nx842_exec_vas().

cheers
Haren Myneni April 5, 2017, 3:32 a.m. UTC | #2
On 04/04/2017 04:11 AM, Michael Ellerman wrote:
> Haren Myneni <haren@linux.vnet.ibm.com> writes:
> 
>> [PATCH 1/5] crypto/nx: Rename nx842_powernv_function as icswx function
>>
>> nx842_powernv_function is points to nx842_icswx_function and
>> will be point to VAS function which will be added later for
>> P9 NX support.
> 
> I know it's nit-picking but can you give it a better name while you're
> there.
> 
> I was thinking it should be called "send" or something, but it actually
> synchronously sends and waits for a request.
> 
> So perhaps just nx842_exec(), for "execute a request", and then you can
> have nx842_exec_icswx() and nx842_exec_vas().
> 
> cheers
> 

Michael, 

Thanks for review,

nx842_powernv_function() was used before, So just renamed similar to this name. But I will make changes in the next version.

Haren

Patch
diff mbox

diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c
index 3abb045..125f1dc 100644
--- a/drivers/crypto/nx/nx-842-powernv.c
+++ b/drivers/crypto/nx/nx-842-powernv.c
@@ -47,14 +47,22 @@  struct nx842_workmem {
 
 struct nx842_coproc {
 	unsigned int chip_id;
-	unsigned int ct;
-	unsigned int ci;
+	union {
+		struct {
+			unsigned int ct;
+			unsigned int ci;
+		} icswx;
+	};
 	struct list_head list;
 };
 
 /* no cpu hotplug on powernv, so this list never changes after init */
 static LIST_HEAD(nx842_coprocs);
-static unsigned int nx842_ct;
+static unsigned int nx842_ct;	/* use with icswx function */
+
+static int (*nx842_powernv_function)(const unsigned char *in,
+				unsigned int inlen, unsigned char *out,
+				unsigned int *outlenp, void *workmem, int fc);
 
 /**
  * setup_indirect_dde - Setup an indirect DDE
@@ -355,7 +363,7 @@  static int wait_for_csb(struct nx842_workmem *wmem,
 }
 
 /**
- * nx842_powernv_function - compress/decompress data using the 842 algorithm
+ * nx842_icswx_function - compress/decompress data using the 842 algorithm
  *
  * (De)compression provided by the NX842 coprocessor on IBM PowerNV systems.
  * This compresses or decompresses the provided input buffer into the provided
@@ -385,7 +393,7 @@  static int wait_for_csb(struct nx842_workmem *wmem,
  *   -ETIMEDOUT	hardware did not complete operation in reasonable time
  *   -EINTR	operation was aborted
  */
-static int nx842_powernv_function(const unsigned char *in, unsigned int inlen,
+static int nx842_icswx_function(const unsigned char *in, unsigned int inlen,
 				  unsigned char *out, unsigned int *outlenp,
 				  void *workmem, int fc)
 {
@@ -554,8 +562,8 @@  static int __init nx842_powernv_probe(struct device_node *dn)
 		return -ENOMEM;
 
 	coproc->chip_id = chip_id;
-	coproc->ct = ct;
-	coproc->ci = ci;
+	coproc->icswx.ct = ct;
+	coproc->icswx.ci = ci;
 	INIT_LIST_HEAD(&coproc->list);
 	list_add(&coproc->list, &nx842_coprocs);
 
@@ -625,6 +633,8 @@  static __init int nx842_powernv_init(void)
 	if (!nx842_ct)
 		return -ENODEV;
 
+	nx842_powernv_function = nx842_icswx_function;
+
 	ret = crypto_register_alg(&nx842_powernv_alg);
 	if (ret) {
 		struct nx842_coproc *coproc, *n;