linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility
@ 2015-04-17 14:24 Christophe Leroy
  2015-04-17 15:14 ` David Laight
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2015-04-17 14:24 UTC (permalink / raw)
  To: Kim Phillips, Herbert Xu, David S Miller
  Cc: linuxppc-dev, linux-kernel, linux-crypto

Linux CodyingStyle recommends to use short variables for local
variables. ptr is just good enough for those 3 lines functions.
It helps keep single lines shorter than 80 characters.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 drivers/crypto/talitos.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 5a7e345..fca0aed 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -55,37 +55,37 @@
 
 #include "talitos.h"
 
-static void to_talitos_ptr(struct talitos_ptr *talitos_ptr, dma_addr_t dma_addr)
+static void to_talitos_ptr(struct talitos_ptr *ptr, dma_addr_t dma_addr)
 {
-	talitos_ptr->ptr = cpu_to_be32(lower_32_bits(dma_addr));
-	talitos_ptr->eptr = upper_32_bits(dma_addr);
+	ptr->ptr = cpu_to_be32(lower_32_bits(dma_addr));
+	ptr->eptr = upper_32_bits(dma_addr);
 }
 
 /*
  * map virtual single (contiguous) pointer to h/w descriptor pointer
  */
 static void map_single_talitos_ptr(struct device *dev,
-				   struct talitos_ptr *talitos_ptr,
+				   struct talitos_ptr *ptr,
 				   unsigned short len, void *data,
 				   unsigned char extent,
 				   enum dma_data_direction dir)
 {
 	dma_addr_t dma_addr = dma_map_single(dev, data, len, dir);
 
-	talitos_ptr->len = cpu_to_be16(len);
-	to_talitos_ptr(talitos_ptr, dma_addr);
-	talitos_ptr->j_extent = extent;
+	ptr->len = cpu_to_be16(len);
+	to_talitos_ptr(ptr, dma_addr);
+	ptr->j_extent = extent;
 }
 
 /*
  * unmap bus single (contiguous) h/w descriptor pointer
  */
 static void unmap_single_talitos_ptr(struct device *dev,
-				     struct talitos_ptr *talitos_ptr,
+				     struct talitos_ptr *ptr,
 				     enum dma_data_direction dir)
 {
-	dma_unmap_single(dev, be32_to_cpu(talitos_ptr->ptr),
-			 be16_to_cpu(talitos_ptr->len), dir);
+	dma_unmap_single(dev, be32_to_cpu(ptr->ptr),
+			 be16_to_cpu(ptr->len), dir);
 }
 
 static int reset_channel(struct device *dev, int ch)
-- 
2.1.0

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

* RE: [PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility
  2015-04-17 14:24 [PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility Christophe Leroy
@ 2015-04-17 15:14 ` David Laight
  2015-04-17 16:25   ` leroy christophe
  0 siblings, 1 reply; 4+ messages in thread
From: David Laight @ 2015-04-17 15:14 UTC (permalink / raw)
  To: 'Christophe Leroy', Kim Phillips, Herbert Xu, David S Miller
  Cc: linuxppc-dev, linux-kernel, linux-crypto

RnJvbTogQ2hyaXN0b3BoZSBMZXJveQ0KPiBMaW51eCBDb2R5aW5nU3R5bGUgcmVjb21tZW5kcyB0
byB1c2Ugc2hvcnQgdmFyaWFibGVzIGZvciBsb2NhbA0KPiB2YXJpYWJsZXMuIHB0ciBpcyBqdXN0
IGdvb2QgZW5vdWdoIGZvciB0aG9zZSAzIGxpbmVzIGZ1bmN0aW9ucy4NCj4gSXQgaGVscHMga2Vl
cCBzaW5nbGUgbGluZXMgc2hvcnRlciB0aGFuIDgwIGNoYXJhY3RlcnMuDQouLi4NCj4gLXN0YXRp
YyB2b2lkIHRvX3RhbGl0b3NfcHRyKHN0cnVjdCB0YWxpdG9zX3B0ciAqdGFsaXRvc19wdHIsIGRt
YV9hZGRyX3QgZG1hX2FkZHIpDQo+ICtzdGF0aWMgdm9pZCB0b190YWxpdG9zX3B0cihzdHJ1Y3Qg
dGFsaXRvc19wdHIgKnB0ciwgZG1hX2FkZHJfdCBkbWFfYWRkcikNCj4gIHsNCj4gLQl0YWxpdG9z
X3B0ci0+cHRyID0gY3B1X3RvX2JlMzIobG93ZXJfMzJfYml0cyhkbWFfYWRkcikpOw0KPiAtCXRh
bGl0b3NfcHRyLT5lcHRyID0gdXBwZXJfMzJfYml0cyhkbWFfYWRkcik7DQo+ICsJcHRyLT5wdHIg
PSBjcHVfdG9fYmUzMihsb3dlcl8zMl9iaXRzKGRtYV9hZGRyKSk7DQo+ICsJcHRyLT5lcHRyID0g
dXBwZXJfMzJfYml0cyhkbWFfYWRkcik7DQo+ICB9DQouLi4NCg0KTWF5YmUsIGJ1dCAncHRyJyBp
c24ndCBhIGdvb2QgY2hvaWNlLg0KDQoJRGF2aWQNCg0K

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

* Re: [PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility
  2015-04-17 15:14 ` David Laight
