Skip to content

Commit 733c4e9

Browse files
SimoneChengdavejiang
authored andcommitted
cxl/region: use str_enabled_disabled() instead of ternary operator
Replace ternary operator with str_enabled_disabled() helper to enhance code readability and consistency. [dj: Fix spelling in commit log and subject. ] Signed-off-by: Nai-Chen Cheng <bleach1827@gmail.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/20250812-cxl-region-string-choices-v1-1-50200b0bc782@gmail.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 22fb4ad commit 733c4e9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/cxl/core/region.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/sort.h>
1111
#include <linux/idr.h>
1212
#include <linux/memory-tiers.h>
13+
#include <linux/string_choices.h>
1314
#include <cxlmem.h>
1415
#include <cxl.h>
1516
#include "core.h"
@@ -1468,9 +1469,7 @@ static int cxl_port_setup_targets(struct cxl_port *port,
14681469
dev_name(port->uport_dev), dev_name(&port->dev),
14691470
__func__, cxld->interleave_ways,
14701471
cxld->interleave_granularity,
1471-
(cxld->flags & CXL_DECODER_F_ENABLE) ?
1472-
"enabled" :
1473-
"disabled",
1472+
str_enabled_disabled(cxld->flags & CXL_DECODER_F_ENABLE),
14741473
cxld->hpa_range.start, cxld->hpa_range.end);
14751474
return -ENXIO;
14761475
}

0 commit comments

Comments
 (0)