All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Hoemann <jerry.hoemann@hpe.com>
To: Dmitry Krivenok <krivenok.dmitry@gmail.com>
Cc: ross.zwisler@linux.intel.com, rjw@rjwysocki.net, lenb@kernel.org,
	dan.j.williams@intel.com, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org
Subject: Re: [PATCH 3/4] nvdimm: Add IOCTL pass thru
Date: Mon, 9 Nov 2015 14:59:04 -0700	[thread overview]
Message-ID: <20151109215904.GB33245@tevye.fc.hp.com> (raw)
In-Reply-To: <CAJN_NGaPbziX=OcyYpcn5TP76HwGQSTsUz-yOVGB2Sh8VxDQjA@mail.gmail.com>


Dmitry,

thanks for you review.  Questions in-line.


On Sat, Nov 07, 2015 at 05:02:36PM +0300, Dmitry Krivenok wrote:
> > +       if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
> > +               dev_dbg(dev, "%s:%s cmd: %d input length: %d\n", __func__,
> > +                               dimm_name, cmd, in_buf.buffer.length);
> > +               print_hex_dump_debug("cmd: ", DUMP_PREFIX_OFFSET, 4,
> > +                               4, in_buf.buffer.pointer, min_t(u32, 128,
> > +                                       in_buf.buffer.length), true);
> > +       }
> 
> Maybe move this code to a helper function? There are 4 almost
> identical blocks now in acpi_nfit_ctl_passthru and
> acpi_nfit_ctl_intel.


Is your concern readibility or size of generated code (or both?)

I'll look to consolidating the debug printing in next version as additional patch.

> 
> > +       for (i = 0; i < ARRAY_SIZE(pkg.h.res); i++)
> > +               if (pkg.h.res[i])
> > +                       return -EINVAL;
> 
> I'd rename "res" to "reserved" for clarity.


Will do.



> 
> > +       /* This may be bigger that the fixed portion of the pakcage */
> 
> s/that/than/
> s/pakcage/package/


Will do.


> 
> > +               switch (type) {
> > +               case NVDIMM_TYPE_INTEL:
> > +                       rc = __nd_ioctl(nvdimm_bus, nvdimm, ro, cmd, arg);
> > +                       break;
> > +               case NVDIMM_TYPE_PASSTHRU:
> > +                       rc = __nd_ioctl_passthru(nvdimm_bus, nvdimm, ro, cmd, arg);
> > +                       break;
> > +               default:
> > +                       rc = -ENOTTY;
> > +               }
> 
> The same comment. Identical code in nd_ioctl and nvdimm_ioctl.
> Perhaps move to a helper function?


If we had a longer list, I would definitely say yes.  Not so sure with
just two types.  I'll take a look for the next version.


-- 

-----------------------------------------------------------------------------
Jerry Hoemann            Software Engineer      Hewlett-Packard Enterprise

3404 E Harmony Rd. MS 36                        phone:  (970) 898-1022
Ft. Collins, CO 80528                           FAX:    (970) 898-0707
                                                email:  jerry.hoemann@hpe.com
-----------------------------------------------------------------------------

WARNING: multiple messages have this Message-ID (diff)
From: Jerry Hoemann <jerry.hoemann@hpe.com>
To: Dmitry Krivenok <krivenok.dmitry@gmail.com>
Cc: ross.zwisler@linux.intel.com, rjw@rjwysocki.net, lenb@kernel.org,
	dan.j.williams@intel.com, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org
Subject: Re: [PATCH 3/4] nvdimm: Add IOCTL pass thru
Date: Mon, 9 Nov 2015 14:59:04 -0700	[thread overview]
Message-ID: <20151109215904.GB33245@tevye.fc.hp.com> (raw)
In-Reply-To: <CAJN_NGaPbziX=OcyYpcn5TP76HwGQSTsUz-yOVGB2Sh8VxDQjA@mail.gmail.com>


Dmitry,

thanks for you review.  Questions in-line.


