nls: fix byte order conversion warnings in get_utf16()
Subsystems (3)
PATCH 1/1 nls: fix byte order conversion warnings in get_utf16()
From: Hsueh Bo <[email protected]>
Add proper __force type casting to resolve sparse warnings about restricted __le16/__be16 conversions in get_utf16() function.
This fixes the following sparse warnings:fs/nls/nls_base.c:180:24: warning: cast to restricted __le16 fs/nls/nls_base.c:182:24: warning: cast to restricted __be16
Signed-off-by Hsueh Bo <[email protected]>
--- fs/nls/nls_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nls/nls_base.c +2 -2
@@ -177,9 +177,9 @@ static inline unsigned long get_utf16(unsigned c, enum utf16_endian endian)default :return c;case UTF16_LITTLE_ENDIAN : -return __le16_to_cpu (c); +return __le16_to_cpu ((__force __le16 )c);case UTF16_BIG_ENDIAN : -return __be16_to_cpu (c); +return __be16_to_cpu ((__force __be16 )c); } }
Signature · 1 line
2.43.0