Re: [PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content
From: Scott Bauer <hidden>
Date: 2018-03-19 20:07:01
Also in:
lkml
From: Scott Bauer <hidden>
Date: 2018-03-19 20:07:01
Also in:
lkml
On Mon, Mar 19, 2018 at 08:59:45PM +0100, Christoph Hellwig wrote:
quoted
+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?
It will short circuit and bail out via can_add failing. So even though you have to go dig to see if the following functions handle the erorr I think it's slightly cleaner to have a single if (*err) in the deeper functions. This lest the error back out the call chain instead of having multiple if (*err) checks earlier in the call chains.