opal_error_to_human shows how subtle and deep Spectre v1 can go. this one is probably not useful but it shows the evolving power of our Spectre v1 static analysis tool. only 2600+ instances to go through ;).
If the argument is potentially untrusted then it should have a speculation barrier between the bounds check and the array access. But if it's only being used to feed printk it's highly unlikely to be exploitable in a useful way. Seems like a silly example to pick.