All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] hexagon: fix ffz/fls/ffs return type
@ 2018-04-06 14:28 Arnd Bergmann
  2018-04-06 14:28 ` [PATCH 2/3] hexagon: add memset_io() helper Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Arnd Bergmann @ 2018-04-06 14:28 UTC (permalink / raw)
  To: Richard Kuo; +Cc: Arnd Bergmann, linux-hexagon, linux-kernel

Let's use the same return type as the major architectures to
avoid warnings like

drivers/ata/libahci_platform.c: In function 'ahci_platform_init_host':
drivers/ata/libahci_platform.c:561:12: warning: comparison of distinct pointer types lacks a cast [enabled by default]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/hexagon/include/asm/bitops.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
index 5e4a59b3ec1b..8790a50b1f5e 100644
--- a/arch/hexagon/include/asm/bitops.h
+++ b/arch/hexagon/include/asm/bitops.h
@@ -194,7 +194,7 @@ static inline int __test_bit(int nr, const volatile unsigned long *addr)
  *
  * Undefined if no zero exists, so code should check against ~0UL first.
  */
-static inline long ffz(int x)
+static inline int ffz(int x)
 {
 	int r;
 
@@ -211,7 +211,7 @@ static inline long ffz(int x)
  * This is defined the same way as ffs.
  * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
  */
-static inline long fls(int x)
+static inline int fls(int x)
 {
 	int r;
 
@@ -232,7 +232,7 @@ static inline long fls(int x)
  * the libc and compiler builtin ffs routines, therefore
  * differs in spirit from the above ffz (man ffs).
  */
-static inline long ffs(int x)
+static inline int ffs(int x)
 {
 	int r;
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] hexagon: add memset_io() helper
  2018-04-06 14:28 [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Arnd Bergmann
@ 2018-04-06 14:28 ` Arnd Bergmann
  2018-04-08  1:31   ` Richard Kuo
  2018-04-06 14:28 ` [PATCH 3/3] hexagon: export csum_partial_copy_nocheck Arnd Bergmann
  2018-04-08  1:35 ` [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Richard Kuo
  2 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2018-04-06 14:28 UTC (permalink / raw)
  To: Richard Kuo; +Cc: Arnd Bergmann, linux-hexagon, linux-kernel

We already have memcpy_toio(), but not memset_io(), so let's
add the obvious version to allow building an allmodconfig kernel
without errors like

drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_move_memcpy':
drivers/gpu/drm/ttm/ttm_bo_util.c:390:3: error: implicit declaration of function 'memset_io' [-Werror=implicit-function-declaration]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/hexagon/include/asm/io.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 9e8621d94ee9..e17262ad125e 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -216,6 +216,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
 	memcpy((void *) dst, src, count);
 }
 
+static inline void memset_io(volatile void __iomem *addr, int value,
+			     size_t size)
+{
+	memset((void __force *)addr, value, size);
+}
+
 #define PCI_IO_ADDR	(volatile void __iomem *)
 
 /*
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] hexagon: export csum_partial_copy_nocheck
  2018-04-06 14:28 [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Arnd Bergmann
  2018-04-06 14:28 ` [PATCH 2/3] hexagon: add memset_io() helper Arnd Bergmann
@ 2018-04-06 14:28 ` Arnd Bergmann
  2018-04-08  1:32   ` Richard Kuo
  2018-04-08  1:35 ` [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Richard Kuo
  2 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2018-04-06 14:28 UTC (permalink / raw)
  To: Richard Kuo; +Cc: Arnd Bergmann, linux-hexagon, linux-kernel

This is needed to link ipv6 as a loadable module, which in turn happens
in allmodconfig.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/hexagon/lib/checksum.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/lib/checksum.c b/arch/hexagon/lib/checksum.c
index 617506d1a559..7cd0a2259269 100644
--- a/arch/hexagon/lib/checksum.c
+++ b/arch/hexagon/lib/checksum.c
@@ -199,3 +199,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
 	memcpy(dst, src, len);
 	return csum_partial(dst, len, sum);
 }
+EXPORT_SYMBOL(csum_partial_copy_nocheck);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] hexagon: add memset_io() helper
  2018-04-06 14:28 ` [PATCH 2/3] hexagon: add memset_io() helper Arnd Bergmann
