From: Reza Arbab <arbab@linux.ibm.com>
To: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: maddy@linux.ibm.com, dan@danny.cz, kjain@linux.ibm.com,
skiboot@lists.ozlabs.org, disgoel@linux.ibm.com,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [Skiboot] [PATCH V4 3/3] skiboot: Update IMC PMU node names for power10
Date: Wed, 22 Mar 2023 15:44:09 -0500 [thread overview]
Message-ID: <ZBtomRWcK4ni49df@arbab-laptop.austin.ibm.com> (raw)
In-Reply-To: <20230306033913.80524-3-atrajeev@linux.vnet.ibm.com>
On Mon, Mar 06, 2023 at 09:09:13AM +0530, Athira Rajeev wrote:
>+ } else if (proc_gen == proc_gen_p10) {
>+ int val;
>+ char al[8], xl[8], otl[8], phb[8];
Are four different variables needed here? I think you could just reuse
one temporary variable.
char name[8];
>+ for (i=0; i<8; i++) {
>+ val = ((avl_vec & (0x7ULL << (29 + (3 * i)))) >> (29 + (3 * i)));
>+ switch (val) {
>+ case 0x5: //xlink configured and functional
>+
>+ snprintf(al, sizeof(al), "alink%1d",(7-i));
>+ target = dt_find_by_name_substr(dev, al);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(otl, sizeof(otl),"otl%1d_0",(7-i));
>+ target = dt_find_by_name_substr(dev, otl);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(otl,sizeof(otl),"otl%1d_1",(7-i));
>+ target = dt_find_by_name_substr(dev, otl);
>+ if (target)
>+ dt_free(target);
>+
>+ break;
>+ case 0x6: //alink configured and functional
>+
>+ snprintf(xl,sizeof(xl),"xlink%1d",(7-i));
>+ target = dt_find_by_name_substr(dev, xl);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(otl,sizeof(otl),"otl%1d_0",(7-i));
>+ target = dt_find_by_name_substr(dev, otl);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(otl,sizeof(otl),"otl%1d_1",(7-i));
>+ target = dt_find_by_name_substr(dev, otl);
>+ if (target)
>+ dt_free(target);
>+ break;
>+
>+ case 0x7: //CAPI configured and functional
>+ snprintf(al,sizeof(al),"alink%1d",(7-i));
>+ target = dt_find_by_name_substr(dev, al);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(xl,sizeof(xl),"xlink%1d",(7-i));
>+ target = dt_find_by_name_substr(dev, xl);
>+ if (target)
>+ dt_free(target);
>+ break;
>+ default:
>+ snprintf(xl,sizeof(xl),"xlink%1d",(7-i));
>+ target = dt_find_by_name_substr(dev, xl);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(al,sizeof(al),"alink%1d",(7-i));
>+ target = dt_find_by_name_substr(dev, al);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(otl,sizeof(otl),"otl%1d_0",(7-i));
>+ target = dt_find_by_name_substr(dev, otl);
>+ if (target)
>+ dt_free(target);
>+
>+ snprintf(otl,sizeof(otl),"otl%1d_1",(7-i));
>+ target = dt_find_by_name_substr(dev, otl);
>+ if (target)
>+ dt_free(target);
>+ break;
As far as I know skiboot follows the kernel coding style. Would you mind
fixing up the minor style nits checkpatch.pl reports for this patch?
--
Reza Arbab
next prev parent reply other threads:[~2023-03-22 20:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 3:39 [PATCH V4 1/3] core/device: Add function to return child node using name at substring "@" Athira Rajeev
2023-03-06 3:39 ` [PATCH V4 2/3] skiboot: Update IMC code to use dt_find_by_name_substr for checking dt nodes Athira Rajeev
2023-03-06 3:39 ` [PATCH V4 3/3] skiboot: Update IMC PMU node names for power10 Athira Rajeev
2023-03-22 20:44 ` Reza Arbab [this message]
2023-04-03 4:04 ` [Skiboot] " Athira Rajeev
2023-03-10 6:19 ` [PATCH V4 1/3] core/device: Add function to return child node using name at substring "@" Athira Rajeev
2023-03-22 20:12 ` [Skiboot] " Reza Arbab
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=ZBtomRWcK4ni49df@arbab-laptop.austin.ibm.com \
--to=arbab@linux.ibm.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=dan@danny.cz \
--cc=disgoel@linux.ibm.com \
--cc=kjain@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=skiboot@lists.ozlabs.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).