Re: [OpenWrt-Devel] [PATCH 1/3] kernel: improve ubi auto attach code readability

2018-07-20 Thread Mathias Kresin
2018-07-20 11:39 GMT+02:00 Felix Fietkau : > On 2018-07-19 19:05, Mathias Kresin wrote: >> The early return on failed open of the mtd device allows to get rid of >> one level of indentation. >> >> Move the put_mtd_device() called on multiple error conditions to a goto >> label to use it later for m

Re: [OpenWrt-Devel] [PATCH 1/3] kernel: improve ubi auto attach code readability

2018-07-20 Thread Felix Fietkau
On 2018-07-19 19:05, Mathias Kresin wrote: > The early return on failed open of the mtd device allows to get rid of > one level of indentation. > > Move the put_mtd_device() called on multiple error conditions to a goto > label to use it later for more error conditions. > > While at it, make clea

[OpenWrt-Devel] [PATCH 1/3] kernel: improve ubi auto attach code readability

2018-07-19 Thread Mathias Kresin
The early return on failed open of the mtd device allows to get rid of one level of indentation. Move the put_mtd_device() called on multiple error conditions to a goto label to use it later for more error conditions. While at it, make clear that we only check for the UBI magic if the read from f