On Sat, Nov 07, 2015 at 05:02:36PM +0300, Dmitry Krivenok wrote:
> > +       if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
> > +               dev_dbg(dev, "%s:%s cmd: %d input length: %d\n", __func__,
> > +                               dimm_name, cmd, in_buf.buffer.length);
> > +               print_hex_dump_debug("cmd: ", DUMP_PREFIX_OFFSET, 4,
> > +                               4, in_buf.buffer.pointer, min_t(u32, 128,
> > +                                       in_buf.buffer.length), true);
> > +       }
> 
> Maybe move this code to a helper function? There are 4 almost
> identical blocks now in acpi_nfit_ctl_passthru and
> acpi_nfit_ctl_intel.


Is your concern readibility or size of generated code (or both?)

I'll look to consolidating the debug printing in next version as additional patch.

> 
> > +       for (i = 0; i < ARRAY_SIZE(pkg.h.res); i++)
> > +               if (pkg.h.res[i])
> > +                       return -EINVAL;
> 
> I'd rename "res" to "reserved" for clarity.


Will do.



> 
> > +       /* This may be bigger that the fixed portion of the pakcage */
> 
> s/that/than/
> s/pakcage/package/


Will do.


> 
> > +               switch (type) {
> > +               case NVDIMM_TYPE_INTEL:
> > +                       rc = __nd_ioctl(nvdimm_bus, nvdimm, ro, cmd, arg);
> > +                       break;
> > +               case NVDIMM_TYPE_PASSTHRU:
> > +                       rc = __nd_ioctl_passthru(nvdimm_bus, nvdimm, ro, cmd, arg);
> > +                       break;
> > +               default:
> > +                       rc = -ENOTTY;
> > +               }
> 
> The same comment. Identical code in nd_ioctl and nvdimm_ioctl.
> Perhaps move to a helper function?


If we had a longer list, I would definitely say yes.  Not so sure with
just two types.  I'll take a look for the next version.


-- 

-----------------------------------------------------------------------------
Jerry Hoemann            Software Engineer      Hewlett-Packard Enterprise

3404 E Harmony Rd. MS 36                        phone:  (970) 898-1022
Ft. Collins, CO 80528                           FAX:    (970) 898-0707
                                                email:  jerry.hoemann@hpe.com
-----------------------------------------------------------------------------

  reply	other threads:[~2015-11-09 21:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 14:02 [PATCH 3/4] nvdimm: Add IOCTL pass thru Dmitry Krivenok
2015-11-07 14:02 ` Dmitry Krivenok
2015-11-09 21:59 ` Jerry Hoemann [this message]
2015-11-09 21:59   ` Jerry Hoemann
2015-11-10 15:05   ` Dmitry Krivenok
2015-11-10 15:05     ` Dmitry Krivenok
2015-11-11 21:44     ` Jerry Hoemann
2015-11-11 21:44       ` Jerry Hoemann
2015-11-11 21:52       ` Dmitry Krivenok
2015-11-11 21:52         ` Dmitry Krivenok
2015-11-12 15:33         ` Jerry Hoemann
2015-11-12 15:33           ` Jerry Hoemann
  -- strict thread matches above, loose matches on Subject: below --
2015-11-06 22:27 [PATCH 0/4] nvdimm: Add an IOCTL pass thru for DSM calls Jerry Hoemann
2015-11-06 22:27 ` [PATCH 3/4] nvdimm: Add IOCTL pass thru Jerry Hoemann
2015-11-06 22:27   ` Jerry Hoemann
2015-11-10 16:24   ` Jeff Moyer
2015-11-10 21:36     ` Jerry Hoemann
2015-11-10 21:45       ` Jeff Moyer
2015-11-10 22:15         ` Jerry Hoemann
2015-11-10 21:54   ` Jeff Moyer
2015-11-11  1:42     ` Jerry Hoemann

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=20151109215904.GB33245@tevye.fc.hp.com \
    --to=jerry.hoemann@hpe.com \
    --cc=dan.j.williams@intel.com \
    --cc=krivenok.dmitry@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rjw@rjwysocki.net \
    --cc=ross.zwisler@linux.intel.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.