From: Ian Campbell Subject: Re: [PATCH] minios: Fix xenbus_rm() calls in frontend drivers Date: Fri, 6 Sep 2013 17:53:56 +0100 Message-ID: <1378486436.14745.171.camel@kazak.uk.xensource.com> References: <1378340720-8653-1-git-send-email-msw@linux.com> <1378372641.14745.4.camel@kazak.uk.xensource.com> <20130905180615.GA14603@u109add4315675089e695.ant.amazon.com> <1378458029.14745.74.camel@kazak.uk.xensource.com> <20130906162413.GA25128@u109add4315675089e695.ant.amazon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VHzIF-00009d-Eq for xen-devel@lists.xenproject.org; Fri, 06 Sep 2013 16:53:59 +0000 In-Reply-To: <20130906162413.GA25128@u109add4315675089e695.ant.amazon.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matt Wilson Cc: Ben Cressey , xen-devel@lists.xenproject.org, Stefano Stabellini , Matt Wilson , Samuel Thibault List-Id: xen-devel@lists.xenproject.org On Fri, 2013-09-06 at 09:24 -0700, Matt Wilson wrote: > On Fri, Sep 06, 2013 at 10:00:29AM +0100, Ian Campbell wrote: > > On Thu, 2013-09-05 at 11:06 -0700, Matt Wilson wrote: > > > On Thu, Sep 05, 2013 at 10:17:21AM +0100, Ian Campbell wrote: > > > > On Wed, 2013-09-04 at 17:25 -0700, Matt Wilson wrote: > [...] > > > > > char path[strlen(dev->backend) + 1 + 5 + 1]; > > > > > - char nodename[strlen(dev->nodename) + 1 + 5 + 1]; > > > > > + char nodename[strlen(dev->nodename) + 1 + 13 + 1]; > > > > > > > > These changes don't seem to be covered by the commit message? I assume > > > > they relate to the length of the longest suffix which we are appending, > > > > perhaps using strlen("some-string-const") would make this more obvious? > > > > > > Yes, those are length related changes. I'd like to keep the code as-is > > > (following the established pattern) for this round > > > > Why? What is the benefit to keeping it this way when you are changing it > > anyway? > > This should be cleaned up everywhere in a separate patch. There are > many other places where mini-os uses the existing pattern. > > [msw@carbon mini-os]$ git grep ') + 1 +' | wc -l > 27 > > http://wiki.xenproject.org/wiki/Submitting_Xen_Patches#Break_down_your_patches > > "Don't mix clean-up patches (which make things look prettier or move > things round but don't change functionality) with code-change > patches. Clean-up patches should be clearly marked as having no > functional changes." This is referring to mixing unrelated cleanup changes with code changes. This "cleanup" is not unrelated, in this case you are fixing a bug caused by incorrectly counting the length of a string, so it is reasonable to change it to use strlen as a single change. IOW the "cleanup" is actually the code-change, and a one which is more obviously correct than simply counting again. Ian.