Attention is currently required from: Anastasia Klimchuk. Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/53947 )
Change subject: linux_mtd: move global state into programmer data field ......................................................................
Patch Set 4:
(3 comments)
File linux_mtd.c:
https://review.coreboot.org/c/flashrom/+/53947/comment/cdf8a3f1_1e18a8e9 PS3, Line 365: mtd_data->dev_fp = NULL;
Is this line needed? Data is freed below anyway and won't be reused. […]
Done
https://review.coreboot.org/c/flashrom/+/53947/comment/44e5ca1b_13b82ada PS3, Line 421: programmer_linux_mtd.data = data;
Just to double-check, data has 6 members and none of them is initialised in init function, is this W […]
`data` gets passed through to `linux_mtd_setup()` which then initializes it. I've added a comment since it's different to other programmers fully initialize `data` in the init function.
We could also pass the individual fields through to `linux_mtd_setup()` and `get_mtd_info()`, but I think this is quite a bit cleaner.
https://review.coreboot.org/c/flashrom/+/53947/comment/527580a3_b0365e98 PS3, Line 431: free(param);
Looking at the code, there is no reason to keep param until the very end, it can be freed just befor […]
There are still two different code paths in the code that parses the `dev` parameter, so we would need to call `free(param)` in both of them, but I think that would still be nicer.
As you say it's probably best to leave that for another patch.