[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <537E8E1F.9020303@linux.vnet.ibm.com>
Date: Thu, 22 May 2014 16:54:07 -0700
From: Cody P Schafer <cody@...ux.vnet.ibm.com>
To: Stephen Rothwell <sfr@...b.auug.org.au>
CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Michael Ellerman <mpe@...erman.id.au>, peterz@...radead.org,
linux-kernel@...r.kernel.org, michael@...erman.id.au,
mingo@...hat.com, paulus@...ba.org, imunsie@....ibm.com,
acme@...stprotocols.net, scottwood@...escale.com,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2] powerpc/perf/hv-24x7: use kmem_cache instead of aligned
stack allocations
On 05/22/2014 04:49 PM, Stephen Rothwell wrote:
> Hi Cody,
>
> On Thu, 22 May 2014 15:44:25 -0700 Cody P Schafer <cody@...ux.vnet.ibm.com> wrote:
>>
>> if (ret) {
>> if (success_expected)
>> pr_err_ratelimited("hcall failed: %d %#x %#x %d => 0x%lx (%ld) detail=0x%x failing ix=%x\n",
>> domain, offset, ix, lpar,
>> ret, ret,
>> - result_buffer.buf.detailed_rc,
>> - result_buffer.buf.failing_request_ix);
>> - return ret;
>> + result_buffer->buf.detailed_rc,
>> + result_buffer->buf.failing_request_ix);
>> + goto out_hcall;
>> }
>>
>> - *res = be64_to_cpu(result_buffer.result);
>> + *res = be64_to_cpu(result_buffer->result);
>
> not a biggie, but this last bit could be (remove the goto out_hcall and
> teh label and then)
>
> } else {
> *res = be64_to_cpu(result_buffer->result);
> }
>
I've got a slight preference toward keeping it as is, which lets all of
the non-error path code stay outside of if/else blocks (and the error
handling is kept ever so slightly more consistent).
>> +out_hcall:
>> + kfree(result_buffer);
>> +out_resb:
>> + kfree(request_buffer);
>> +out_reqb:
>> return ret;
>> }
>>
>
> otherwise looks good to me.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists