]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: fsp: Drop get_hob_type() and get_hob_length()
authorBin Meng <bmeng.cn@gmail.com>
Tue, 6 Jan 2015 06:04:36 +0000 (14:04 +0800)
committerSimon Glass <sjg@chromium.org>
Tue, 13 Jan 2015 15:25:02 +0000 (07:25 -0800)
These two are not worth having separate inline functions as they are
really simple, so drop them.

Also changed 'type' parameter of fsp_get_next_hob() from u16 to uint.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
arch/x86/cpu/queensbay/fsp_support.c
arch/x86/cpu/queensbay/tnc_dram.c
arch/x86/include/asm/arch-queensbay/fsp/fsp_hob.h
arch/x86/include/asm/arch-queensbay/fsp/fsp_support.h
arch/x86/lib/cmd_hob.c

index 4764e3c62f8928038a9450ec2ff5e915782ef6fb..aed3e2b300598a554d399938ef56b7a08cad554e 100644 (file)
@@ -242,7 +242,7 @@ u32 fsp_get_usable_lowmem_top(const void *hob_list)
        /* * Collect memory ranges */
        top = FSP_LOWMEM_BASE;
        while (!end_of_hob(hdr)) {
-               if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+               if (hdr->type == HOB_TYPE_RES_DESC) {
                        res_desc = (struct hob_res_desc *)hdr;
                        if (res_desc->type == RES_SYS_MEM) {
                                phys_start = res_desc->phys_start;
@@ -271,7 +271,7 @@ u64 fsp_get_usable_highmem_top(const void *hob_list)
        /* Collect memory ranges */
        top = FSP_HIGHMEM_BASE;
        while (!end_of_hob(hdr)) {
-               if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+               if (hdr->type == HOB_TYPE_RES_DESC) {
                        res_desc = (struct hob_res_desc *)hdr;
                        if (res_desc->type == RES_SYS_MEM) {
                                phys_start = res_desc->phys_start;
@@ -297,7 +297,7 @@ u64 fsp_get_reserved_mem_from_guid(const void *hob_list, u64 *len,
 
        /* Collect memory ranges */
        while (!end_of_hob(hdr)) {
-               if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+               if (hdr->type == HOB_TYPE_RES_DESC) {
                        res_desc = (struct hob_res_desc *)hdr;
                        if (res_desc->type == RES_MEM_RESERVED) {
                                if (compare_guid(&res_desc->owner, guid)) {
@@ -342,7 +342,7 @@ u32 fsp_get_tseg_reserved_mem(const void *hob_list, u32 *len)
        return base;
 }
 
-const struct hob_header *fsp_get_next_hob(u16 type, const void *hob_list)
+const struct hob_header *fsp_get_next_hob(uint type, const void *hob_list)
 {
        const struct hob_header *hdr;
 
@@ -350,7 +350,7 @@ const struct hob_header *fsp_get_next_hob(u16 type, const void *hob_list)
 
        /* Parse the HOB list until end of list or matching type is found */
        while (!end_of_hob(hdr)) {
-               if (get_hob_type(hdr) == type)
+               if (hdr->type == type)
                        return hdr;
 
                hdr = get_next_hob(hdr);
index b669dbc98b4d83a456b59fbe5859fdec3c3f4ba9..df79a39dd8e1eb901e05d199c8c5f965510e2c10 100644 (file)
@@ -19,7 +19,7 @@ int dram_init(void)
 
        hdr = gd->arch.hob_list;
        while (!end_of_hob(hdr)) {
-               if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+               if (hdr->type == HOB_TYPE_RES_DESC) {
                        res_desc = (struct hob_res_desc *)hdr;
                        if (res_desc->type == RES_SYS_MEM ||
                            res_desc->type == RES_MEM_RESERVED) {
@@ -63,7 +63,7 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
        hdr = gd->arch.hob_list;
 
        while (!end_of_hob(hdr)) {
-               if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+               if (hdr->type == HOB_TYPE_RES_DESC) {
                        res_desc = (struct hob_res_desc *)hdr;
                        entries[num_entries].addr = res_desc->phys_start;
                        entries[num_entries].size = res_desc->len;
index 51103617b098d397b3138835ee4c0b67e4318193..6cca7f5654192db293c6a2af7db48ec22fa92245 100644 (file)
@@ -182,36 +182,6 @@ struct hob_guid {
        /* GUID specific data goes here */
 };
 
-/**
- * get_hob_type() - return the type of a HOB
- *
- * This macro returns the type field from the HOB header for the
- * HOB specified by hob.
- *
- * @hob:    A pointer to a HOB.
- *
- * @return: HOB type.
- */
-static inline u16 get_hob_type(const struct hob_header *hdr)
-{
-       return hdr->type;
-}
-
-/**
- * get_hob_length() - return the length, in bytes, of a HOB
- *
- * This macro returns the len field from the HOB header for the
- * HOB specified by hob.
- *
- * @hob:    A pointer to a HOB.
- *
- * @return: HOB length.
- */
-static inline u16 get_hob_length(const struct hob_header *hdr)
-{
-       return hdr->len;
-}
-
 /**
  * get_next_hob() - return a pointer to the next HOB in the HOB list
  *
@@ -224,7 +194,7 @@ static inline u16 get_hob_length(const struct hob_header *hdr)
  */
 static inline const struct hob_header *get_next_hob(const struct hob_header *hdr)
 {
-       return (const struct hob_header *)((u32)hdr + get_hob_length(hdr));
+       return (const struct hob_header *)((u32)hdr + hdr->len);
 }
 
 /**
@@ -241,7 +211,7 @@ static inline const struct hob_header *get_next_hob(const struct hob_header *hdr
  */
 static inline bool end_of_hob(const struct hob_header *hdr)
 {
-       return get_hob_type(hdr) == HOB_TYPE_EOH;
+       return hdr->type == HOB_TYPE_EOH;
 }
 
 /**
@@ -273,7 +243,7 @@ static inline void *get_guid_hob_data(const struct hob_header *hdr)
  */
 static inline u16 get_guid_hob_data_size(const struct hob_header *hdr)
 {
-       return get_hob_length(hdr) - sizeof(struct hob_guid);
+       return hdr->len - sizeof(struct hob_guid);
 }
 
 /* FSP specific GUID HOB definitions */
index 2a3e987ebb045323aa5a6f1658de98c95f2815ac..ebdbd0343509147046fc7c66e34629a2082fea19 100644 (file)
@@ -145,7 +145,7 @@ u32 fsp_get_tseg_reserved_mem(const void *hob_list, u32 *len);
  *
  * @retval:   A HOB object with matching type; Otherwise NULL.
  */
-const struct hob_header *fsp_get_next_hob(u16 type, const void *hob_list);
+const struct hob_header *fsp_get_next_hob(uint type, const void *hob_list);
 
 /**
  * Returns the next instance of the matched GUID HOB from the starting HOB.
index 8d1f038527d8e7a477faef25c130753dbbea8996..a0ef037da13cd1028cf8b04d8eec60159f704b72 100644 (file)
@@ -29,7 +29,7 @@ static char *hob_type[] = {
 int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        const struct hob_header *hdr;
-       u16 type;
+       uint type;
        char *desc;
        int i = 0;
 
@@ -41,7 +41,7 @@ int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        printf("----|----------|---------------------|----------------\n");
        while (!end_of_hob(hdr)) {
                printf("%-3d | %08x | ", i, (unsigned int)hdr);
-               type = get_hob_type(hdr);
+               type = hdr->type;
                if (type == HOB_TYPE_UNUSED)
                        desc = "*Unused*";
                else if (type == HOB_TYPE_EOH)
@@ -50,7 +50,7 @@ int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        desc = hob_type[type];
                else
                        desc = "*Invalid Type*";
-               printf("%-19s | %-15d\n", desc, get_hob_length(hdr));
+               printf("%-19s | %-15d\n", desc, hdr->len);
                hdr = get_next_hob(hdr);
                i++;
        }