#2085 NORM CTest: Thou shalt not arbitrarily munge data.

Zarro Boogs per Child bugtracker at laptop.org
Fri Jul 13 15:07:50 EDT 2007


#2085: Thou shalt not arbitrarily munge data.
---------------------+------------------------------------------------------
  Reporter:  krstic  |       Owner:  dilinger          
      Type:  defect  |      Status:  new               
  Priority:  normal  |   Milestone:  CTest             
 Component:  kernel  |     Version:  Git as of bug date
Resolution:          |    Keywords:                    
  Verified:  0       |  
---------------------+------------------------------------------------------
Comment (by wmb at firmworks.com):

 Regarding krstic's comment above:

 The raw data from the manufacturing tag includes a null terminator byte as
 specified in the wiki page about manufacturing data, so that null byte
 should be passed through.  If a python program needs to convert the string
 representation to some format that is more convenient for its use, it may
 do so, but should not expect the filesystem to do the work.

 The general format of an OFW device tree property value is a byte array
 containing the concatenation of 0 or more primitive items.  One primitive
 item type is a null-terminated text string.  A property value could well
 consist of the concatenation of several such null-terminated strings.  It
 just happens that the S# property contains a single null-terminated
 string, but that is not true of all property values in general.

 It is inappropriate for ofwfs to remove the final null, because that makes
 the invalid assumption that all property values consist of a single null-
 terminated text string.

 The right way to think of this is that ofwfs is a transparent transport
 mechanism for  data that is defined somewhere else.  The consumer of the
 data must know the format and deal with it.  The format of the S# and UUID
 tags is "one null-terminated string" (and quite a few, but not all, other
 device tree properties happen to use that format too).  That format was
 chosen for the convenience of C programs; it is obviously not ideal for
 all possible consumers of the information, but it is what it is, and it is
 not the business of a filesystem to redefine the data format for the
 benefit of specific consumers.

 Sorry to be so strident and pedantic about this, but it is important, and
 appears to have been misunderstood.

-- 
Ticket URL: <http://dev.laptop.org/ticket/2085#comment:5>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list