I found this method quite hard to read and recognize what it do. I think something similar this way can be easier to understand:

```
def self.create_s390_ifcfg(hardware)
  hwaddr = InstallInf["HWAddr"]
  return "" if hwaddr.empty?
 
  netdevice = dev_name
  devtype = netdevice.empty? ? "" : NetworkInterfaces.GetType(netdevice)

  # hsi devices do not support setting hwaddr (bnc #479481)
  return "" if devtype == "hsi"
  # set HW address only for qeth set to Layer 2 (bnc #479481)
  return "" if devtype == "eth" && InstallInf["QETH_LAYER2_SUPPORT"] != "1"

  # only some card types need a persistent MAC (bnc#658708)
  sysfs_id = dev_name_to_sysfs_id(netdevice, hardware)
  return "" if !s390_device_needs_persistent_mac(sysfs_id, hardware)

  return "LLADDR='#{hwaddr}'\n"
end
```