public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Cristian Rodríguez" <crrodriguez@opensuse.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 1/2] Linux: implement getloadavg(3) using sysinfo(2)
Date: Thu, 19 Aug 2021 17:38:24 -0400	[thread overview]
Message-ID: <CAPBLoAcucgS-gGy0txP=NZpeVWvf9CS1Go86t=6nVJrjKnvfFg@mail.gmail.com> (raw)
In-Reply-To: <6932ad12-8900-4335-6893-ee48f9fd1e7a@linaro.org>

On Thu, Aug 19, 2021 at 3:17 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 06/08/2021 16:17, Cristian Rodríguez wrote:
> > Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
>
> Look good, some minor comments below.

First, thanks for looking..

> > +  struct sysinfo info = {};
>
> I think there is no need to clear the struct prior the syscall,
> I would expect the kernel to fill all the appropriated values
> (as it seems to be doing on kernel/sys.c).


Yes, I read the kernel source, I  just decided not to count on the
kernel doing it.


> > +  nelem = CLAMP (nelem, 0, (int)array_length (info.loads));
>
> I think there is no need to cast to int here

IIRC the compiler complained I was comparing signed and unsigned
values.. array_length expands to a size_t value.

  reply	other threads:[~2021-08-19 21:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 19:17 Cristian Rodríguez
2021-08-06 19:17 ` [PATCH 2/2] resolv: make res_randomid use random_bits() Cristian Rodríguez
2021-08-12 18:51   ` Cristian Rodríguez
2021-08-20  7:00   ` Florian Weimer
2021-08-20 13:23     ` Cristian Rodríguez
2021-08-12 18:51 ` [PATCH 1/2] Linux: implement getloadavg(3) using sysinfo(2) Cristian Rodríguez
2021-08-19 19:17 ` Adhemerval Zanella
2021-08-19 21:38   ` Cristian Rodríguez [this message]
2021-08-20 14:21     ` Adhemerval Zanella

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='CAPBLoAcucgS-gGy0txP=NZpeVWvf9CS1Go86t=6nVJrjKnvfFg@mail.gmail.com' \
    --to=crrodriguez@opensuse.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).