All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Fan Ni <fan.ni@samsung.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	 "Michael S . Tsirkin" <mst@redhat.com>,
	"linuxarm@huawei.com" <linuxarm@huawei.com>
Subject: Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
Date: Thu, 28 Sep 2023 13:22:57 +0100	[thread overview]
Message-ID: <20230928132257.000039ce@Huawei.com> (raw)
In-Reply-To: <20230927191327.GA4138120@sjcvldevvm72>

On Wed, 27 Sep 2023 19:13:35 +0000
Fan Ni <fan.ni@samsung.com> wrote:

> On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote:
> 
> > Rename the version not burried in the macro to cap_h.  
> The change looks good to me. Just one minor thing. why "version" get
> involved here?
>

Used in the sense of two copies of something with slightly differences
given if it were straight code without a macro, we'd have just
have used the copy being changed here for all of the calls. 
With hindsight, not the best word to choose given the many other meanings!

Jonathan


> Fan
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> > 
> > I had another instance of this in a series I'll post later today.
> > Cleaned that up the same way.
> > 
> >  hw/cxl/cxl-device-utils.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
> > index 517f06d869..bd68328032 100644
> > --- a/hw/cxl/cxl-device-utils.c
> > +++ b/hw/cxl/cxl-device-utils.c
> > @@ -283,13 +283,13 @@ static void memdev_reg_init_common(CXLDeviceState *cxl_dstate) { }
> >  
> >  void cxl_device_register_init_common(CXLDeviceState *cxl_dstate)
> >  {
> > -    uint64_t *cap_hdrs = cxl_dstate->caps_reg_state64;
> > +    uint64_t *cap_h = cxl_dstate->caps_reg_state64;
> >      const int cap_count = 3;
> >  
> >      /* CXL Device Capabilities Array Register */
> > -    ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_ID, 0);
> > -    ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_VERSION, 1);
> > -    ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_COUNT, cap_count);
> > +    ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_ID, 0);
> > +    ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_VERSION, 1);
> > +    ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_COUNT, cap_count);
> >  
> >      cxl_device_cap_init(cxl_dstate, DEVICE_STATUS, 1, 2);
> >      device_reg_init_common(cxl_dstate);
> > -- 
> > 2.39.2
> >  



  reply	other threads:[~2023-09-28 12:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230925152310uscas1p1b621d173ac0c0ce2163e4f2c788e4fdf@uscas1p1.samsung.com>
2023-09-25 15:22 ` [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs Jonathan Cameron via
2023-09-27 19:13   ` Fan Ni
2023-09-28 12:22     ` Jonathan Cameron via [this message]
2023-09-29  7:50       ` Markus Armbruster
2023-10-03 17:20         ` Fan Ni
2023-10-03 13:28   ` Michael S. Tsirkin
2023-10-03 17:21   ` Fan Ni
2023-10-04 10:32   ` Markus Armbruster

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=20230928132257.000039ce@Huawei.com \
    --to=qemu-devel@nongnu.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=armbru@redhat.com \
    --cc=fan.ni@samsung.com \
    --cc=linuxarm@huawei.com \
    --cc=mst@redhat.com \
    /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.