@ 2018-04-08  1:31   ` Richard Kuo
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Kuo @ 2018-04-08  1:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-hexagon, linux-kernel

On Fri, Apr 06, 2018 at 04:28:22PM +0200, Arnd Bergmann wrote:
> We already have memcpy_toio(), but not memset_io(), so let's
> add the obvious version to allow building an allmodconfig kernel
> without errors like
> 
> drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_move_memcpy':
> drivers/gpu/drm/ttm/ttm_bo_util.c:390:3: error: implicit declaration of function 'memset_io' [-Werror=implicit-function-declaration]
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/hexagon/include/asm/io.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
> index 9e8621d94ee9..e17262ad125e 100644
> --- a/arch/hexagon/include/asm/io.h
> +++ b/arch/hexagon/include/asm/io.h
> @@ -216,6 +216,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
>  	memcpy((void *) dst, src, count);
>  }
>  
> +static inline void memset_io(volatile void __iomem *addr, int value,
> +			     size_t size)
> +{
> +	memset((void __force *)addr, value, size);
> +}
> +
>  #define PCI_IO_ADDR	(volatile void __iomem *)
>  
>  /*

Acked-by: Richard Kuo <rkuo@codeaurora.org>



-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] hexagon: export csum_partial_copy_nocheck
  2018-04-06 14:28 ` [PATCH 3/3] hexagon: export csum_partial_copy_nocheck Arnd Bergmann
