From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: George Hu <integral@archlinux.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fat: remove unused fat_tolower() and use to_lower() instead
Date: Wed, 04 Feb 2026 14:20:57 +0900 [thread overview]
Message-ID: <87y0l9t77q.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <20260204035940.133747-1-integral@archlinux.org>
George Hu <integral@archlinux.org> writes:
> The fat_tolower() function is redundant, as it is functionally
> equivalent to the to_lower() macro defined in include/linux/ctype.h.
No, it is not equivalent.
Thanks.
> Signed-off-by: George Hu <integral@archlinux.org>
> ---
> fs/fat/dir.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/fs/fat/dir.c b/fs/fat/dir.c
> index 92b091783966..4f46d2358185 100644
> --- a/fs/fat/dir.c
> +++ b/fs/fat/dir.c
> @@ -18,6 +18,7 @@
> #include <linux/compat.h>
> #include <linux/uaccess.h>
> #include <linux/iversion.h>
> +#include <linux/ctype.h>
> #include "fat.h"
>
> /*
> @@ -33,11 +34,6 @@
> #define FAT_MAX_UNI_CHARS ((MSDOS_SLOTS - 1) * 13 + 1)
> #define FAT_MAX_UNI_SIZE (FAT_MAX_UNI_CHARS * sizeof(wchar_t))
>
> -static inline unsigned char fat_tolower(unsigned char c)
> -{
> - return ((c >= 'A') && (c <= 'Z')) ? c+32 : c;
> -}
> -
> static inline loff_t fat_make_i_pos(struct super_block *sb,
> struct buffer_head *bh,
> struct msdos_dir_entry *de)
> @@ -396,7 +392,7 @@ static int fat_parse_short(struct super_block *sb,
> de->lcase & CASE_LOWER_BASE);
> if (chl <= 1) {
> if (!isvfat)
> - ptname[i] = nocase ? c : fat_tolower(c);
> + ptname[i] = nocase ? c : tolower(c);
> i++;
> if (c != ' ') {
> name_len = i;
> @@ -433,7 +429,7 @@ static int fat_parse_short(struct super_block *sb,
> if (chl <= 1) {
> k++;
> if (!isvfat)
> - ptname[i] = nocase ? c : fat_tolower(c);
> + ptname[i] = nocase ? c : tolower(c);
> i++;
> if (c != ' ') {
> name_len = i;
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
prev parent reply other threads:[~2026-02-04 5:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 3:59 [PATCH] fat: remove unused fat_tolower() and use to_lower() instead George Hu
2026-02-04 5:20 ` OGAWA Hirofumi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y0l9t77q.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=integral@archlinux.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox