Commit dc071ca1 authored by leoliu-oc's avatar leoliu-oc
Browse files

crypto: sm4: fix the build warning issue of sm4 driver

zhaoxin inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I90GKP


CVE: NA

-----------------

Adjusted some code details to avoid warning messages during the build
process of the driver.

Signed-off-by: default avatarleoliu-oc <leoliu-oc@zhaoxin.com>
parent dea3a65a
Loading
Loading
Loading
Loading
+20 −21
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ struct sm4_cipher_data {
	struct sm4_ctx  keys;  /* Encryption key */
};


static u8 *rep_xcrypt(const u8 *input, u8 *output, void *key, u8 *iv,
							struct sm4_cipher_data *sm4_data, u64 count)
{
@@ -63,31 +62,31 @@ static u8 *rep_xcrypt(const u8 *input, u8 *output, void *key, u8 *iv,

	__asm__ __volatile__(
		#ifdef __x86_64__
			"pushq %%rbp\n"
			"pushq %%rbx\n"
			"pushq %%rcx\n"
			"pushq %%rsi\n"
			"pushq %%rdi\n"
			"pushq %%rbp\n\n"
			"pushq %%rbx\n\n"
			"pushq %%rcx\n\n"
			"pushq %%rsi\n\n"
			"pushq %%rdi\n\n"
		#else
			"pushl %%ebp\n"
			"pushl %%ebx\n"
			"pushl %%ecx\n"
			"pushl %%esi\n"
			"pushl %%edi\n"
			"pushl %%ebp\n\n"
			"pushl %%ebx\n\n"
			"pushl %%ecx\n\n"
			"pushl %%esi\n\n"
			"pushl %%edi\n\n"
		#endif
		".byte 0xf3,0x0f,0xa7,0xf0\n"
		#ifdef __x86_64__
			"popq %%rdi\n"
			"popq %%rsi\n"
			"popq %%rcx\n"
			"popq %%rbx\n"
			"popq %%rbp\n"
			"popq %%rdi\n\n"
			"popq %%rsi\n\n"
			"popq %%rcx\n\n"
			"popq %%rbx\n\n"
			"popq %%rbp\n\n"
		#else
			"popl %%edi\n"
			"popl %%esi\n"
			"popl %%ecx\n"
			"popl %%ebx\n"
			"popl %%ebp\n"
			"popl %%edi\n\n"
			"popl %%esi\n\n"
			"popl %%ecx\n\n"
			"popl %%ebx\n\n"
			"popl %%ebp\n\n"
		#endif
		:
		: "S"(input), "D"(output), "a"(rax), "b"(key), "c"((unsigned long)count), "d"(iv));