From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/8] cmd: cpu: fix NULL cpu feature prints
Date: Sat, 15 Apr 2017 19:16:03 +0200 [thread overview]
Message-ID: <856f831d-8bcc-e6a7-ebb8-b696cd0dd39e@gmail.com> (raw)
In-Reply-To: <3e76468f-f3ae-38f2-c32d-d88a40921262@gmail.com>
Hi Daniel,
El 14/04/2017 a las 19:43, Daniel Schwierzeck escribió:
> +cc Simon
>
> Am 13.04.2017 um 17:52 schrieb Álvaro Fernández Rojas:
>> Commit 740d5d3 added two new features but only one feature name,
>> which results in NULL prints when device_id feature is selected.
>> Fix this by not printing features without a corresponding name.
>>
>> Before:
>> HG556a # cpu detail
>> -1: cpu at 0 BCM6358A1
>> ID = 0, freq = 300 MHz: L1 cache, MMU, NULL
>> Device ID 0x2a010
>> -1: cpu at 1 BCM6358A1
>> ID = 1, freq = 300 MHz: L1 cache, MMU, NULL
>> Device ID 0x2a010
>> After:
>> HG556a # cpu detail
>> -1: cpu at 0 BCM6358A1
>> ID = 0, freq = 300 MHz: L1 cache, MMU
>> Device ID 0x2a010
>> -1: cpu at 1 BCM6358A1
>> ID = 1, freq = 300 MHz: L1 cache, MMU
>> Device ID 0x2a010
>>
>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>> ---
>> cmd/cpu.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/cmd/cpu.c b/cmd/cpu.c
>> index bc4dc5c..14053d2 100644
>> --- a/cmd/cpu.c
>> +++ b/cmd/cpu.c
>> @@ -52,7 +52,8 @@ static int print_cpu_list(bool detail)
>> print_freq(info.cpu_freq, "");
>> first = true;
>> for (i = 0; i < CPU_FEAT_COUNT; i++) {
>> - if (info.features & (1 << i)) {
>> + if (info.features & (1 << i) &&
>> + cpu_feature_name[i] != NULL) {
>> printf("%s%s", first ? ": " : ", ",
>> cpu_feature_name[i]);
>> first = false;
>>
>
> wouldn't be adding the missing feature name the better fix?
The thing is I wouldn't print Microcode feature either, because it's printed right below if it's really avaiable and I don't see the point of printing it twice (first just a description and then the actual device id too, and the same goes for microcode).
If I fix it like you suggest we will have the following:
HG556a # cpu detail
-1: cpu at 0 BCM6358A1
ID = 0, freq = 300 MHz: L1 cache, MMU, *Device ID*
*Device ID 0x2a010*
-1: cpu at 1 BCM6358A1
ID = 1, freq = 300 MHz: L1 cache, MMU, *Device ID*
*Device ID 0x2a010*
>
next prev parent reply other threads:[~2017-04-15 17:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1492098775-3518-1-git-send-email-noltari@gmail.com>
[not found] ` <1492098775-3518-2-git-send-email-noltari@gmail.com>
2017-04-14 17:43 ` [U-Boot] [PATCH 1/8] cmd: cpu: fix NULL cpu feature prints Daniel Schwierzeck
2017-04-15 17:16 ` Álvaro Fernández Rojas [this message]
[not found] ` <1492098775-3518-5-git-send-email-noltari@gmail.com>
2017-04-14 18:19 ` [U-Boot] [PATCH 4/8] serial: add serial driver for BCM6345 Daniel Schwierzeck
2017-04-15 17:17 ` Álvaro Fernández Rojas
[not found] ` <1492098775-3518-8-git-send-email-noltari@gmail.com>
2017-04-14 18:26 ` [U-Boot] [PATCH 7/8] mips: bmips: fix ioremap for BCM6358 Daniel Schwierzeck
2017-04-15 17:18 ` Álvaro Fernández Rojas
2017-04-15 18:08 ` Álvaro Fernández Rojas
2017-04-15 18:48 ` Daniel Schwierzeck
2017-04-15 19:15 ` Álvaro Fernández Rojas
[not found] ` <1492098775-3518-9-git-send-email-noltari@gmail.com>
2017-04-14 19:05 ` [U-Boot] [PATCH 8/8] mips: bmips: add support for raw .elf images Daniel Schwierzeck
2017-04-15 17:19 ` Álvaro Fernández Rojas
2017-04-15 18:10 ` Álvaro Fernández Rojas
2017-04-15 18:54 ` Daniel Schwierzeck
2017-04-15 19:14 ` Álvaro Fernández Rojas
2017-04-15 19:30 ` Álvaro Fernández Rojas
[not found] ` <1492098775-3518-6-git-send-email-noltari@gmail.com>
2017-04-14 19:23 ` [U-Boot] [PATCH 5/8] mips: add support for Broadcom MIPS Daniel Schwierzeck
2017-04-15 17:24 ` Álvaro Fernández Rojas
2017-04-13 15:44 [U-Boot] [PATCH 0/8] Add support for Broadcom MIPS SoCs Álvaro Fernández Rojas
2017-04-13 15:44 ` [U-Boot] [PATCH 1/8] cmd: cpu: fix NULL cpu feature prints Álvaro Fernández Rojas
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=856f831d-8bcc-e6a7-ebb8-b696cd0dd39e@gmail.com \
--to=noltari@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox