diff mbox series

smb3: Fix complilation for gcc9

Message ID 20240910151418.1233049-2-u.kleine-koenig@baylibre.com (mailing list archive)
State New, archived
Headers show
Series smb3: Fix complilation for gcc9 | expand

Commit Message

Uwe Kleine-König Sept. 10, 2024, 3:14 p.m. UTC
Compiling an x86_64 allmodconfig on Ubuntu 20.04.6 using gcc Ubuntu
9.4.0-1ubuntu1~20.04.2) 9.4.0 fails as follows:

	$ make fs/smb/client/compress/lz77.o
	...
	  CC [M]  fs/smb/client/compress/lz77.o
	In file included from fs/smb/client/compress/lz77.c:10:
	fs/smb/client/compress/lz77.h: In function ‘__count_common_bytes’:
	fs/smb/client/compress/lz77.h:220:1: error: no return statement in function returning non-void [-Werror=return-type]
	  220 | }
	      | ^
	cc1: all warnings being treated as errors
	make[5]: *** [scripts/Makefile.build:244: fs/smb/client/compress/lz77.o] Error 1
	make[4]: *** [scripts/Makefile.build:485: fs/smb/client] Error 2
	make[3]: *** [scripts/Makefile.build:485: fs/smb] Error 2
	make[2]: *** [scripts/Makefile.build:485: fs] Error 2
	make[1]: *** [Makefile:1926: .] Error 2
	make: *** [Makefile:224: __sub-make] Error 2

That compiler seems to know about __has_builtin but not to have
__builtin_ctzll. In that case fall back to the implementation that is
also active in the #ifndef __has_builtin case.

Fixes: 0fa8d04ff36d ("smb3: mark compression as CONFIG_EXPERIMENTAL and fix missing compression operation")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,

feel free to squash this into the original commit.

Best regards
Uwe

 fs/smb/client/compress/lz77.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


base-commit: 6708132e80a2ced620bde9b9c36e426183544a23

Comments

Steve French Sept. 11, 2024, 9:26 p.m. UTC | #1
this looks like it doesn't apply anymore due to changes in "smb:
client: compress: LZ77 code improvements cleanup"

Let me know if you see any problems building the current for-next

13b68d44990d (HEAD -> for-next, origin/for-next) smb: client:
compress: LZ77 code improvements cleanup
1dcb0b607b9b smb: client: insert compression check/call on write requests
ee71379301eb smb3: mark compression as CONFIG_EXPERIMENTAL and fix
missing compression operation

Enzo,
Is it easier for you to update patch 1 and 3, to make it smaller so
you don't have to add code in patch 1 that you remove in patch 3?
Also let me know if other patches to try?

On Tue, Sep 10, 2024 at 10:14 AM Uwe Kleine-König
<u.kleine-koenig@baylibre.com> wrote:
>
> Compiling an x86_64 allmodconfig on Ubuntu 20.04.6 using gcc Ubuntu
> 9.4.0-1ubuntu1~20.04.2) 9.4.0 fails as follows:
>
>         $ make fs/smb/client/compress/lz77.o
>         ...
>           CC [M]  fs/smb/client/compress/lz77.o
>         In file included from fs/smb/client/compress/lz77.c:10:
>         fs/smb/client/compress/lz77.h: In function ‘__count_common_bytes’:
>         fs/smb/client/compress/lz77.h:220:1: error: no return statement in function returning non-void [-Werror=return-type]
>           220 | }
>               | ^
>         cc1: all warnings being treated as errors
>         make[5]: *** [scripts/Makefile.build:244: fs/smb/client/compress/lz77.o] Error 1
>         make[4]: *** [scripts/Makefile.build:485: fs/smb/client] Error 2
>         make[3]: *** [scripts/Makefile.build:485: fs/smb] Error 2
>         make[2]: *** [scripts/Makefile.build:485: fs] Error 2
>         make[1]: *** [Makefile:1926: .] Error 2
>         make: *** [Makefile:224: __sub-make] Error 2
>
> That compiler seems to know about __has_builtin but not to have
> __builtin_ctzll. In that case fall back to the implementation that is
> also active in the #ifndef __has_builtin case.
>
> Fixes: 0fa8d04ff36d ("smb3: mark compression as CONFIG_EXPERIMENTAL and fix missing compression operation")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> Hello,
>
> feel free to squash this into the original commit.
>
> Best regards
> Uwe
>
>  fs/smb/client/compress/lz77.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/smb/client/compress/lz77.h b/fs/smb/client/compress/lz77.h
> index 3d0d3eaa8ffb..4fb939296f39 100644
> --- a/fs/smb/client/compress/lz77.h
> +++ b/fs/smb/client/compress/lz77.h
> @@ -200,10 +200,8 @@ static __always_inline long lz77_copy(u8 *dst, const u8 *src, size_t count)
>
>  static __always_inline unsigned int __count_common_bytes(const unsigned long diff)
>  {
> -#ifdef __has_builtin
> -#  if __has_builtin(__builtin_ctzll)
> +#if defined(__has_builtin) && __has_builtin(__builtin_ctzll)
>         return (unsigned int)__builtin_ctzll(diff) >> 3;
> -#  endif
>  #else
>         /* count trailing zeroes */
>         unsigned long bits = 0, i, z = 0;
>
> base-commit: 6708132e80a2ced620bde9b9c36e426183544a23
> --
> 2.45.2
>
>
Uwe Kleine-König Sept. 13, 2024, 8:29 a.m. UTC | #2
Hello Steve,

On Wed, Sep 11, 2024 at 04:26:39PM -0500, Steve French wrote:
> this looks like it doesn't apply anymore due to changes in "smb:
> client: compress: LZ77 code improvements cleanup"
> 
> Let me know if you see any problems building the current for-next

You're right, while next-20240910 is still broken with the reported
issue, next-20240911 and ...12 compile fine.

Best regards
Uwe
diff mbox series

Patch

diff --git a/fs/smb/client/compress/lz77.h b/fs/smb/client/compress/lz77.h
index 3d0d3eaa8ffb..4fb939296f39 100644
--- a/fs/smb/client/compress/lz77.h
+++ b/fs/smb/client/compress/lz77.h
@@ -200,10 +200,8 @@  static __always_inline long lz77_copy(u8 *dst, const u8 *src, size_t count)
 
 static __always_inline unsigned int __count_common_bytes(const unsigned long diff)
 {
-#ifdef __has_builtin
-#  if __has_builtin(__builtin_ctzll)
+#if defined(__has_builtin) && __has_builtin(__builtin_ctzll)
 	return (unsigned int)__builtin_ctzll(diff) >> 3;
-#  endif
 #else
 	/* count trailing zeroes */
 	unsigned long bits = 0, i, z = 0;