All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/6] dm: cpu: Add a new get_count method to cpu uclass
Date: Tue, 16 Jun 2015 16:10:54 -0600	[thread overview]
Message-ID: <CAPnjgZ0otAYVbCBaWJ+ffxE5B8Mo3wKj0EOZYYUcSsYpfRx5fQ@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmW2L3rcwmYK3xSVGEpwySE58XwTTMOc6=4M1QHAT6QyrQ@mail.gmail.com>

Hi Bin,

On 15 June 2015 at 18:19, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Tue, Jun 16, 2015 at 4:45 AM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Bin,
>>
>> On 13 June 2015 at 04:11, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>
>>> Introduce a new method 'get_count' in the UCLASS_CPU ops to get
>>> the number of CPUs in the system.
>>>
>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>>
>>> ---
>>>
>>> Changes in v3:
>>> - Drop patches already applied and rebase on u-boot-x86/master
>>> - New patch to add a new get_count method to cpu uclass
>>>
>>> Changes in v2: None
>>>
>>>  drivers/cpu/cpu-uclass.c | 10 ++++++++++
>>>  include/cpu.h            | 18 ++++++++++++++++++
>>>  2 files changed, 28 insertions(+)
>>>
>>> diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c
>>> index d6be9d4..8efb17c 100644
>>> --- a/drivers/cpu/cpu-uclass.c
>>> +++ b/drivers/cpu/cpu-uclass.c
>>> @@ -32,6 +32,16 @@ int cpu_get_info(struct udevice *dev, struct cpu_info *info)
>>>         return ops->get_info(dev, info);
>>>  }
>>>
>>> +int cpu_get_count(struct udevice *dev, int *count)
>>
>> Can we please return count and avoid the 'count' parameter? We can use
>> -ve for errors.
>>
>
> Yes, but I was wondering that if it looks inconsistent to other two
> cpu ops? (or maybe other dm driver ops?)

I think that if the return value needs to be a postive int, then we
should just use the return value. In other cases perhaps not. It is
slightly more efficient and a little easier to read.

Regards,
Simon

      reply	other threads:[~2015-06-16 22:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13 10:11 [U-Boot] [PATCH v3 1/6] dm: cpu: Add a new get_count method to cpu uclass Bin Meng
2015-06-15 20:45 ` Simon Glass
2015-06-16  0:19   ` Bin Meng
2015-06-16 22:10     ` Simon Glass [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=CAPnjgZ0otAYVbCBaWJ+ffxE5B8Mo3wKj0EOZYYUcSsYpfRx5fQ@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 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.