Received: by 10.223.185.116 with SMTP id b49csp2918149wrg; Mon, 5 Mar 2018 10:43:30 -0800 (PST) X-Google-Smtp-Source: AG47ELt+krRlx+tOInQ8M/CeTCW3Q94cQGDEReLU2C2HrMK0n1VyIYgWGu69F9AfOgVOF51vQcMH X-Received: by 2002:a17:902:1c5:: with SMTP id b63-v6mr14245268plb.311.1520275410565; Mon, 05 Mar 2018 10:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520275410; cv=none; d=google.com; s=arc-20160816; b=t2/iAR3QoZXp+2xTMiYYQdRTDt61yyC8TdQfE9aFO/26apr5l1fZA0eVaKpnyrM3ff 9lgOsoLPh7y8xH3rLFiG6APpWCZrdyZRYpSO260j0PCZijmDyaKQ3zoDSt6Dcd+q0AYd CIR7C8HTB2LIryjBp4fgpj3F5tsWd4jFVT1B/3ocLW8SaT9Kpa0EqaxUcr7nY2MqbY8/ EHrJM+zRqhUwXPzNuxLvJ9Ei8SfQXvWB4vku4yyAeUfAk5aT0L1A/uCRpt/eW1glsg62 +dtUN+KKE+yzQ55VyWshXd+q6L9fZWFgZW+MgdkTIpNo1A5vS4tZ3h1+IGMy/H0soj0D RBXQ== 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=54BWUs0cbSf28J76z6QWalGzPWXq+KYMQ8fpRJy0psA=; b=VzH7tQBy+UhpL1alhIJ+KDb+RTWgJ/FYP/fKAjGxlrodG8Ad2TxtwBNpaNvtGKVFLC 1+5DAOavLdskOeMl7lBfnLlW6PvEvMgL0toJ1oqVTTBe0TYmhM9G+keAatQUDSPG2G/d XtJhEgHZ2s/8iE/+rQEFlXlktlaRA+KgT5FutwYlOAaA3y6QmSbUZNRVq51Lw3PmKjld L4jsjv1suGA/w+KX1rT/8Etf0UYx82xv4qmQH4qT5CFcW3sP64FI0Bfkz421dpd8z8PB WbXX3A5D69ZjpqEbTQ6wsxVPhPVFaKI1M7qINkknaxCH948RRB+caspULktTSzNOBpEp JTkg== 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 j62si8690930pgc.583.2018.03.05.10.43.15; Mon, 05 Mar 2018 10:43:30 -0800 (PST) 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 S1752722AbeCESmV (ORCPT + 99 others); Mon, 5 Mar 2018 13:42:21 -0500 Received: from mga18.intel.com ([134.134.136.126]:27359 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110AbeCESmU (ORCPT ); Mon, 5 Mar 2018 13:42:20 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 10:42:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,428,1515484800"; d="scan'208";a="22216936" Received: from theros.lm.intel.com (HELO linux.intel.com) ([10.232.112.164]) by orsmga007.jf.intel.com with ESMTP; 05 Mar 2018 10:42:19 -0800 Date: Mon, 5 Mar 2018 11:42:19 -0700 From: Ross Zwisler To: Ross Zwisler Cc: Dan Williams , linux-nvdimm@lists.01.org, Dave Jiang , Vishal L Verma , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] nfit_test: improve structure offset handling Message-ID: <20180305184219.GA30168@linux.intel.com> References: <20180227172952.22177-1-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180227172952.22177-1-ross.zwisler@linux.intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 27, 2018 at 10:29:50AM -0700, Ross Zwisler wrote: > In nfit_test0_setup() and nfit_test1_setup() we keep an 'offset' value > which we use to calculate where in our 'nfit_buf' we will place our next > structure. The handling of 'offset' and the calculation of the placement > of the next structure is a bit inconsistent, though. We don't update > 'offset' after we insert each structure, sometimes causing us to update it > for multiple structures' sizes at once. When calculating the position of > the next structure we aren't always able to just use 'offset', but > sometimes have to add in other structure sizes as well. > > Fix this by updating 'offset' after each structure insertion in a > consistent way, allowing us to always calculate the position of the next > structure to be inserted by just using 'nfit_buf + offset'. > > Signed-off-by: Ross Zwisler Ping on this series.