summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorShaun <[email protected]>2026-02-21 13:16:52 +0800
committerRbb666 <[email protected]>2026-02-22 13:04:31 +0800
commit040c0290554f8604fd0522748b09b0e2c5632002 (patch)
tree05fe3ee7acc43ce115a03885a10e06930d5a389d /components/drivers
parent85b656b14dcfe8a3ab27c819e168dde082ab39ef (diff)
fix(drivers/block): replace GNU ?: extension with standard C ternary in blk.c
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/block/blk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/drivers/block/blk.c b/components/drivers/block/blk.c
index 9f2659de6d..313f50cdeb 100644
--- a/components/drivers/block/blk.c
+++ b/components/drivers/block/blk.c
@@ -536,7 +536,9 @@ static int list_blk(int argc, char**argv)
}
size_name = convert_size(&geome, geome.sector_count, &cap, &minor);
+ const char *mnt_path;
+ mnt_path = dfs_filesystem_get_mounted_path(&disk->parent);
rt_kprintf("%-*.s %3u.%-3u %u %u.%u%s\t%u disk %s\n",
RT_NAME_MAX, to_disk_name(disk),
#ifdef RT_USING_DM
@@ -546,12 +548,13 @@ static int list_blk(int argc, char**argv)
#endif
disk->removable, cap, minor, size_name, disk->read_only,
disk->max_partitions != RT_BLK_PARTITION_NONE ? "\b" :
- (dfs_filesystem_get_mounted_path(&disk->parent) ? : "\b"));
+ (mnt_path ? mnt_path : "\b"));
rt_list_for_each_entry(blk_dev, &disk->part_nodes, list)
{
size_name = convert_size(&geome, blk_dev->sector_count, &cap, &minor);
+ mnt_path = dfs_filesystem_get_mounted_path(&blk_dev->parent);
rt_kprintf("%c--%-*.s %3u.%-3u %u %u.%u%s\t%u part %s\n",
blk_dev->list.next != &disk->part_nodes ? '|' : '`',
RT_NAME_MAX - 3, to_blk_name(blk_dev),
@@ -561,7 +564,7 @@ static int list_blk(int argc, char**argv)
0, 0,
#endif
disk->removable, cap, minor, size_name, disk->read_only,
- dfs_filesystem_get_mounted_path(&blk_dev->parent) ? : "");
+ mnt_path ? mnt_path : "");
}
}