File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -636,8 +636,8 @@ static int panthor_fw_read_build_info(struct panthor_device *ptdev,
636
636
u32 ehdr )
637
637
{
638
638
struct panthor_fw_build_info_hdr hdr ;
639
- char header [ 9 ] ;
640
- const char git_sha_header [ sizeof (header )] = "git_sha: " ;
639
+ static const char git_sha_header [] = "git_sha: " ;
640
+ const int header_len = sizeof (git_sha_header ) - 1 ;
641
641
int ret ;
642
642
643
643
ret = panthor_fw_binary_iter_read (ptdev , iter , & hdr , sizeof (hdr ));
@@ -651,8 +651,7 @@ static int panthor_fw_read_build_info(struct panthor_device *ptdev,
651
651
return 0 ;
652
652
}
653
653
654
- if (memcmp (git_sha_header , fw -> data + hdr .meta_start ,
655
- sizeof (git_sha_header ))) {
654
+ if (memcmp (git_sha_header , fw -> data + hdr .meta_start , header_len )) {
656
655
/* Not the expected header, this isn't metadata we understand */
657
656
return 0 ;
658
657
}
@@ -665,7 +664,7 @@ static int panthor_fw_read_build_info(struct panthor_device *ptdev,
665
664
}
666
665
667
666
drm_info (& ptdev -> base , "Firmware git sha: %s\n" ,
668
- fw -> data + hdr .meta_start + sizeof ( git_sha_header ) );
667
+ fw -> data + hdr .meta_start + header_len );
669
668
670
669
return 0 ;
671
670
}
You can’t perform that action at this time.
0 commit comments