From: Carlos Santos <unixmania@gmail.com>
To: util-linux@vger.kernel.org
Subject: Re: [PATCH] hwclock: define cmos_interface only if necessary
Date: Sun, 23 Jun 2019 19:32:20 -0300 [thread overview]
Message-ID: <CAJ4jsacE=p_4+v_L4XEF1KRma-tmnRCUP+e8wqF=8FmBPwFf1A@mail.gmail.com> (raw)
In-Reply-To: <20190623172800.23445-1-unixmania@gmail.com>
On Sun, Jun 23, 2019 at 2:28 PM <unixmania@gmail.com> wrote:
>
> From: Carlos Santos <unixmania@gmail.com>
>
> Move the static declaration to the probe_for_cmos_clock() function and
> make it conditional to i386/x86_64, preventing a "defined but not used"
> compiler warning.
>
> Signed-off-by: Carlos Santos <unixmania@gmail.com>
> ---
> sys-utils/hwclock-cmos.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c
> index a11f676b8..ada4a9c43 100644
> --- a/sys-utils/hwclock-cmos.c
> +++ b/sys-utils/hwclock-cmos.c
> @@ -398,21 +398,21 @@ static const char *get_device_path(void)
> return NULL;
> }
>
> -static struct clock_ops cmos_interface = {
> - N_("Using direct ISA access to the clock"),
> - get_permissions_cmos,
> - read_hardware_clock_cmos,
> - set_hardware_clock_cmos,
> - synchronize_to_clock_tick_cmos,
> - get_device_path,
> -};
> -
> /*
> * return &cmos if cmos clock present, NULL otherwise.
> */
> struct clock_ops *probe_for_cmos_clock(void)
> {
> #if defined(__i386__) || defined(__x86_64__)
> + static struct clock_ops cmos_interface = {
> + N_("Using direct ISA access to the clock"),
> + get_permissions_cmos,
> + read_hardware_clock_cmos,
> + set_hardware_clock_cmos,
> + synchronize_to_clock_tick_cmos,
> + get_device_path,
> + };
> +
> return &cmos_interface;
> #else
> return NULL;
> --
> 2.18.1
>
Please ignore this patch. I just sent an updated one.
--
Carlos Santos <unixmania@gmail.com>
prev parent reply other threads:[~2019-06-24 2:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-23 17:28 [PATCH] hwclock: define cmos_interface only if necessary unixmania
2019-06-23 22:32 ` Carlos Santos [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ4jsacE=p_4+v_L4XEF1KRma-tmnRCUP+e8wqF=8FmBPwFf1A@mail.gmail.com' \
--to=unixmania@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).