* [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
@ 2014-12-24 14:40 Chen Gang
2014-12-24 15:01 ` Chen Gang
0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2014-12-24 14:40 UTC (permalink / raw)
To: qca_vkondrat, kvalo
Cc: linux-wireless, wil6210, netdev@vger.kernel.org, linux-next
do_div() checks the type strictly. 'cycles_t' may be 32-bit under quite
a few architectures (parisc, arm, avr32 ...). So use 'uint64_t' instead
of, the related warning (with allmodconfig under parisc):
CC [M] drivers/net/wireless/ath/wil6210/debugfs.o
In file included from arch/parisc/include/generated/asm/div64.h:1:0,
from include/linux/kernel.h:124,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/net/wireless/ath/wil6210/debugfs.c:17:
drivers/net/wireless/ath/wil6210/debugfs.c: In function
‘wil_vring_debugfs_show’:
include/asm-generic/div64.h:43:28: warning: comparison of distinct
pointer types lacks a cast
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^
drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion
of macro ‘do_div’
do_div(idle, total);
^
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from ./include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/asm-generic/div64.h:44:18: warning: right shift count >= width
of type [-Wshift-count-overflow]
if (likely(((n) >> 32) == 0)) { \
^
include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
# define likely(x) __builtin_expect(!!(x), 1)
^
drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion
of macro ‘do_div’
do_div(idle, total);
^
In file included from arch/parisc/include/generated/asm/div64.h:1:0,
from include/linux/kernel.h:124,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/asm-generic/div64.h:48:22: warning: passing argument 1 of
‘__div64_32’ from incompatible pointer type [-Wincompatible-pointer-types]
__rem = __div64_32(&(n), __base); \
^
drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion
of macro ‘do_div’
do_div(idle, total);
^
include/asm-generic/div64.h:35:17: note: expected ‘uint64_t * {aka
long long unsigned int *}’ but argument is of type ‘cycles_t * {aka long
unsigned int *}’
extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
^
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c
b/drivers/net/wireless/ath/wil6210/debugfs.c
index 4e6e145..cd991fa 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -101,8 +101,8 @@ static int wil_vring_debugfs_show(struct seq_file
*s, void *data)
char name[10];
/* performance monitoring */
cycles_t now = get_cycles();
- cycles_t idle = txdata->idle * 100;
- cycles_t total = now - txdata->begin;
+ uint64_t idle = txdata->idle * 100;
+ uint64_t total = now - txdata->begin;
do_div(idle, total);
txdata->begin = now;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
2014-12-24 14:40 [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings Chen Gang
@ 2014-12-24 15:01 ` Chen Gang
[not found] ` <549AD54F.3020605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2014-12-24 15:01 UTC (permalink / raw)
To: qca_vkondrat, kvalo
Cc: linux-wireless, wil6210, netdev@vger.kernel.org, linux-next
Oh, sorry, I forgot the word wrap (after change a new pc). I shall send
patch v2 for it.
On 12/24/2014 10:40 PM, Chen Gang wrote:
> do_div() checks the type strictly. 'cycles_t' may be 32-bit under quite
> a few architectures (parisc, arm, avr32 ...). So use 'uint64_t' instead
> of, the related warning (with allmodconfig under parisc):
>
> CC [M] drivers/net/wireless/ath/wil6210/debugfs.o
> In file included from arch/parisc/include/generated/asm/div64.h:1:0,
> from include/linux/kernel.h:124,
> from include/linux/list.h:8,
> from include/linux/module.h:9,
> from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> drivers/net/wireless/ath/wil6210/debugfs.c: In function
> ‘wil_vring_debugfs_show’:
> include/asm-generic/div64.h:43:28: warning: comparison of distinct
> pointer types lacks a cast
> (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
> ^
> drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion
> of macro ‘do_div’
> do_div(idle, total);
> ^
> In file included from include/uapi/linux/stddef.h:1:0,
> from include/linux/stddef.h:4,
> from ./include/uapi/linux/posix_types.h:4,
> from include/uapi/linux/types.h:13,
> from include/linux/types.h:5,
> from include/linux/list.h:4,
> from include/linux/module.h:9,
> from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> include/asm-generic/div64.h:44:18: warning: right shift count >= width
> of type [-Wshift-count-overflow]
> if (likely(((n) >> 32) == 0)) { \
> ^
> include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
> # define likely(x) __builtin_expect(!!(x), 1)
> ^
> drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion
> of macro ‘do_div’
> do_div(idle, total);
> ^
> In file included from arch/parisc/include/generated/asm/div64.h:1:0,
> from include/linux/kernel.h:124,
> from include/linux/list.h:8,
> from include/linux/module.h:9,
> from drivers/net/wireless/ath/wil6210/debugfs.c:17:
> include/asm-generic/div64.h:48:22: warning: passing argument 1 of
> ‘__div64_32’ from incompatible pointer type [-Wincompatible-pointer-types]
> __rem = __div64_32(&(n), __base); \
> ^
> drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion
> of macro ‘do_div’
> do_div(idle, total);
> ^
> include/asm-generic/div64.h:35:17: note: expected ‘uint64_t * {aka
> long long unsigned int *}’ but argument is of type ‘cycles_t * {aka long
> unsigned int *}’
> extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
> ^
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
> drivers/net/wireless/ath/wil6210/debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c
> b/drivers/net/wireless/ath/wil6210/debugfs.c
> index 4e6e145..cd991fa 100644
> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
> @@ -101,8 +101,8 @@ static int wil_vring_debugfs_show(struct seq_file
> *s, void *data)
> char name[10];
> /* performance monitoring */
> cycles_t now = get_cycles();
> - cycles_t idle = txdata->idle * 100;
> - cycles_t total = now - txdata->begin;
> + uint64_t idle = txdata->idle * 100;
> + uint64_t total = now - txdata->begin;
>
> do_div(idle, total);
> txdata->begin = now;
>
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
[not found] ` <549AD54F.3020605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-12-24 15:11 ` Kalle Valo
2014-12-24 15:22 ` Chen Gang
0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2014-12-24 15:11 UTC (permalink / raw)
To: Chen Gang
Cc: qca_vkondrat-A+ZNKFmMK5xy9aJCnZT0Uw,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
wil6210-A+ZNKFmMK5xy9aJCnZT0Uw, netdev@vger.kernel.org,
linux-next-u79uwXL29TY76Z2rM5mHXA
Chen Gang <gang.chen.5i5j-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> Oh, sorry, I forgot the word wrap (after change a new pc). I shall send
> patch v2 for it.
While at it, could you also please simplify the title. You don't have to
put the full directory there, it just makes it more difficult to read.
This should be enough:
wil6210: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
I see quite a few patches with titles like 'drivers: net: wireless: ath:
fix foo'. Where an earth is that coming from? Bad documentation
somewhere?
--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
2014-12-24 15:11 ` Kalle Valo
@ 2014-12-24 15:22 ` Chen Gang
2014-12-24 15:35 ` Kalle Valo
0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2014-12-24 15:22 UTC (permalink / raw)
To: Kalle Valo
Cc: qca_vkondrat, linux-wireless, wil6210, netdev@vger.kernel.org,
linux-next
On 12/24/2014 11:11 PM, Kalle Valo wrote:
> Chen Gang <gang.chen.5i5j@gmail.com> writes:
>
>> Oh, sorry, I forgot the word wrap (after change a new pc). I shall send
>> patch v2 for it.
>
> While at it, could you also please simplify the title. You don't have to
> put the full directory there, it just makes it more difficult to read.
> This should be enough:
>
> wil6210: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
>
Oh, I have sent patch v2, if necessary, I will send patch v3 for it.
(if necessary, please let me know)
> I see quite a few patches with titles like 'drivers: net: wireless: ath:
> fix foo'. Where an earth is that coming from? Bad documentation
> somewhere?
>
I guess, this can let the patch makers have a easier life, e.g. for me,
I may send patches for various sub-systems (arch/*, drivers/*, net/*,
also another projects ...).
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
2014-12-24 15:22 ` Chen Gang
@ 2014-12-24 15:35 ` Kalle Valo
2014-12-24 15:54 ` Chen Gang
0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2014-12-24 15:35 UTC (permalink / raw)
To: Chen Gang
Cc: qca_vkondrat, linux-wireless, wil6210, netdev@vger.kernel.org,
linux-next
Chen Gang <gang.chen.5i5j@gmail.com> writes:
> On 12/24/2014 11:11 PM, Kalle Valo wrote:
>> Chen Gang <gang.chen.5i5j@gmail.com> writes:
>>
>>> Oh, sorry, I forgot the word wrap (after change a new pc). I shall send
>>> patch v2 for it.
>>
>> While at it, could you also please simplify the title. You don't have to
>> put the full directory there, it just makes it more difficult to read.
>> This should be enough:
>>
>> wil6210: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
>>
>
> Oh, I have sent patch v2, if necessary, I will send patch v3 for it.
> (if necessary, please let me know)
I can edit it this time, but in the future please be use less verbose
titles.
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
2014-12-24 15:35 ` Kalle Valo
@ 2014-12-24 15:54 ` Chen Gang
0 siblings, 0 replies; 6+ messages in thread
From: Chen Gang @ 2014-12-24 15:54 UTC (permalink / raw)
To: Kalle Valo
Cc: qca_vkondrat, linux-wireless, wil6210, netdev@vger.kernel.org,
linux-next
On 12/24/2014 11:35 PM, Kalle Valo wrote:
> Chen Gang <gang.chen.5i5j@gmail.com> writes:
>
>> On 12/24/2014 11:11 PM, Kalle Valo wrote:
>>> Chen Gang <gang.chen.5i5j@gmail.com> writes:
>>>
>>>> Oh, sorry, I forgot the word wrap (after change a new pc). I shall send
>>>> patch v2 for it.
>>>
>>> While at it, could you also please simplify the title. You don't have to
>>> put the full directory there, it just makes it more difficult to read.
>>> This should be enough:
>>>
>>> wil6210: Use 'uint64_t' instead of 'cycles_t' to avoid warnings
>>>
>>
>> Oh, I have sent patch v2, if necessary, I will send patch v3 for it.
>> (if necessary, please let me know)
>
> I can edit it this time, but in the future please be use less verbose
> titles.
>
OK, thanks. Next, I shall use the short subject for drivers.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-12-24 15:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 14:40 [PATCH next] drivers/net/wireless/ath/wil6210/debugfs.c: Use 'uint64_t' instead of 'cycles_t' to avoid warnings Chen Gang
2014-12-24 15:01 ` Chen Gang
[not found] ` <549AD54F.3020605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-24 15:11 ` Kalle Valo
2014-12-24 15:22 ` Chen Gang
2014-12-24 15:35 ` Kalle Valo
2014-12-24 15:54 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).