Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs
Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'to convert the new alloc_obj() users that had a simple GFP_KERNELargument to just drop that argument.Note that due to the extreme simplicity of the scripting, any slightlymore complex cases spread over multiple lines would not be triggered:they definitely exist, but this covers the vast bulk of the cases, andthe resulting diff is also then easier to check automatically.For the same reason the 'flex' versions will be done as a separateconversion.Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid sc
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid scalar types (which need careful case-by-case checking), andinstead replace kmalloc-family calls that allocate struct or unionobject instances:Single allocations: kmalloc(sizeof(TYPE), ...)are replaced with: kmalloc_obj(TYPE, ...)Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)are replaced with: kmalloc_objs(TYPE, COUNT, ...)Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)(where TYPE may also be *VAR)The resulting allocations no longer return "void *", instead returning"TYPE *".Signed-off-by: Kees Cook <kees@kernel.org>
media: mediatek: vcodec: Remove trailing space after \n newlineThere is a extraneous space after a newline in a mtk_venc_debug message.Remove it.Signed-off-by: Colin Ian King <colin.i.king@gmail
media: mediatek: vcodec: Remove trailing space after \n newlineThere is a extraneous space after a newline in a mtk_venc_debug message.Remove it.Signed-off-by: Colin Ian King <colin.i.king@gmail.com>Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: mtk-vcodec: venc: avoid -Wenum-compare-conditional warningThis is one of three clang warnings about incompatible enum typesin a conditional expression:drivers/media/platform/mediatek/vcod
media: mtk-vcodec: venc: avoid -Wenum-compare-conditional warningThis is one of three clang warnings about incompatible enum typesin a conditional expression:drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c:597:29: error: conditional expression between different enumeration types ('enum scp_ipi_id' and 'enum ipi_id') [-Werror,-Wenum-compare-conditional] 597 | inst->vpu_inst.id = is_ext ? SCP_IPI_VENC_H264 : IPI_VENC_H264; | ^ ~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~The code is correct, so just rework it to avoid the warning.Fixes: 0dc4b3286125 ("media: mtk-vcodec: venc: support SCP firmware")Cc: stable@vger.kernel.orgSigned-off-by: Arnd Bergmann <arnd@arndb.de>Reviewed-by: Nathan Chancellor <nathan@kernel.org>Reviewed-by: Alexandre Courbot <acourbot@google.com>Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
media: mediatek: vcodec: Only free buffer VA that is not NULLIn the MediaTek vcodec driver, while mtk_vcodec_mem_free() is mostlycalled only when the buffer to free exists, there are some instance
media: mediatek: vcodec: Only free buffer VA that is not NULLIn the MediaTek vcodec driver, while mtk_vcodec_mem_free() is mostlycalled only when the buffer to free exists, there are some instancesthat didn't do the check and triggered warnings in practice.We believe those checks were forgotten unintentionally. Add the checksback to fix the warnings.Signed-off-by: Fei Shao <fshao@chromium.org>Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
media: mediatek: vcodec: separate decoder and encoderMove all decoder files to folder decoder.Move all encoder files to folder encoder.Move common files which shared for encoder and decoder to fo
media: mediatek: vcodec: separate decoder and encoderMove all decoder files to folder decoder.Move all encoder files to folder encoder.Move common files which shared for encoder and decoder to folder common.Change include header files and Makefile to fix build error.Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>