mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 07:51:38 +00:00
cbfs: Rename camel-case variables
Rename some camel-case variables to match U-Boot style. Camel case is not generally allowed in U-Boot. Rename this variable to fit in with the style. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
630b2f39dd
commit
ad79d603aa
1 changed files with 22 additions and 22 deletions
|
@ -73,14 +73,14 @@ static void swap_file_header(struct cbfs_fileheader *dest,
|
||||||
* @param start The location in memory to start from.
|
* @param start The location in memory to start from.
|
||||||
* @param size The size of the memory region to search.
|
* @param size The size of the memory region to search.
|
||||||
* @param align The alignment boundaries to check on.
|
* @param align The alignment boundaries to check on.
|
||||||
* @param newNode A pointer to the file structure to load.
|
* @param new_node A pointer to the file structure to load.
|
||||||
* @param used A pointer to the count of of bytes scanned through,
|
* @param used A pointer to the count of of bytes scanned through,
|
||||||
* including the file if one is found.
|
* including the file if one is found.
|
||||||
*
|
*
|
||||||
* @return 1 if a file is found, 0 if one isn't.
|
* @return 1 if a file is found, 0 if one isn't.
|
||||||
*/
|
*/
|
||||||
static int file_cbfs_next_file(struct cbfs_priv *priv, u8 *start, u32 size,
|
static int file_cbfs_next_file(struct cbfs_priv *priv, u8 *start, u32 size,
|
||||||
u32 align, struct cbfs_cachenode *newNode,
|
u32 align, struct cbfs_cachenode *new_node,
|
||||||
u32 *used)
|
u32 *used)
|
||||||
{
|
{
|
||||||
struct cbfs_fileheader header;
|
struct cbfs_fileheader header;
|
||||||
|
@ -88,34 +88,34 @@ static int file_cbfs_next_file(struct cbfs_priv *priv, u8 *start, u32 size,
|
||||||
*used = 0;
|
*used = 0;
|
||||||
|
|
||||||
while (size >= align) {
|
while (size >= align) {
|
||||||
const struct cbfs_fileheader *fileHeader =
|
const struct cbfs_fileheader *file_header =
|
||||||
(const struct cbfs_fileheader *)start;
|
(const struct cbfs_fileheader *)start;
|
||||||
u32 name_len;
|
u32 name_len;
|
||||||
u32 step;
|
u32 step;
|
||||||
|
|
||||||
/* Check if there's a file here. */
|
/* Check if there's a file here. */
|
||||||
if (memcmp(good_file_magic, &(fileHeader->magic),
|
if (memcmp(good_file_magic, &file_header->magic,
|
||||||
sizeof(fileHeader->magic))) {
|
sizeof(file_header->magic))) {
|
||||||
*used += align;
|
*used += align;
|
||||||
size -= align;
|
size -= align;
|
||||||
start += align;
|
start += align;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
swap_file_header(&header, fileHeader);
|
swap_file_header(&header, file_header);
|
||||||
if (header.offset < sizeof(struct cbfs_fileheader)) {
|
if (header.offset < sizeof(struct cbfs_fileheader)) {
|
||||||
priv->result = CBFS_BAD_FILE;
|
priv->result = CBFS_BAD_FILE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
newNode->next = NULL;
|
new_node->next = NULL;
|
||||||
newNode->type = header.type;
|
new_node->type = header.type;
|
||||||
newNode->data = start + header.offset;
|
new_node->data = start + header.offset;
|
||||||
newNode->data_length = header.len;
|
new_node->data_length = header.len;
|
||||||
name_len = header.offset - sizeof(struct cbfs_fileheader);
|
name_len = header.offset - sizeof(struct cbfs_fileheader);
|
||||||
newNode->name = (char *)fileHeader +
|
new_node->name = (char *)file_header +
|
||||||
sizeof(struct cbfs_fileheader);
|
sizeof(struct cbfs_fileheader);
|
||||||
newNode->name_length = name_len;
|
new_node->name_length = name_len;
|
||||||
newNode->attributes_offset = header.attributes_offset;
|
new_node->attributes_offset = header.attributes_offset;
|
||||||
|
|
||||||
step = header.len;
|
step = header.len;
|
||||||
if (step % align)
|
if (step % align)
|
||||||
|
@ -132,15 +132,15 @@ static void file_cbfs_fill_cache(struct cbfs_priv *priv, u8 *start, u32 size,
|
||||||
u32 align)
|
u32 align)
|
||||||
{
|
{
|
||||||
struct cbfs_cachenode *cache_node;
|
struct cbfs_cachenode *cache_node;
|
||||||
struct cbfs_cachenode *newNode;
|
struct cbfs_cachenode *new_node;
|
||||||
struct cbfs_cachenode **cache_tail = &priv->file_cache;
|
struct cbfs_cachenode **cache_tail = &priv->file_cache;
|
||||||
|
|
||||||
/* Clear out old information. */
|
/* Clear out old information. */
|
||||||
cache_node = priv->file_cache;
|
cache_node = priv->file_cache;
|
||||||
while (cache_node) {
|
while (cache_node) {
|
||||||
struct cbfs_cachenode *oldNode = cache_node;
|
struct cbfs_cachenode *old_node = cache_node;
|
||||||
cache_node = cache_node->next;
|
cache_node = cache_node->next;
|
||||||
free(oldNode);
|
free(old_node);
|
||||||
}
|
}
|
||||||
priv->file_cache = NULL;
|
priv->file_cache = NULL;
|
||||||
|
|
||||||
|
@ -148,20 +148,20 @@ static void file_cbfs_fill_cache(struct cbfs_priv *priv, u8 *start, u32 size,
|
||||||
int result;
|
int result;
|
||||||
u32 used;
|
u32 used;
|
||||||
|
|
||||||
newNode = (struct cbfs_cachenode *)
|
new_node = (struct cbfs_cachenode *)
|
||||||
malloc(sizeof(struct cbfs_cachenode));
|
malloc(sizeof(struct cbfs_cachenode));
|
||||||
result = file_cbfs_next_file(priv, start, size, align, newNode,
|
result = file_cbfs_next_file(priv, start, size, align, new_node,
|
||||||
&used);
|
&used);
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
free(newNode);
|
free(new_node);
|
||||||
return;
|
return;
|
||||||
} else if (result == 0) {
|
} else if (result == 0) {
|
||||||
free(newNode);
|
free(new_node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*cache_tail = newNode;
|
*cache_tail = new_node;
|
||||||
cache_tail = &newNode->next;
|
cache_tail = &new_node->next;
|
||||||
|
|
||||||
size -= used;
|
size -= used;
|
||||||
start += used;
|
start += used;
|
||||||
|
|
Loading…
Add table
Reference in a new issue