Skip to content
  • Markus Armbruster's avatar
    0de89a86
    hw/microblaze: Replace drive_get_next() by drive_get() · 0de89a86
    Markus Armbruster authored
    
    
    drive_get_next() is basically a bad idea.  It returns the "next" block
    backend of a certain interface type.  "Next" means bus=0,unit=N, where
    subsequent calls count N up from zero, per interface type.
    
    This lets you define unit numbers implicitly by execution order.  If the
    order changes, or new calls appear "in the middle", unit numbers change.
    ABI break.  Hard to spot in review.
    
    Machine "petalogix-ml605" connects backends with drive_get_next() in a
    counting loop.  Change it to use drive_get() directly.  This makes the
    unit numbers explicit in the code.
    
    Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20211117163409.3587705-10-armbru@redhat.com>
    Acked-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
    0de89a86
    hw/microblaze: Replace drive_get_next() by drive_get()
    Markus Armbruster authored
    
    
    drive_get_next() is basically a bad idea.  It returns the "next" block
    backend of a certain interface type.  "Next" means bus=0,unit=N, where
    subsequent calls count N up from zero, per interface type.
    
    This lets you define unit numbers implicitly by execution order.  If the
    order changes, or new calls appear "in the middle", unit numbers change.
    ABI break.  Hard to spot in review.
    
    Machine "petalogix-ml605" connects backends with drive_get_next() in a
    counting loop.  Change it to use drive_get() directly.  This makes the
    unit numbers explicit in the code.
    
    Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20211117163409.3587705-10-armbru@redhat.com>
    Acked-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Loading