| f19a771a | 21-Dec-2023 |
Fei Shao <[email protected]> |
media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messages
In mtk_vcodec_mem_free(), there are two cases where a NULL VA is passed: - mem->size == 0: we are called to free no memory. This
media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messages
In mtk_vcodec_mem_free(), there are two cases where a NULL VA is passed: - mem->size == 0: we are called to free no memory. This may happen when we call mtk_vcodec_mem_free() twice or the memory has never been allocated. - mem->size > 0: we are called to free memory but without VA. This means that we failed to free the memory for real.
Both cases are not expected to happen, and we want to have clearer error messages to describe which one we just encountered. Update the error messages to include more information for that purpose.
Signed-off-by: Fei Shao <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|
| 3de2a218 | 21-Dec-2023 |
Fei Shao <[email protected]> |
media: mediatek: vcodec: Drop unnecessary variable
In mtk_vcodec_mem_alloc() and mtk_vcodec_mem_free(), the value of mem->size is not expected to change before and when using the DMA APIs and debug
media: mediatek: vcodec: Drop unnecessary variable
In mtk_vcodec_mem_alloc() and mtk_vcodec_mem_free(), the value of mem->size is not expected to change before and when using the DMA APIs and debug print, so there's no point in keeping local copies of it.
Drop the local variable "size" in the mentioned functions, and update printk format identifiers accordingly.
This makes the code slightly more visually consistent, and retrieve a small amount of memory that is used for no real purpose.
Signed-off-by: Fei Shao <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|