From b3fdc623e31fe3c3c02e84c19205d9f8aaff1d49 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Sat, 11 Feb 2023 11:56:22 +0100 Subject: [PATCH] amlogic: Compile kernel modules with clang Change-Id: I4eab30040035e189ce63a06b2445aa2b1780fc79 --- Android.mk | 2 +- drivers/amvdec_ports/aml_vcodec_util.h | 7 ------- drivers/amvdec_ports/decoder/vdec_mpeg4_if.c | 2 +- drivers/frame_provider/decoder/avs2/vavs2.c | 5 ----- drivers/frame_provider/decoder/h265/vh265.c | 2 +- drivers/frame_provider/decoder/vav1/av1_global.h | 7 ++----- drivers/frame_provider/decoder/vav1/vav1.c | 4 ---- drivers/frame_provider/decoder/vp9/vvp9.c | 5 ----- drivers/stream_input/amports/amstream.c | 2 +- drivers/stream_input/parser/dvb_ci/aml_spi.c | 10 +++++----- .../stream_input/parser/dvb_ci/cimax/aml_cimax_usb.c | 3 --- .../parser/dvb_ci/cimax/dvb_ca_en50221_cimax.c | 2 +- .../parser/dvb_ci/cimcu/dvb_ca_en50221_cimcu.c | 2 +- drivers/stream_input/parser/hw_demux/aml_dmx.c | 2 +- drivers/stream_input/parser/hw_demux/aml_dvb.c | 4 ++-- drivers/stream_input/subtitle/subtitle.c | 2 +- 16 files changed, 17 insertions(+), 44 deletions(-) diff --git a/Android.mk b/Android.mk index 52fcde8..2988d5a 100644 --- a/Android.mk +++ b/Android.mk @@ -57,7 +57,7 @@ MEDIA_CFLAGS := $(LOCAL_CFLAGS) $(_media_ko): $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(BOARD_KERNEL_IMAGE_NAME) @mkdir -p $(dir $@) @cp -R $(MEDIA_PATH)/* $(_media_intermediates)/ - $(hide) +$(KERNEL_MAKE_CMD) $(PATH_OVERRIDE) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_OUT) M=$(abspath $(_media_intermediates)) ARCH=$(TARGET_KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) EXTRA_CFLAGS="$(MEDIA_CFLAGS)" $(MEDIA_CONFIGS) modules + $(PATH_OVERRIDE) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_OUT) M=$(abspath $(_media_intermediates)) ARCH=$(TARGET_KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) EXTRA_CFLAGS="$(MEDIA_CFLAGS)" $(MEDIA_CONFIGS) modules modules=$$(find $(_media_intermediates) -type f -name '*.ko'); \ for f in $$modules; do \ $(KERNEL_TOOLCHAIN_PATH)strip --strip-unneeded $$f; \ diff --git a/drivers/amvdec_ports/aml_vcodec_util.h b/drivers/amvdec_ports/aml_vcodec_util.h index 312ee40..494044c 100644 --- a/drivers/amvdec_ports/aml_vcodec_util.h +++ b/drivers/amvdec_ports/aml_vcodec_util.h @@ -24,13 +24,6 @@ #include #include -typedef unsigned long long u64; -typedef signed long long s64; -typedef unsigned int u32; -typedef unsigned short int u16; -typedef short int s16; -typedef unsigned char u8; - #define CODEC_MODE(a, b, c, d)\ (((u8)(a) << 24) | ((u8)(b) << 16) | ((u8)(c) << 8) | (u8)(d)) diff --git a/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c b/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c index c47bafc..e598904 100644 --- a/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c +++ b/drivers/amvdec_ports/decoder/vdec_mpeg4_if.c @@ -195,7 +195,7 @@ static int vdec_mpeg4_init(struct aml_vcodec_ctx *ctx, unsigned long *h_vdec) return -ENOMEM; inst->vdec.video_type = VFORMAT_MPEG4; - inst->vdec.format = VIDEO_DEC_FORMAT_MPEG4_5; + inst->vdec.format = (enum vformat_e)VIDEO_DEC_FORMAT_MPEG4_5; inst->vdec.dev = ctx->dev->vpu_plat_dev; inst->vdec.filp = ctx->dev->filp; inst->vdec.config = ctx->config; diff --git a/drivers/frame_provider/decoder/avs2/vavs2.c b/drivers/frame_provider/decoder/avs2/vavs2.c index 1ec012d..6c68d53 100644 --- a/drivers/frame_provider/decoder/avs2/vavs2.c +++ b/drivers/frame_provider/decoder/avs2/vavs2.c @@ -405,11 +405,6 @@ struct MVBUF_s { #define DOUBLE_WRITE_YSTART_TEMP 0x02000000 #define DOUBLE_WRITE_CSTART_TEMP 0x02900000 - - -typedef unsigned int u32; -typedef unsigned short u16; - #define AVS2_DBG_BUFMGR 0x01 #define AVS2_DBG_BUFMGR_MORE 0x02 #define AVS2_DBG_BUFMGR_DETAIL 0x04 diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index 516d74a..8e14849 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -14454,7 +14454,7 @@ static int ammvdec_h265_probe(struct platform_device *pdev) hevc->platform_dev = pdev; if (((get_dbg_flag(hevc) & IGNORE_PARAM_FROM_CONFIG) == 0) && - pdata->config && pdata->config_len) { + pdata->config_len) { #ifdef CONFIG_AMLOGIC_MEDIA_MULTI_DEC /*use ptr config for doubel_write_mode, etc*/ hevc_print(hevc, 0, "pdata->config=%s\n", pdata->config); diff --git a/drivers/frame_provider/decoder/vav1/av1_global.h b/drivers/frame_provider/decoder/vav1/av1_global.h index 75af688..41855b9 100644 --- a/drivers/frame_provider/decoder/vav1/av1_global.h +++ b/drivers/frame_provider/decoder/vav1/av1_global.h @@ -54,9 +54,9 @@ //typedef char int8_t; //#ifndef BUFMGR_FOR_SIM -typedef unsigned char uint8_t; +//typedef unsigned char uint8_t; //#endif -typedef unsigned int uint32_t; +//typedef unsigned int uint32_t; //typedef int int32_t; //typedef long long int64_t; @@ -108,9 +108,6 @@ typedef struct BuffInfo_s } BuffInfo_t; #endif -#define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) /* mem.h */ diff --git a/drivers/frame_provider/decoder/vav1/vav1.c b/drivers/frame_provider/decoder/vav1/vav1.c index e7ee9f5..4957eaf 100644 --- a/drivers/frame_provider/decoder/vav1/vav1.c +++ b/drivers/frame_provider/decoder/vav1/vav1.c @@ -432,10 +432,6 @@ struct MVBUF_s { #define LOSLESS_COMPRESS_MODE #endif -typedef unsigned int u32; -typedef unsigned short u16; - - static u32 get_picture_qos; static u32 debug; diff --git a/drivers/frame_provider/decoder/vp9/vvp9.c b/drivers/frame_provider/decoder/vp9/vvp9.c index f4e5545..aa1fab4 100644 --- a/drivers/frame_provider/decoder/vp9/vvp9.c +++ b/drivers/frame_provider/decoder/vp9/vvp9.c @@ -337,11 +337,6 @@ struct MVBUF_s { #define DOUBLE_WRITE_YSTART_TEMP 0x02000000 #define DOUBLE_WRITE_CSTART_TEMP 0x02900000 - - -typedef unsigned int u32; -typedef unsigned short u16; - #define VP9_DEBUG_BUFMGR 0x01 #define VP9_DEBUG_BUFMGR_MORE 0x02 #define VP9_DEBUG_BUFMGR_DETAIL 0x04 diff --git a/drivers/stream_input/amports/amstream.c b/drivers/stream_input/amports/amstream.c index a089a6b..52a9997 100644 --- a/drivers/stream_input/amports/amstream.c +++ b/drivers/stream_input/amports/amstream.c @@ -4405,7 +4405,7 @@ static ssize_t store_canuse_buferlevel(struct class *class, if (ret != 0) return -EINVAL; - val = val; + reset_canuse_buferlevel(val); return size; } diff --git a/drivers/stream_input/parser/dvb_ci/aml_spi.c b/drivers/stream_input/parser/dvb_ci/aml_spi.c index 49498fa..965f4d4 100644 --- a/drivers/stream_input/parser/dvb_ci/aml_spi.c +++ b/drivers/stream_input/parser/dvb_ci/aml_spi.c @@ -1738,7 +1738,7 @@ struct class_attribute *attr, const char *buf, size_t size) return size; } - if ((parm[0][0] == 'r')) { + if (parm[0][0] == 'r') { if (n > 2) { pr_err("read: invalid parameter\n"); kfree(buf_orig); @@ -1760,7 +1760,7 @@ struct class_attribute *attr, const char *buf, size_t size) break; } pr_dbg("%s: 0x%x --> 0x%x\n", parm[0], addr, retval); - } else if ((parm[0][0] == 'w')) { + } else if (parm[0][0] == 'w') { if (n != 3) { pr_err("write: invalid parameter\n"); kfree(buf_orig); @@ -1783,13 +1783,13 @@ retval = aml_ci_mem_write_by_spi(ci, 0, addr, val); break; }*/ pr_dbg("%s: 0x%x <-- 0x%x\n", parm[0], addr, retval); - } else if ((parm[0][0] == 'f')) { + } else if (parm[0][0] == 'f') { pr_dbg("full test----\r\n"); aml_spi_ca_full_test(ci); - } else if ((parm[0][0] == 'c')) { + } else if (parm[0][0] == 'c') { pr_dbg("cis test----\r\n"); aml_ci_full_test_by_spi(ci, 0, addr); - } else if ((parm[0][0] == 'p')) { + } else if (parm[0][0] == 'p') { pr_dbg("cis dvb_ca_en50221_parse_attributes----\r\n"); dvb_ca_en50221_parse_attributes(); } diff --git a/drivers/stream_input/parser/dvb_ci/cimax/aml_cimax_usb.c b/drivers/stream_input/parser/dvb_ci/cimax/aml_cimax_usb.c index b74b34a..5674c09 100644 --- a/drivers/stream_input/parser/dvb_ci/cimax/aml_cimax_usb.c +++ b/drivers/stream_input/parser/dvb_ci/cimax/aml_cimax_usb.c @@ -1185,8 +1185,6 @@ int cimax_usb_dev_add(struct device_s *dev, int id) if (!g_usb) return 0; - id = id; - cimax_usb_device_open(dev); cimax_usb_select_interface(dev, 3); @@ -1224,7 +1222,6 @@ int cimax_usb_dev_remove(struct device_s *dev, int id) pr_dbg("dev remove\n"); if (!g_usb) return 0; - id = id; pr_dbg("setup poll -> stop\n"); cimax_usb_setup_poll(g_usb, STOP_MODE); pr_dbg("setup poll end\n"); diff --git a/drivers/stream_input/parser/dvb_ci/cimax/dvb_ca_en50221_cimax.c b/drivers/stream_input/parser/dvb_ci/cimax/dvb_ca_en50221_cimax.c index 0f09799..90992d4 100644 --- a/drivers/stream_input/parser/dvb_ci/cimax/dvb_ca_en50221_cimax.c +++ b/drivers/stream_input/parser/dvb_ci/cimax/dvb_ca_en50221_cimax.c @@ -1516,7 +1516,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, idx, 0, hdr, 2); if (connection_id == -1) connection_id = hdr[0]; - if ((hdr[0] == connection_id) + if (hdr[0] == connection_id #ifndef READ_LPDU_PKT && ((hdr[1] & 0x80) == 0) #endif diff --git a/drivers/stream_input/parser/dvb_ci/cimcu/dvb_ca_en50221_cimcu.c b/drivers/stream_input/parser/dvb_ci/cimcu/dvb_ca_en50221_cimcu.c index 762f5ff..6a03027 100644 --- a/drivers/stream_input/parser/dvb_ci/cimcu/dvb_ca_en50221_cimcu.c +++ b/drivers/stream_input/parser/dvb_ci/cimcu/dvb_ca_en50221_cimcu.c @@ -1522,7 +1522,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, dvb_ringbuffer_pkt_read(&ca->slot_info[slot].rx_buffer, idx, 0, hdr, 2); if (connection_id == -1) connection_id = hdr[0]; - if ((hdr[0] == connection_id) + if (hdr[0] == connection_id #ifndef READ_LPDU_PKT && ((hdr[1] & 0x80) == 0) #endif diff --git a/drivers/stream_input/parser/hw_demux/aml_dmx.c b/drivers/stream_input/parser/hw_demux/aml_dmx.c index ad34987..eb314d0 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dmx.c +++ b/drivers/stream_input/parser/hw_demux/aml_dmx.c @@ -3122,7 +3122,7 @@ static int dmx_get_record_flag(struct aml_dmx *dmx) for (i = 0; i < dvb->async_fifo_total_count; i++) { if (!dvb->asyncfifo[i].init) continue; - if ((dvb->asyncfifo[i].source == dmx->id) + if (dvb->asyncfifo[i].source == dmx->id /*&& !(dvb->swfilter.user && (i==SF_AFIFO_ID)) */ /*sf mode reserved */ ) { diff --git a/drivers/stream_input/parser/hw_demux/aml_dvb.c b/drivers/stream_input/parser/hw_demux/aml_dvb.c index 4e1549c..bc51dae 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dvb.c +++ b/drivers/stream_input/parser/hw_demux/aml_dvb.c @@ -1239,7 +1239,7 @@ static ssize_t demux##i##_show_free_filters(struct class *class, \ return -ERESTARTSYS; \ count = 0;\ for (fid = 0; fid < dmx->filternum; fid++) {\ - if (!dmx->filter[fid].state != DMX_STATE_FREE)\ + if (!(dmx->filter[fid].state != DMX_STATE_FREE)) \ count++;\ } \ mutex_unlock(&dmx->mutex);\ @@ -1290,7 +1290,7 @@ static ssize_t demux_state_show(struct class *class, count = 0; for (fid = 0; fid < dmx->filternum; fid++) { - if (!dmx->filter[fid].state != DMX_STATE_FREE) + if (!(dmx->filter[fid].state != DMX_STATE_FREE)) count++; else { r = sprintf(buf, "fid:%d, pid:0x%0x, state:%d\n", fid, dmx->filter[fid].feed->pid, diff --git a/drivers/stream_input/subtitle/subtitle.c b/drivers/stream_input/subtitle/subtitle.c index bfcf612..2dc7740 100644 --- a/drivers/stream_input/subtitle/subtitle.c +++ b/drivers/stream_input/subtitle/subtitle.c @@ -338,7 +338,7 @@ static ssize_t store_data(struct class *class, struct class_attribute *attr, ssize_t r; r = kstrtoint(buf, 0, &address); - if ((r == 0)) + if (r == 0) return -EINVAL; #if 0 if (subtitle_data[subtitle_write_pos].subtitle_size > 0) { -- 2.20.1