Re: [PATCH] fs/ufs: Use LUT for dir entry types

From: Markus Elfring
Date: Mon Jun 10 2024 - 03:48:23 EST


> As per the original TODO, replacing the switch statement with a lookup
> table results in more concise mapping logic and improved performance.


Can imperative wordings be relevant for another improved change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc2#n94



> +++ b/fs/ufs/util.h

> static inline void
> ufs_set_de_type(struct super_block *sb, struct ufs_dir_entry *de, int mode)

> + if (mode_index < ARRAY_SIZE(ufs_mode_to_dt))
> + de->d_u.d_44.d_type = ufs_mode_to_dt[mode_index];
> + else
> de->d_u.d_44.d_type = DT_UNKNOWN;


May a conditional operator expression be applied at this source code place?

Regards,
Markus