]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - fs/cbfs/cbfs.c
ARM: tegra: fix clock_get_periph_rate() for UART clocks
[karo-tx-uboot.git] / fs / cbfs / cbfs.c
index 1b25a15e48848081c34c396eb7e060d150327a61..6e1107d751bc63b7c0603bda218234c41d8cd03d 100644 (file)
@@ -1,22 +1,10 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#include <common.h>
 #include <cbfs.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
@@ -109,8 +97,8 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align,
                }
 
                swap_file_header(&header, fileHeader);
-               if (header.offset < sizeof(const struct cbfs_cachenode *) ||
-                               header.offset > header.len) {
+               if (header.offset < sizeof(struct cbfs_fileheader) ||
+                   header.offset > header.len) {
                        file_cbfs_result = CBFS_BAD_FILE;
                        return -1;
                }
@@ -118,9 +106,9 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align,
                newNode->type = header.type;
                newNode->data = start + header.offset;
                newNode->data_length = header.len;
-               name_len = header.offset - sizeof(struct cbfs_cachenode *);
+               name_len = header.offset - sizeof(struct cbfs_fileheader);
                newNode->name = (char *)fileHeader +
-                               sizeof(struct cbfs_cachenode *);
+                               sizeof(struct cbfs_fileheader);
                newNode->name_length = name_len;
                newNode->checksum = header.checksum;