diff mbox series

[SAMPLE] crypto: nx: pseries: use string choices helper

Message ID 87bjuhpmmt.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New
Headers show
Series [SAMPLE] crypto: nx: pseries: use string choices helper | expand

Commit Message

Kuninori Morimoto March 4, 2025, 2:15 a.m. UTC
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/crypto/nx/nx-common-pseries.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c
index 1660c5cf3641..1f8a73fb6bdd 100644
--- a/drivers/crypto/nx/nx-common-pseries.c
+++ b/drivers/crypto/nx/nx-common-pseries.c
@@ -7,6 +7,7 @@ 
  * Authors: Robert Jennings <rcj@linux.vnet.ibm.com>
  *          Seth Jennings <sjenning@linux.vnet.ibm.com>
  */
+#include <linux/string_choices.h>
 
 #include <asm/vio.h>
 #include <asm/hvcall.h>
@@ -55,13 +56,13 @@  static int check_constraints(unsigned long buf, unsigned int *len, bool in)
 {
 	if (!IS_ALIGNED(buf, nx842_pseries_constraints.alignment)) {
 		pr_debug("%s buffer 0x%lx not aligned to 0x%x\n",
-			 in ? "input" : "output", buf,
+			 str_input_output(in), buf,
 			 nx842_pseries_constraints.alignment);
 		return -EINVAL;
 	}
 	if (*len % nx842_pseries_constraints.multiple) {
 		pr_debug("%s buffer len 0x%x not multiple of 0x%x\n",
-			 in ? "input" : "output", *len,
+			 str_input_output(in), *len,
 			 nx842_pseries_constraints.multiple);
 		if (in)
 			return -EINVAL;
@@ -69,13 +70,13 @@  static int check_constraints(unsigned long buf, unsigned int *len, bool in)
 	}
 	if (*len < nx842_pseries_constraints.minimum) {
 		pr_debug("%s buffer len 0x%x under minimum 0x%x\n",
-			 in ? "input" : "output", *len,
+			 str_input_output(in), *len,
 			 nx842_pseries_constraints.minimum);
 		return -EINVAL;
 	}
 	if (*len > nx842_pseries_constraints.maximum) {
 		pr_debug("%s buffer len 0x%x over maximum 0x%x\n",
-			 in ? "input" : "output", *len,
+			 str_input_output(in), *len,
 			 nx842_pseries_constraints.maximum);
 		if (in)
 			return -EINVAL;