Re: [PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content

2018-03-19 Thread Scott Bauer
On Mon, Mar 19, 2018 at 08:59:45PM +0100, Christoph Hellwig wrote: > > +static u8 *add_bytestring_header(int *err, struct opal_dev *cmd, size_t > > len) > > { > > size_t header_len = 1; > > bool is_short_atom = true; > > - > > - if (*err) > > - return; > > + char *start; >

Re: [PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content

2018-03-19 Thread Christoph Hellwig
> +static u8 *add_bytestring_header(int *err, struct opal_dev *cmd, size_t len) > { > size_t header_len = 1; > bool is_short_atom = true; > - > - if (*err) > - return; > + char *start; Shouldn't this also return early if we have a pending error? Except for that th

[PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content

2018-03-19 Thread Jonas Rabenstein
Split the header generation from the (normal) memcpy part if a bytestring is copied into the command buffer. This allows in-place generation of the bytestring content. For example, copy_from_user may be used without an intermediate buffer. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-o