@ 2015-04-17 16:25   ` leroy christophe
  0 siblings, 0 replies; 4+ messages in thread
From: leroy christophe @ 2015-04-17 16:25 UTC (permalink / raw)
  To: David Laight, Kim Phillips, Herbert Xu, David S Miller
  Cc: linuxppc-dev, linux-kernel, linux-crypto

Le 17/04/2015 17:14, David Laight a écrit :
> From: Christophe Leroy
>> Linux CodyingStyle recommends to use short variables for local
>> variables. ptr is just good enough for those 3 lines functions.
>> It helps keep single lines shorter than 80 characters.
> ...
>> -static void to_talitos_ptr(struct talitos_ptr *talitos_ptr, dma_addr_t dma_addr)
>> +static void to_talitos_ptr(struct talitos_ptr *ptr, dma_addr_t dma_addr)
>>   {
>> -	talitos_ptr->ptr = cpu_to_be32(lower_32_bits(dma_addr));
>> -	talitos_ptr->eptr = upper_32_bits(dma_addr);
>> +	ptr->ptr = cpu_to_be32(lower_32_bits(dma_addr));
>> +	ptr->eptr = upper_32_bits(dma_addr);
>>   }
> ...
>
> Maybe, but 'ptr' isn't a good choice.
>
>
Any suggestion ?

Christophe

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

* [PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility
@ 2015-04-17 14:31 Christophe Leroy
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2015-04-17 14:31 UTC (permalink / raw)
  To: Kim Phillips, Herbert Xu, David S Miller
  Cc: linuxppc-dev, linux-kernel, linux-crypto

Linux CodyingStyle recommends to use short variables for local
variables. ptr is just good enough for those 3 lines functions.
It helps keep single lines shorter than 80 characters.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 drivers/crypto/talitos.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 5a7e345..fca0aed 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -55,37 +55,37 @@
 
 #include "talitos.h"
 
-static void to_talitos_ptr(struct talitos_ptr *talitos_ptr, dma_addr_t dma_addr)
+static void to_talitos_ptr(struct talitos_ptr *ptr, dma_addr_t dma_addr)
 {
-	talitos_ptr->ptr = cpu_to_be32(lower_32_bits(dma_addr));
-	talitos_ptr->eptr = upper_32_bits(dma_addr);
+	ptr->ptr = cpu_to_be32(lower_32_bits(dma_addr));
+	ptr->eptr = upper_32_bits(dma_addr);
 }
 
 /*
  * map virtual single (contiguous) pointer to h/w descriptor pointer
  */
 static void map_single_talitos_ptr(struct device *dev,
-				   struct talitos_ptr *talitos_ptr,
+				   struct talitos_ptr *ptr,
 				   unsigned short len, void *data,
 				   unsigned char extent,
 				   enum dma_data_direction dir)
 {
 	dma_addr_t dma_addr = dma_map_single(dev, data, len, dir);
 
-	talitos_ptr->len = cpu_to_be16(len);
-	to_talitos_ptr(talitos_ptr, dma_addr);
-	talitos_ptr->j_extent = extent;
+	ptr->len = cpu_to_be16(len);
+	to_talitos_ptr(ptr, dma_addr);
+	ptr->j_extent = extent;
 }
 
 /*
  * unmap bus single (contiguous) h/w descriptor pointer
  */
 static void unmap_single_talitos_ptr(struct device *dev,
-				     struct talitos_ptr *talitos_ptr,
+				     struct talitos_ptr *ptr,
 				     enum dma_data_direction dir)
 {
-	dma_unmap_single(dev, be32_to_cpu(talitos_ptr->ptr),
-			 be16_to_cpu(talitos_ptr->len), dir);
+	dma_unmap_single(dev, be32_to_cpu(ptr->ptr),
+			 be16_to_cpu(ptr->len), dir);
 }
 
 static int reset_channel(struct device *dev, int ch)
-- 
2.1.0

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

end of thread, other threads:[~2015-04-17 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-17 14:24 [PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility Christophe Leroy
2015-04-17 15:14 ` David Laight
2015-04-17 16:25   ` leroy christophe
2015-04-17 14:31 Christophe Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).