Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35827 )
Change subject: drivers/pc80/rtc: Cache cmos_layout.bin region device ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35827/3/src/drivers/pc80/rtc/mc1468... File src/drivers/pc80/rtc/mc146818rtc.c:
https://review.coreboot.org/c/coreboot/+/35827/3/src/drivers/pc80/rtc/mc1468... PS3, Line 278: rdev = car_get_ptr(layout_rdev_p); Not sure if we are still talking about the same problem :)
I suggest making the parameter a `struct region_device **const`.
This actually suggested two changes:
1. Use a pointer to a pointer. 2. Make the local variable `const`.
1. Would force an update to the caller and could solve the problem of the change, i.e. we want to return a pointer to a global struct instead of changing a given struct.
2. Just because I would have declared `rdev` `const` in the first place. If that would have been the case from the beginning, the compiler would already have rejected Arthur's patch.