mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] s390/zcrypt: Convert use of __constant_cpu_to_le16 to cpu_to_le16
@ 2015-06-10 11:01 Vaishali Thakkar
  2015-06-15 13:33 ` Ingo Tuchscherer
  0 siblings, 1 reply; 2+ messages in thread
From: Vaishali Thakkar @ 2015-06-10 11:01 UTC (permalink / raw)
  To: Ingo Tuchscherer
  Cc: linux390, Martin Schwidefsky, Heiko Carstens, linux-s390,
	linux-kernel, Julia Lawall

In big endian cases, the macro cpu_to_le16 unfolds to __swab16
which provides special case for constants. In little endian cases,
__constant_cpu_to_le16 and cpu_to_le16 expand directly to the
same expression. So, replace __constant_cpu_to_le16 with
cpu_to_le16 with the goal of getting rid of the definition of
__constant_cpu_to_le16 completely.

The semantic patch that performs this transformation is as follows:

@@expression x;@@

- __constant_cpu_to_le16(x)
+ cpu_to_le16(x)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 drivers/s390/crypto/zcrypt_pcicc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_pcicc.c b/drivers/s390/crypto/zcrypt_pcicc.c
index 4d14c04..9f18876 100644
--- a/drivers/s390/crypto/zcrypt_pcicc.c
+++ b/drivers/s390/crypto/zcrypt_pcicc.c
@@ -98,11 +98,11 @@ static struct ap_driver zcrypt_pcicc_driver = {
  * - VUD block
  */
 static struct CPRB static_cprb = {
-	.cprb_len	= __constant_cpu_to_le16(0x0070),
+	.cprb_len	= cpu_to_le16(0x0070),
 	.cprb_ver_id	=  0x41,
 	.func_id	= {0x54,0x32},
 	.checkpoint_flag=  0x01,
-	.svr_namel	= __constant_cpu_to_le16(0x0008),
+	.svr_namel	= cpu_to_le16(0x0008),
 	.svr_name	= {'I','C','S','F',' ',' ',' ',' '}
 };
 
@@ -164,7 +164,7 @@ static int ICAMEX_msg_to_type6MEX_msg(struct zcrypt_device *zdev,
 	};
 	static struct function_and_rules_block static_pke_function_and_rules ={
 		.function_code	= {'P','K'},
-		.ulen		= __constant_cpu_to_le16(10),
+		.ulen		= cpu_to_le16(10),
 		.only_rule	= {'P','K','C','S','-','1','.','2'}
 	};
 	struct {
@@ -251,7 +251,7 @@ static int ICACRT_msg_to_type6CRT_msg(struct zcrypt_device *zdev,
 	};
 	static struct function_and_rules_block static_pkd_function_and_rules ={
 		.function_code	= {'P','D'},
-		.ulen		= __constant_cpu_to_le16(10),
+		.ulen		= cpu_to_le16(10),
 		.only_rule	= {'P','K','C','S','-','1','.','2'}
 	};
 	struct {
-- 
1.9.1


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

* Re: [PATCH] s390/zcrypt: Convert use of __constant_cpu_to_le16 to cpu_to_le16
  2015-06-10 11:01 [PATCH] s390/zcrypt: Convert use of __constant_cpu_to_le16 to cpu_to_le16 Vaishali Thakkar
@ 2015-06-15 13:33 ` Ingo Tuchscherer
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Tuchscherer @ 2015-06-15 13:33 UTC (permalink / raw)
  To: Vaishali Thakkar
  Cc: BOEBLINGEN LINUX390, heicars2, Julia Lawall, linux-kernel,
	linux-s390, mschwid2

