* [PATCH] hw/rtc/ls7a_rtc: Drop unused inline functions
@ 2022-07-05 8:28 Richard Henderson
2022-07-05 8:31 ` Thomas Huth
2022-07-05 8:42 ` gaosong
0 siblings, 2 replies; 4+ messages in thread
From: Richard Henderson @ 2022-07-05 8:28 UTC (permalink / raw)
To: qemu-devel; +Cc: thuth, yangxiaojuan, gaosong
Remove toy_val_to_time_mon and toy_val_to_time_year as unused,
and to avoid a build failure with clang. Remove all of the
other inline markers foo so that this does not creep back in.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/rtc/ls7a_rtc.c | 27 ++++++---------------------
1 file changed, 6 insertions(+), 21 deletions(-)
diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c
index e8b75701e4..1f9e38a735 100644
--- a/hw/rtc/ls7a_rtc.c
+++ b/hw/rtc/ls7a_rtc.c
@@ -86,46 +86,31 @@ struct LS7ARtcState {
};
/* switch nanoseconds time to rtc ticks */
-static inline uint64_t ls7a_rtc_ticks(void)
+static uint64_t ls7a_rtc_ticks(void)
{
return qemu_clock_get_ns(rtc_clock) * LS7A_RTC_FREQ / NANOSECONDS_PER_SECOND;
}
/* switch rtc ticks to nanoseconds */
-static inline uint64_t ticks_to_ns(uint64_t ticks)
+static uint64_t ticks_to_ns(uint64_t ticks)
{
return ticks * NANOSECONDS_PER_SECOND / LS7A_RTC_FREQ;
}
-static inline bool toy_enabled(LS7ARtcState *s)
+static bool toy_enabled(LS7ARtcState *s)
{
return FIELD_EX32(s->cntrctl, RTC_CTRL, TOYEN) &&
FIELD_EX32(s->cntrctl, RTC_CTRL, EO);
}
-static inline bool rtc_enabled(LS7ARtcState *s)
+static bool rtc_enabled(LS7ARtcState *s)
{
return FIELD_EX32(s->cntrctl, RTC_CTRL, RTCEN) &&
FIELD_EX32(s->cntrctl, RTC_CTRL, EO);
}
-/* parse toy value to struct tm */
-static inline void toy_val_to_time_mon(uint64_t toy_val, struct tm *tm)
-{
- tm->tm_sec = FIELD_EX32(toy_val, TOY, SEC);
- tm->tm_min = FIELD_EX32(toy_val, TOY, MIN);
- tm->tm_hour = FIELD_EX32(toy_val, TOY, HOUR);
- tm->tm_mday = FIELD_EX32(toy_val, TOY, DAY);
- tm->tm_mon = FIELD_EX32(toy_val, TOY, MON) - 1;
-}
-
-static inline void toy_val_to_time_year(uint64_t toy_year, struct tm *tm)
-{
- tm->tm_year = toy_year;
-}
-
/* parse struct tm to toy value */
-static inline uint64_t toy_time_to_val_mon(struct tm *tm)
+static uint64_t toy_time_to_val_mon(const struct tm *tm)
{
uint64_t val = 0;
@@ -137,7 +122,7 @@ static inline uint64_t toy_time_to_val_mon(struct tm *tm)
return val;
}
-static inline void toymatch_val_to_time(LS7ARtcState *s, uint64_t val, struct tm *tm)
+static void toymatch_val_to_time(LS7ARtcState *s, uint64_t val, struct tm *tm)
{
qemu_get_timedate(tm, s->offset_toy);
tm->tm_sec = FIELD_EX32(val, TOY_MATCH, SEC);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/rtc/ls7a_rtc: Drop unused inline functions
2022-07-05 8:28 [PATCH] hw/rtc/ls7a_rtc: Drop unused inline functions Richard Henderson
@ 2022-07-05 8:31 ` Thomas Huth
2022-07-05 8:37 ` Richard Henderson
2022-07-05 8:42 ` gaosong
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2022-07-05 8:31 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: yangxiaojuan, gaosong, QEMU Trivial
On 05/07/2022 10.28, Richard Henderson wrote:
> Remove toy_val_to_time_mon and toy_val_to_time_year as unused,
> and to avoid a build failure with clang. Remove all of the
> other inline markers foo so that this does not creep back in.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> hw/rtc/ls7a_rtc.c | 27 ++++++---------------------
> 1 file changed, 6 insertions(+), 21 deletions(-)
>
> diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c
> index e8b75701e4..1f9e38a735 100644
> --- a/hw/rtc/ls7a_rtc.c
> +++ b/hw/rtc/ls7a_rtc.c
> @@ -86,46 +86,31 @@ struct LS7ARtcState {
> };
>
> /* switch nanoseconds time to rtc ticks */
> -static inline uint64_t ls7a_rtc_ticks(void)
> +static uint64_t ls7a_rtc_ticks(void)
> {
> return qemu_clock_get_ns(rtc_clock) * LS7A_RTC_FREQ / NANOSECONDS_PER_SECOND;
> }
>
> /* switch rtc ticks to nanoseconds */
> -static inline uint64_t ticks_to_ns(uint64_t ticks)
> +static uint64_t ticks_to_ns(uint64_t ticks)
> {
> return ticks * NANOSECONDS_PER_SECOND / LS7A_RTC_FREQ;
> }
>
> -static inline bool toy_enabled(LS7ARtcState *s)
> +static bool toy_enabled(LS7ARtcState *s)
> {
> return FIELD_EX32(s->cntrctl, RTC_CTRL, TOYEN) &&
> FIELD_EX32(s->cntrctl, RTC_CTRL, EO);
> }
>
> -static inline bool rtc_enabled(LS7ARtcState *s)
> +static bool rtc_enabled(LS7ARtcState *s)
> {
> return FIELD_EX32(s->cntrctl, RTC_CTRL, RTCEN) &&
> FIELD_EX32(s->cntrctl, RTC_CTRL, EO);
> }
>
> -/* parse toy value to struct tm */
> -static inline void toy_val_to_time_mon(uint64_t toy_val, struct tm *tm)
> -{
> - tm->tm_sec = FIELD_EX32(toy_val, TOY, SEC);
> - tm->tm_min = FIELD_EX32(toy_val, TOY, MIN);
> - tm->tm_hour = FIELD_EX32(toy_val, TOY, HOUR);
> - tm->tm_mday = FIELD_EX32(toy_val, TOY, DAY);
> - tm->tm_mon = FIELD_EX32(toy_val, TOY, MON) - 1;
> -}
> -
> -static inline void toy_val_to_time_year(uint64_t toy_year, struct tm *tm)
> -{
> - tm->tm_year = toy_year;
> -}
> -
> /* parse struct tm to toy value */
> -static inline uint64_t toy_time_to_val_mon(struct tm *tm)
> +static uint64_t toy_time_to_val_mon(const struct tm *tm)
> {
> uint64_t val = 0;
>
> @@ -137,7 +122,7 @@ static inline uint64_t toy_time_to_val_mon(struct tm *tm)
> return val;
> }
>
> -static inline void toymatch_val_to_time(LS7ARtcState *s, uint64_t val, struct tm *tm)
> +static void toymatch_val_to_time(LS7ARtcState *s, uint64_t val, struct tm *tm)
> {
> qemu_get_timedate(tm, s->offset_toy);
> tm->tm_sec = FIELD_EX32(val, TOY_MATCH, SEC);
I wonder why the other Clang-based CI jobs (running on Linux) did not
complain about this...?
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/rtc/ls7a_rtc: Drop unused inline functions
2022-07-05 8:28 [PATCH] hw/rtc/ls7a_rtc: Drop unused inline functions Richard Henderson
2022-07-05 8:31 ` Thomas Huth
@ 2022-07-05 8:42 ` gaosong
1 sibling, 0 replies; 4+ messages in thread
From: gaosong @ 2022-07-05 8:42 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: thuth, yangxiaojuan
On 2022/7/5 下午4:28, Richard Henderson wrote:
> Remove toy_val_to_time_mon and toy_val_to_time_year as unused,
> and to avoid a build failure with clang. Remove all of the
> other inline markers foo so that this does not creep back in.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
Sorry for this problem, We need more CI tests before push code.
Reviewed-by: Song Gao <gaosong@loongson.cn>
> hw/rtc/ls7a_rtc.c | 27 ++++++---------------------
> 1 file changed, 6 insertions(+), 21 deletions(-)
>
> diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c
> index e8b75701e4..1f9e38a735 100644
> --- a/hw/rtc/ls7a_rtc.c
> +++ b/hw/rtc/ls7a_rtc.c
> @@ -86,46 +86,31 @@ struct LS7ARtcState {
> };
>
> /* switch nanoseconds time to rtc ticks */
> -static inline uint64_t ls7a_rtc_ticks(void)
> +static uint64_t ls7a_rtc_ticks(void)
> {
> return qemu_clock_get_ns(rtc_clock) * LS7A_RTC_FREQ / NANOSECONDS_PER_SECOND;
> }
>
> /* switch rtc ticks to nanoseconds */
> -static inline uint64_t ticks_to_ns(uint64_t ticks)
> +static uint64_t ticks_to_ns(uint64_t ticks)
> {
> return ticks * NANOSECONDS_PER_SECOND / LS7A_RTC_FREQ;
> }
>
> -static inline bool toy_enabled(LS7ARtcState *s)
> +static bool toy_enabled(LS7ARtcState *s)
> {
> return FIELD_EX32(s->cntrctl, RTC_CTRL, TOYEN) &&
> FIELD_EX32(s->cntrctl, RTC_CTRL, EO);
> }
>
> -static inline bool rtc_enabled(LS7ARtcState *s)
> +static bool rtc_enabled(LS7ARtcState *s)
> {
> return FIELD_EX32(s->cntrctl, RTC_CTRL, RTCEN) &&
> FIELD_EX32(s->cntrctl, RTC_CTRL, EO);
> }
>
> -/* parse toy value to struct tm */
> -static inline void toy_val_to_time_mon(uint64_t toy_val, struct tm *tm)
> -{
> - tm->tm_sec = FIELD_EX32(toy_val, TOY, SEC);
> - tm->tm_min = FIELD_EX32(toy_val, TOY, MIN);
> - tm->tm_hour = FIELD_EX32(toy_val, TOY, HOUR);
> - tm->tm_mday = FIELD_EX32(toy_val, TOY, DAY);
> - tm->tm_mon = FIELD_EX32(toy_val, TOY, MON) - 1;
> -}
> -
> -static inline void toy_val_to_time_year(uint64_t toy_year, struct tm *tm)
> -{
> - tm->tm_year = toy_year;
> -}
> -
> /* parse struct tm to toy value */
> -static inline uint64_t toy_time_to_val_mon(struct tm *tm)
> +static uint64_t toy_time_to_val_mon(const struct tm *tm)
> {
> uint64_t val = 0;
>
> @@ -137,7 +122,7 @@ static inline uint64_t toy_time_to_val_mon(struct tm *tm)
> return val;
> }
>
> -static inline void toymatch_val_to_time(LS7ARtcState *s, uint64_t val, struct tm *tm)
> +static void toymatch_val_to_time(LS7ARtcState *s, uint64_t val, struct tm *tm)
> {
> qemu_get_timedate(tm, s->offset_toy);
> tm->tm_sec = FIELD_EX32(val, TOY_MATCH, SEC);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-05 11:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-05 8:28 [PATCH] hw/rtc/ls7a_rtc: Drop unused inline functions Richard Henderson
2022-07-05 8:31 ` Thomas Huth
2022-07-05 8:37 ` Richard Henderson
2022-07-05 8:42 ` gaosong
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).