[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250613095130.3025363-1-yujiaoliang@vivo.com>
Date: Fri, 13 Jun 2025 17:51:30 +0800
From: Yu Jiaoliang <yujiaoliang@...o.com>
To: Justin Sanders <justin@...aid.com>,
Jens Axboe <axboe@...nel.dk>,
linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v1] aoe: Convert ternary operator to str_up_down() helper
Replace direct ternary condition check with existing helper function
str_up_down() to improve code readability and maintain consistency.
Signed-off-by: Yu Jiaoliang <yujiaoliang@...o.com>
---
drivers/block/aoe/aoeblk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 00b74a845..0d95e06e0 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -17,6 +17,7 @@
#include <linux/export.h>
#include <linux/moduleparam.h>
#include <linux/debugfs.h>
+#include <linux/string_choices.h>
#include <scsi/sg.h>
#include "aoe.h"
@@ -37,7 +38,7 @@ static ssize_t aoedisk_show_state(struct device *dev,
struct aoedev *d = disk->private_data;
return sysfs_emit(page, "%s%s\n",
- (d->flags & DEVFL_UP) ? "up" : "down",
+ str_up_down(d->flags & DEVFL_UP),
(d->flags & DEVFL_KICKME) ? ",kickme" :
(d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : "");
/* I'd rather see nopen exported so we can ditch closewait */
--
2.34.1
Powered by blists - more mailing lists