mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-06 01:26:49 +08:00
[platform]: fixup for reading compatible
Change-Id: Ia0ff40644daaaec90a32d173675fadca7327d79b Reported-by: Jacob Chen <jacob2.chen@rock-chips.com> Signed-off-by: Randy Li <randy.li@rock-chips.com>
This commit is contained in:
@@ -170,11 +170,11 @@ MppPlatformService::MppPlatformService()
|
|||||||
soc_name_len = read(fd, soc_name, MAX_SOC_NAME_LENGTH - 1);
|
soc_name_len = read(fd, soc_name, MAX_SOC_NAME_LENGTH - 1);
|
||||||
if (soc_name_len > 0) {
|
if (soc_name_len > 0) {
|
||||||
/* replacing the termination character to space */
|
/* replacing the termination character to space */
|
||||||
char *ptr = soc_name;
|
for (char *ptr = soc_name;; ptr = soc_name) {
|
||||||
|
|
||||||
while (ptr < soc_name + soc_name_len - 1) {
|
|
||||||
ptr += strnlen (soc_name, MAX_SOC_NAME_LENGTH);
|
ptr += strnlen (soc_name, MAX_SOC_NAME_LENGTH);
|
||||||
*ptr = ' ';
|
*ptr = ' ';
|
||||||
|
if (ptr >= soc_name + soc_name_len - 1)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mpp_dbg(MPP_DBG_PLATFORM, "chip name: %s\n", soc_name);
|
mpp_dbg(MPP_DBG_PLATFORM, "chip name: %s\n", soc_name);
|
||||||
|
Reference in New Issue
Block a user