image: Implement image_hwrev_is_valid
This commit is contained in:
1 parent
10a2bc6319
commit
1a89112c25
2 files changed
+7
-16
No files matched your search
+6
-15
@@ -540,26 +540,17 @@ const char * image_type_to_string(enum image_type type) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int image_hwrev_is_valid(struct image * image, const char * hwrev) {
|
int image_hwrev_is_valid(struct image * image, int16_t hwrev) {
|
||||||
|
|
||||||
/* const char * ptr = image->hwrevs;
|
struct device_list * device_ptr = image->devices;
|
||||||
const char * oldptr = ptr;
|
|
||||||
|
|
||||||
if ( ! hwrev || ! ptr )
|
while ( device_ptr ) {
|
||||||
return 1;
|
if ( hwrev_is_valid(device_ptr->hwrevs, hwrev) )
|
||||||
|
|
||||||
while ( (ptr = strchr(ptr, ',')) ) {
|
|
||||||
if ( strncmp(hwrev, oldptr, ptr-oldptr) == 0 )
|
|
||||||
return 1;
|
return 1;
|
||||||
++ptr;
|
device_ptr = device_ptr->next;
|
||||||
oldptr = ptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( strcmp(hwrev, oldptr) == 0 )
|
return 0;
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;*/
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -78,6 +78,6 @@ enum image_type image_type_from_data(struct image * image);
|
|||||||
char * image_name_alloc_from_values(struct image * image);
|
char * image_name_alloc_from_values(struct image * image);
|
||||||
enum image_type image_type_from_string(const char * type);
|
enum image_type image_type_from_string(const char * type);
|
||||||
const char * image_type_to_string(enum image_type type);
|
const char * image_type_to_string(enum image_type type);
|
||||||
int image_hwrev_is_valid(struct image * image, const char * hwrev);
|
int image_hwrev_is_valid(struct image * image, int16_t hwrev);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user