Received: by 10.213.65.68 with SMTP id h4csp1783276imn; Mon, 19 Mar 2018 13:09:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELuhzsDMwTIjh+ubdqDELK9Vr9AfCJ3lxf3mBZ7It+hfPfC61jhe70YBE+qSO3H5qa7EyEwA X-Received: by 2002:a17:902:74c5:: with SMTP id f5-v6mr13513590plt.91.1521490149764; Mon, 19 Mar 2018 13:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521490149; cv=none; d=google.com; s=arc-20160816; b=ZPle5WvB2IiFcss4cKsaGeF+p/5+dwPkYXsAE2fMHAJ/JVBTvrHN+ufdbsGKN8Bq6X qR/oNRc//AMtl8GQrllKulZMHisIOnTxtx5yu+TZcLPxaE+6vf+eiAFugk6XCO1i4ewC z3EtnAOqViMTSnRnTVh2G5ZDOdIc89j4oDAf8hPFrs/ZU6yc/3wGx6LqmY+luswfbLoi ZMASo/yviu61NCCryPwvO3ntnwnIfW9SUrn8J/5usYypXh0DOjHS8ICvsNuk9GFBnvju 4CPJStz3Pt7Ep0BHol8akF2rTRYajwo9R0K1oVE7SW+I9Z2kcI9FYkcBO3PUidmWFOyt zH4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=n+nLbc1MYUSQPqkL05qgGnnfkcjFikYirsvJET1f0Dg=; b=hTCYFdWiN3Zw2bHa65q9ONHElsn/PN+FBjOJOgBMVEGrLahMxzN8KZXuRbNQF2ilu8 BdLekXsnAQBVV7k2U3Uoh3jJnehLM5zmSyet3vm5joxD/qy3QUWTQ8giVlSnlbHAmzRO 1NhWzai9Y4xS/1X0nOEeTRf3tZpfvpxf9zOFhtE2blYZjETz+5en1wegYJ473VlbGzdl R14/uOCvQ/cYbnNVyLNSTJAmeUIfUy3OYe1d+GEj0UxQf57hjdJlN6eX3FH9tm0CwJry bbC01eXrjx13i8bykJANZi81LGjNULiRP2sGb+ZXecL7uzlZ4lkZmvGsxl2a9IzZJ0/I nlOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8-v6si15445plz.31.2018.03.19.13.08.54; Mon, 19 Mar 2018 13:09:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969350AbeCSUHB (ORCPT + 99 others); Mon, 19 Mar 2018 16:07:01 -0400 Received: from mga06.intel.com ([134.134.136.31]:38925 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031351AbeCSUG4 (ORCPT ); Mon, 19 Mar 2018 16:06:56 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2018 13:06:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,331,1517904000"; d="scan'208";a="212758466" Received: from sbauer-z170x-ud5.lm.intel.com (HELO sbauer-Z170X-UD5) ([10.232.112.135]) by fmsmga006.fm.intel.com with ESMTP; 19 Mar 2018 13:06:54 -0700 Date: Mon, 19 Mar 2018 13:41:26 -0600 From: Scott Bauer To: Christoph Hellwig Cc: Jonas Rabenstein , Jonathan Derrick , Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content Message-ID: <20180319194126.ldamexpmw4ji7qi6@sbauer-Z170X-UD5> References: <0f5fe62576e70de12515e323ca5c0a45ef92832d.1521482296.git.jonas.rabenstein@studium.uni-erlangen.de> <20180319195945.GH3380@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180319195945.GH3380@lst.de> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > > 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.