public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "mika.westerberg@linux.intel.com" <mika.westerberg@linux.intel.com>
To: Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	"logang@deltatee.com" <logang@deltatee.com>
Subject: Re: [PATCH 1/1] PCI: Add hp_mmio_size and hp_mmio_pref_size parameters
Date: Wed, 23 Oct 2019 13:43:45 +0300	[thread overview]
Message-ID: <20191023104345.GY2819@lahna.fi.intel.com> (raw)
In-Reply-To: <SL2P216MB0187E0B5D83583094065CA35806B0@SL2P216MB0187.KORP216.PROD.OUTLOOK.COM>

On Wed, Oct 23, 2019 at 10:33:42AM +0000, Nicholas Johnson wrote:
> On Wed, Oct 23, 2019 at 01:03:59PM +0300, mika.westerberg@linux.intel.com wrote:
> > On Wed, Oct 23, 2019 at 09:57:17AM +0000, Nicholas Johnson wrote:
> > > On Wed, Oct 23, 2019 at 12:47:43PM +0300, mika.westerberg@linux.intel.com wrote:
> > > > On Wed, Oct 23, 2019 at 08:37:48AM +0000, Nicholas Johnson wrote:
> > > > >  			} else if (!strncmp(str, "hpmemsize=", 10)) {
> > > > > -				pci_hotplug_mem_size = memparse(str + 10, &str);
> > > > > +				pci_hotplug_mmio_size =
> > > > > +					memparse(str + 10, &str);
> > > > > +				pci_hotplug_mmio_pref_size =
> > > > > +					memparse(str + 10, &str);
> > > > 
> > > > Does this actually work correctly? The first memparse(str + 10, &str)
> > > > modifies str so the next call will not start from the correct position
> > > > anymore.
> > > I have been using this for a long time now and have not had any issues.
> > > Does it modify str? I thought that was done by the loop.
> > 
> > If you add "hpmemsize=xxx" in the command line and print both
> > pci_hotplug_mmio_size and pci_hotplug_mmio_pref_size after the
> > assignment, do they have the same value? If yes, then there is no
> > problem.
> Looking at lib/cmdline.c line 125, it looks like there is no point in me 
> testing it. It looks like you are right.
> 
> What is the better fix?
> 
> pci_hotplug_mmio_size = pci_hotplug_mmio_pref_size = memparse(str + 10, &str);
> 
> ^ Could be too long, even if we are ignoring the 80-character limit.

I prefer this:

				pci_hotplug_mmio_size = memparse(str + 10, &str);
				pci_hotplug_mmio_pref_size = pci_hotplug_mmio_size;

And you can ignore the 80-char limit. The above is much more readable
IMHO.

      reply	other threads:[~2019-10-23 10:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  8:37 [PATCH 1/1] PCI: Add hp_mmio_size and hp_mmio_pref_size parameters Nicholas Johnson
2019-10-23  9:47 ` mika.westerberg
2019-10-23  9:57   ` Nicholas Johnson
2019-10-23 10:03     ` mika.westerberg
2019-10-23 10:33       ` Nicholas Johnson
2019-10-23 10:43         ` mika.westerberg [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=20191023104345.GY2819@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=nicholas.johnson-opensource@outlook.com.au \
    /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