* [PATCH] copperplate/clockobj: prevent warning with -Wconversion
@ 2018-10-30 7:13 Mauro Salvini
2018-10-31 17:42 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Mauro Salvini @ 2018-10-30 7:13 UTC (permalink / raw)
To: xenomai
make cast explicit to avoid warning when user code is compiled with
-Wconversion
---
include/copperplate/clockobj.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/copperplate/clockobj.h
b/include/copperplate/clockobj.h
index 8568794d9..063bcce90 100644
--- a/include/copperplate/clockobj.h
+++ b/include/copperplate/clockobj.h
@@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct
timespec *ts)
{
unsigned long rem;
- ts->tv_sec = cobalt_divrem_billion(ns, &rem);
+ ts->tv_sec = (__kernel_time_t)cobalt_divrem_billion(ns, &rem);
ts->tv_nsec = rem;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] copperplate/clockobj: prevent warning with -Wconversion
2018-10-30 7:13 [PATCH] copperplate/clockobj: prevent warning with -Wconversion Mauro Salvini
@ 2018-10-31 17:42 ` Jan Kiszka
2018-11-05 13:03 ` Mauro Salvini
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2018-10-31 17:42 UTC (permalink / raw)
To: Mauro Salvini, xenomai
On 30.10.18 08:13, Mauro Salvini wrote:
> make cast explicit to avoid warning when user code is compiled with
> -Wconversion
Please sign-off your patches, according to CONTRIBUTING.md.
> ---
> include/copperplate/clockobj.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/copperplate/clockobj.h
> b/include/copperplate/clockobj.h
> index 8568794d9..063bcce90 100644
> --- a/include/copperplate/clockobj.h
> +++ b/include/copperplate/clockobj.h
> @@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct
> timespec *ts)
Something mangled this line, probably your mail client.
> {
> unsigned long rem;
>
> - ts->tv_sec = cobalt_divrem_billion(ns, &rem);
> + ts->tv_sec = (__kernel_time_t)cobalt_divrem_billion(ns, &rem);
Why not time_t, the public target type?
> ts->tv_nsec = rem;
> }
>
> --
> 2.11.0
>
>
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] copperplate/clockobj: prevent warning with -Wconversion
2018-10-31 17:42 ` Jan Kiszka
@ 2018-11-05 13:03 ` Mauro Salvini
2018-11-05 15:17 ` Jan Kiszka
0 siblings, 1 reply; 4+ messages in thread
From: Mauro Salvini @ 2018-11-05 13:03 UTC (permalink / raw)
To: xenomai
make cast explicit to avoid warning when user code is compiled with
-Wconversion
Signed-off-by: Mauro Salvini <mauro.salvini@smigroup.net>
---
include/copperplate/clockobj.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/copperplate/clockobj.h b/include/copperplate/clockobj.h
index 8568794d9..24c748557 100644
--- a/include/copperplate/clockobj.h
+++ b/include/copperplate/clockobj.h
@@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
{
unsigned long rem;
- ts->tv_sec = cobalt_divrem_billion(ns, &rem);
+ ts->tv_sec = (time_t)cobalt_divrem_billion(ns, &rem);
ts->tv_nsec = rem;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] copperplate/clockobj: prevent warning with -Wconversion
2018-11-05 13:03 ` Mauro Salvini
@ 2018-11-05 15:17 ` Jan Kiszka
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2018-11-05 15:17 UTC (permalink / raw)
To: Mauro Salvini, xenomai
On 05.11.18 14:03, Mauro Salvini via Xenomai wrote:
> make cast explicit to avoid warning when user code is compiled with
> -Wconversion
>
> Signed-off-by: Mauro Salvini <mauro.salvini@smigroup.net>
> ---
> include/copperplate/clockobj.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/copperplate/clockobj.h b/include/copperplate/clockobj.h
> index 8568794d9..24c748557 100644
> --- a/include/copperplate/clockobj.h
> +++ b/include/copperplate/clockobj.h
> @@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
> {
> unsigned long rem;
>
> - ts->tv_sec = cobalt_divrem_billion(ns, &rem);
> + ts->tv_sec = (time_t)cobalt_divrem_billion(ns, &rem);
> ts->tv_nsec = rem;
> }
>
>
Thanks, applied.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-05 15:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 7:13 [PATCH] copperplate/clockobj: prevent warning with -Wconversion Mauro Salvini
2018-10-31 17:42 ` Jan Kiszka
2018-11-05 13:03 ` Mauro Salvini
2018-11-05 15:17 ` Jan Kiszka
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.