@ 2018-04-08  1:32   ` Richard Kuo
  2018-04-10  6:33     ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Kuo @ 2018-04-08  1:32 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-hexagon, linux-kernel

On Fri, Apr 06, 2018 at 04:28:23PM +0200, Arnd Bergmann wrote:
> This is needed to link ipv6 as a loadable module, which in turn happens
> in allmodconfig.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/hexagon/lib/checksum.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/hexagon/lib/checksum.c b/arch/hexagon/lib/checksum.c
> index 617506d1a559..7cd0a2259269 100644
> --- a/arch/hexagon/lib/checksum.c
> +++ b/arch/hexagon/lib/checksum.c
> @@ -199,3 +199,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
>  	memcpy(dst, src, len);
>  	return csum_partial(dst, len, sum);
>  }
> +EXPORT_SYMBOL(csum_partial_copy_nocheck);

Acked-by: Richard Kuo <rkuo@codeaurora.org>

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] hexagon: fix ffz/fls/ffs return type
  2018-04-06 14:28 [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Arnd Bergmann
  2018-04-06 14:28 ` [PATCH 2/3] hexagon: add memset_io() helper Arnd Bergmann
  2018-04-06 14:28 ` [PATCH 3/3] hexagon: export csum_partial_copy_nocheck Arnd Bergmann
@ 2018-04-08  1:35 ` Richard Kuo
  2018-04-10  6:31   ` Arnd Bergmann
  2 siblings, 1 reply; 8+ messages in thread
From: Richard Kuo @ 2018-04-08  1:35 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-hexagon, linux-kernel

On Fri, Apr 06, 2018 at 04:28:21PM +0200, Arnd Bergmann wrote:
> Let's use the same return type as the major architectures to
> avoid warnings like
> 
> drivers/ata/libahci_platform.c: In function 'ahci_platform_init_host':
> drivers/ata/libahci_platform.c:561:12: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/hexagon/include/asm/bitops.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
> index 5e4a59b3ec1b..8790a50b1f5e 100644
> --- a/arch/hexagon/include/asm/bitops.h
> +++ b/arch/hexagon/include/asm/bitops.h
> @@ -194,7 +194,7 @@ static inline int __test_bit(int nr, const volatile unsigned long *addr)
>   *
>   * Undefined if no zero exists, so code should check against ~0UL first.
>   */
> -static inline long ffz(int x)
> +static inline int ffz(int x)
>  {
>  	int r;
>  
> @@ -211,7 +211,7 @@ static inline long ffz(int x)
>   * This is defined the same way as ffs.
>   * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
>   */
> -static inline long fls(int x)
> +static inline int fls(int x)
>  {
>  	int r;
>  
> @@ -232,7 +232,7 @@ static inline long fls(int x)
>   * the libc and compiler builtin ffs routines, therefore
>   * differs in spirit from the above ffz (man ffs).
>   */
> -static inline long ffs(int x)
> +static inline int ffs(int x)
>  {
>  	int r;
>  


Isn't ffz usually long/unsigned long on other architectures?





-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] hexagon: fix ffz/fls/ffs return type
  2018-04-08  1:35 ` [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Richard Kuo
@ 2018-04-10  6:31   ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2018-04-10  6:31 UTC (permalink / raw)
  To: Richard Kuo; +Cc: open list:QUALCOMM HEXAGON..., Linux Kernel Mailing List

On Sun, Apr 8, 2018 at 3:35 AM, Richard Kuo <rkuo@codeaurora.org> wrote:
> On Fri, Apr 06, 2018 at 04:28:21PM +0200, Arnd Bergmann wrote:
>> Let's use the same return type as the major architectures to
>> avoid warnings like
>>
>> drivers/ata/libahci_platform.c: In function 'ahci_platform_init_host':
>> drivers/ata/libahci_platform.c:561:12: warning: comparison of distinct pointer types lacks a cast [enabled by default]
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>  arch/hexagon/include/asm/bitops.h | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
>> index 5e4a59b3ec1b..8790a50b1f5e 100644
>> --- a/arch/hexagon/include/asm/bitops.h
>> +++ b/arch/hexagon/include/asm/bitops.h
>> @@ -194,7 +194,7 @@ static inline int __test_bit(int nr, const volatile unsigned long *addr)
>>   *
>>   * Undefined if no zero exists, so code should check against ~0UL first.
>>   */
>> -static inline long ffz(int x)
>> +static inline int ffz(int x)
>>  {
>>       int r;
>>
>> @@ -211,7 +211,7 @@ static inline long ffz(int x)
>>   * This is defined the same way as ffs.
>>   * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
>>   */
>> -static inline long fls(int x)
>> +static inline int fls(int x)
>>  {
>>       int r;
>>
>> @@ -232,7 +232,7 @@ static inline long fls(int x)
>>   * the libc and compiler builtin ffs routines, therefore
>>   * differs in spirit from the above ffz (man ffs).
>>   */
>> -static inline long ffs(int x)
>> +static inline int ffs(int x)
>>  {
>>       int r;
>>
>
>
> Isn't ffz usually long/unsigned long on other architectures?

Yes, that's right. Let's drop my patch for the moment and maybe revisit it
later. There were only a couple of warnings in an allmodconfig build from
this one, so it might be better change the generic bitops and the more
common architectures to all consistently use 'long' or maybe 'unsigned long'
as the return type for all those functions.

       Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] hexagon: export csum_partial_copy_nocheck
  2018-04-08  1:32   ` Richard Kuo
@ 2018-04-10  6:33     ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2018-04-10  6:33 UTC (permalink / raw)
  To: Richard Kuo; +Cc: open list:QUALCOMM HEXAGON..., Linux Kernel Mailing List

On Sun, Apr 8, 2018 at 3:32 AM, Richard Kuo <rkuo@codeaurora.org> wrote:
> On Fri, Apr 06, 2018 at 04:28:23PM +0200, Arnd Bergmann wrote:
>> This is needed to link ipv6 as a loadable module, which in turn happens
>> in allmodconfig.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>  arch/hexagon/lib/checksum.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/hexagon/lib/checksum.c b/arch/hexagon/lib/checksum.c
>> index 617506d1a559..7cd0a2259269 100644
>> --- a/arch/hexagon/lib/checksum.c
>> +++ b/arch/hexagon/lib/checksum.c
>> @@ -199,3 +199,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
>>       memcpy(dst, src, len);
>>       return csum_partial(dst, len, sum);
>>  }
>> +EXPORT_SYMBOL(csum_partial_copy_nocheck);
>
> Acked-by: Richard Kuo <rkuo@codeaurora.org>

Can you take the two patches you acked through your tree? They are not urgent,
but with those applied, I got very close to building an allmodconfig
kernel without
warnings, using the toolchain I uploaded to
https://cdn.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.6.1/

        Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-10  6:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06 14:28 [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Arnd Bergmann
2018-04-06 14:28 ` [PATCH 2/3] hexagon: add memset_io() helper Arnd Bergmann
2018-04-08  1:31   ` Richard Kuo
2018-04-06 14:28 ` [PATCH 3/3] hexagon: export csum_partial_copy_nocheck Arnd Bergmann
2018-04-08  1:32   ` Richard Kuo
2018-04-10  6:33     ` Arnd Bergmann
2018-04-08  1:35 ` [PATCH 1/3] hexagon: fix ffz/fls/ffs return type Richard Kuo
2018-04-10  6:31   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.