summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorThomas Jarosch <tomj@simonv.com>2015-01-13 21:40:19 +0100
committerThomas Jarosch <tomj@simonv.com>2015-01-13 21:40:19 +0100
commit1212edd352e924111bb3db6330755b33f13fbe71 (patch)
treef399abf9b83b33ac4046cfdc3f74ac2d74a95f71 /firmware/drivers
parenta71603b4d17b1f7da06c77176a795a7464dc859a (diff)
Don't return pointer to array allocated on the stack
It will be out of scope once the function is left. cppcheck reported: [firmware/drivers/rtc/rtc_zenvisionm.c:31]: (error) Pointer to local array variable returned. [firmware/drivers/rtc/rtc_zenvisionm.c:38]: (error) Pointer to local array variable returned. Change-Id: Ibf28ba9b3d20cadcaff22398e143488c86746660
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/rtc/rtc_zenvisionm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/drivers/rtc/rtc_zenvisionm.c b/firmware/drivers/rtc/rtc_zenvisionm.c
index 77bf99088c..244d7557f0 100644
--- a/firmware/drivers/rtc/rtc_zenvisionm.c
+++ b/firmware/drivers/rtc/rtc_zenvisionm.c
@@ -25,15 +25,15 @@
unsigned char* rtc_send_command(short unk1, short unk2)
{
- unsigned char ret[12];
+ static unsigned char ret[12];
i2c_write(I2C_ADDRESS, (unk2 & 0xFF) | (unk << 8), 1);
i2c_read(I2C_ADDRESS, ret, 12);
return ret;
}
-
+
unsigned char* rtc_read(void)
{
- unsigned char ret[12];
+ static unsigned char ret[12];
i2c_read(I2C_ADDRESS, ret, 12);
return ret;
- } \ No newline at end of file
+ }