[-- Attachment #1: Type: text/plain, Size: 5697 bytes --]


Thanks for bringing up.
I pushed the patch into our internal repository, it will be upstream soon.

Mit freundlichen Grüßen / Kind regards

Ingo Tuchscherer

Software Development - Linux on z Systems
IBM Systems &Technology Group
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       
 Phone:            +49-7031-16-1986                 IBM Deutschland                          (Embedded
                                                                                           image moved
                                                                                              to file:
                                                                                         pic03543.gif)
                                                                       
 E-Mail:           ingo.tuchscherer@de.ibm.com      Schoenaicher Str. 220
                                                                       
                                                    71032 Boeblingen   
                                                                       
                                                    Germany            
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       
 IBM Deutschland                                                       
 Research &                                                            
 Development                                                           
 GmbH /                                                                
 Vorsitzender des                                                      
 Aufsichtsrats:                                                        
 Martina Koederitz                                                     
                                                                       
 Geschäftsführung:                                                 
 Dirk Wittkopp                                                         
 Sitz der                                                              
 Gesellschaft:                                                         
 Böblingen /                                                         
 Registergericht:                                                      
 Amtsgericht                                                           
 Stuttgart, HRB                                                        
 243294                                                                
                                                                       





From:	Vaishali Thakkar <vthakkar1994@gmail.com>
To:	Ingo Tuchscherer/Germany/IBM@IBMDE
Cc:	BOEBLINGEN LINUX390/Germany/IBM@IBMDE,
            mschwid2@linux.vnet.ibm.com, heicars2@linux.vnet.ibm.com,
            linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Julia
            Lawall <julia.lawall@lip6.fr>
Date:	06/10/2015 01:01 PM
Subject:	[PATCH] s390/zcrypt: Convert use of __constant_cpu_to_le16 to
            cpu_to_le16



In big endian cases, the macro cpu_to_le16 unfolds to __swab16
which provides special case for constants. In little endian cases,
__constant_cpu_to_le16 and cpu_to_le16 expand directly to the
same expression. So, replace __constant_cpu_to_le16 with
cpu_to_le16 with the goal of getting rid of the definition of
__constant_cpu_to_le16 completely.

The semantic patch that performs this transformation is as follows:

@@expression x;@@

- __constant_cpu_to_le16(x)
+ cpu_to_le16(x)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
 drivers/s390/crypto/zcrypt_pcicc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/crypto/zcrypt_pcicc.c
b/drivers/s390/crypto/zcrypt_pcicc.c
index 4d14c04..9f18876 100644
--- a/drivers/s390/crypto/zcrypt_pcicc.c
+++ b/drivers/s390/crypto/zcrypt_pcicc.c
@@ -98,11 +98,11 @@ static struct ap_driver zcrypt_pcicc_driver = {
  * - VUD block
  */
 static struct CPRB static_cprb = {
-		 .cprb_len		 = __constant_cpu_to_le16(0x0070),
+		 .cprb_len		 = cpu_to_le16(0x0070),
 		 .cprb_ver_id		 =  0x41,
 		 .func_id		 = {0x54,0x32},
 		 .checkpoint_flag=  0x01,
-		 .svr_namel		 = __constant_cpu_to_le16(0x0008),
+		 .svr_namel		 = cpu_to_le16(0x0008),
 		 .svr_name		 = {'I','C','S','F',' ',' ',' ',' '}
 };

@@ -164,7 +164,7 @@ static int ICAMEX_msg_to_type6MEX_msg(struct
zcrypt_device *zdev,
 		 };
 		 static struct function_and_rules_block
static_pke_function_and_rules ={
 		 		 .function_code		 = {'P','K'},
-		 		 .ulen		 		 =
__constant_cpu_to_le16(10),
+		 		 .ulen		 		 = cpu_to_le16(10),
 		 		 .only_rule		 =
{'P','K','C','S','-','1','.','2'}
 		 };
 		 struct {
@@ -251,7 +251,7 @@ static int ICACRT_msg_to_type6CRT_msg(struct
zcrypt_device *zdev,
 		 };
 		 static struct function_and_rules_block
static_pkd_function_and_rules ={
 		 		 .function_code		 = {'P','D'},
-		 		 .ulen		 		 =
__constant_cpu_to_le16(10),
+		 		 .ulen		 		 = cpu_to_le16(10),
 		 		 .only_rule		 =
{'P','K','C','S','-','1','.','2'}
 		 };
 		 struct {
--
1.9.1


[-- Attachment #2: pic03543.gif --]
[-- Type: image/gif, Size: 1851 bytes --]

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

end of thread, other threads:[~2015-06-15 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 11:01 [PATCH] s390/zcrypt: Convert use of __constant_cpu_to_le16 to cpu_to_le16 Vaishali Thakkar
2015-06-15 13:33 ` Ingo Tuchscherer

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®