Am 16.09.2015 um 03:15 schrieb Siarhei Siamashka:
Yes, caching the pointer inside of aw_fel_get_sram_info() function and avoiding repeated usb requests is a good idea. Just make it a static variable instead of global.
Retrieving the version information (struct aw_fel_version) involves a USB operation, but is 'safe' even for unknown SoCs. So main() is doing that only once, and as soon as it got a usable USB endpoint. It's a question of visibility. I'd like aw_fel_get_sram_info() to work with that existing data - so we either need it within global scope, or have to pass it as parameter to the function. The latter once again tends to make the function calls more complicated / less readable. I could work around it by applying a similar "caching" logic to aw_fel_get_version(), but my impression is that we might be trying (too?) hard to 'hide' data that actually is of "global" nature. Regards, B. Nortmann -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
