[coreboot] [flashrom][PATCH] invalid local variable declaration
stephan.guilloux at free.fr
stephan.guilloux at free.fr
Tue Jun 23 10:42:32 CEST 2009
Hello all,
To start teh day, a small patch for an invalid local variable...
In C, local variable must be declared before any statment, and not, like in C++
in the middle of the function.
Make good use of it.
Regards,
Stephan.
Signed-off-by: Stephan Guilloux <stephan.guilloux at free.fr>
diff -rc flashrom-623/physmap.c flashrom-623.new/physmap.c
*** flashrom-623/physmap.c Tue Jun 23 07:28:15 2009
--- flashrom-623.new/physmap.c Tue Jun 23 09:46:01 2009
***************
*** 80,85 ****
--- 80,87 ----
void *physmap(const char *descr, unsigned long phys_addr, size_t len)
{
+ void *virt_addr;
+
if (len == 0) {
printf_debug("Not mapping %s, zero size at 0x%08lx.\n",
descr, phys_addr);
***************
*** 96,102 ****
descr, (unsigned long)len, phys_addr);
}
! void *virt_addr = sys_physmap(phys_addr, len);
if (NULL == virt_addr) {
if (NULL == descr)
--- 98,104 ----
descr, (unsigned long)len, phys_addr);
}
! virt_addr = sys_physmap(phys_addr, len);
if (NULL == virt_addr) {
if (NULL == descr)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flashrom-623.patch
Type: application/octet-stream
Size: 777 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090623/d26eff0d/attachment.obj>
More information about the coreboot
mailing list