linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Bauer <sbauer@plzdonthack.me>
To: David Kozub <zub@linux.fjfi.cvut.cz>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	hch@infradead.org, jonathan.derrick@intel.com
Subject: Re: [PATCH v2 09/16] block: sed-opal: split generation of bytestring header and content
Date: Sat, 19 Jan 2019 11:59:53 -0500	[thread overview]
Message-ID: <20190119165953.GA12171@hacktheplanet> (raw)

On Thu, Jan 17, 2019 at 09:31:49PM +0000, David Kozub wrote:
> -
> -	memcpy(&cmd->cmd[cmd->pos], bytestring, len);
> +	start = &cmd->cmd[cmd->pos];
>  	cmd->pos += len;

This is somewhat pendatic, but it helps me review patches if we keep things together.
Since we're no longer doing the memcpy in this function, can we please move the cmd->pos += len
to the location where we actually do the memcpy.

I'm willing to be told to get over it if other reviewers don't like that approach, but if no one cares
please move it.


> +	return start;
> +}
>  
> +static void add_token_bytestring(int *err, struct opal_dev *cmd,
> +				 const u8 *bytestring, size_t len)
> +{
> +	u8 *start;
> +
> +	start = add_bytestring_header(err, cmd, len);
> +	if (!start)
> +		return;
> +	memcpy(start, bytestring, len);

Do the above here instead.

> 2.20.1
> 
> 

             reply	other threads:[~2019-01-19 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-19 16:59 Scott Bauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-17 21:31 [PATCH v2 00/16] block: sed-opal: support shadow MBR done flag and write David Kozub
2019-01-17 21:31 ` [PATCH v2 09/16] block: sed-opal: split generation of bytestring header and content David Kozub

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=20190119165953.GA12171@hacktheplanet \
    --to=sbauer@plzdonthack.me \
    --cc=hch@infradead.org \
    --cc=jonathan.derrick@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zub@linux.fjfi.cvut.cz \
    /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).