amlogic: Compile kernel modules with clang
authorChristian Hoffmann <chrmhoffmann@gmail.com>
Sat, 11 Feb 2023 10:56:22 +0000 (11:56 +0100)
committerChristian Hoffmann <chrmhoffmann@gmail.com>
Sat, 11 Feb 2023 10:58:14 +0000 (11:58 +0100)
Change-Id: I4eab30040035e189ce63a06b2445aa2b1780fc79

16 files changed:
Android.mk
drivers/amvdec_ports/aml_vcodec_util.h
drivers/amvdec_ports/decoder/vdec_mpeg4_if.c
drivers/frame_provider/decoder/avs2/vavs2.c
drivers/frame_provider/decoder/h265/vh265.c
drivers/frame_provider/decoder/vav1/av1_global.h
drivers/frame_provider/decoder/vav1/vav1.c
drivers/frame_provider/decoder/vp9/vvp9.c
drivers/stream_input/amports/amstream.c
drivers/stream_input/parser/dvb_ci/aml_spi.c
drivers/stream_input/parser/dvb_ci/cimax/aml_cimax_usb.c
drivers/stream_input/parser/dvb_ci/cimax/dvb_ca_en50221_cimax.c
drivers/stream_input/parser/dvb_ci/cimcu/dvb_ca_en50221_cimcu.c
drivers/stream_input/parser/hw_demux/aml_dmx.c
drivers/stream_input/parser/hw_demux/aml_dvb.c
drivers/stream_input/subtitle/subtitle.c

index 52fcde8ddacbb967074e677afb968b1c4085a3de..2988d5a4ee25e5d82b3bb5ec84ef34211f0afe2d 100644 (file)
@@ -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; \
index 312ee406d986ad8628faabadc8a5725ac8b38ef5..494044cdb03b99e1e987b9862649e28fcf814efd 100644 (file)
 #include <linux/dma-direction.h>
 #include <linux/amlogic/media/codec_mm/codec_mm.h>
 
-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))
 
index c47bafc0a00abc03877845388c80c050579876a1..e5989040e7596c75b0dde774ed5b8d5a5548fab6 100644 (file)
@@ -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;
index 1ec012da69297120bb3e1935445200b71ce07bf5..6c68d53b83497e5b62140a41a80ebeb9d884808a 100644 (file)
@@ -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
index 516d74a6e83f71224bd188943d5bd08c7807fa64..8e14849479c5cb4b41a97b763b8b835a5ce87cb0 100644 (file)
@@ -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);
index 75af68815758dc1cb9ebf538605b0ac28ed996cf..41855b9ac915d74d648ebb025c4e78c22f32406d 100644 (file)
@@ -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
 */
index e7ee9f5f8927d810b0f9da7f07c5857d41066887..4957eaff3ec487eeda2c25631cf3e4ac97f1ffd9 100644 (file)
@@ -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;
index f4e554564168804113bcb86cf5e226d517b353a1..aa1fab4a424b162c8de8238d9ee10a7b94bdff19 100644 (file)
@@ -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
index a089a6b8dfc4f7ca33d32462d0648ba26b80f5f0..52a9997e745c4f6ee53856ddbd7b66f5f20240d1 100644 (file)
@@ -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;
 }
index 49498fac49d549644578979ba144ee3f3d794738..965f4d408620c9fa6f9eb4c78f21acc97fe7c6d0 100644 (file)
@@ -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();
        }
index b74b34a63b51070ec6d532e3892187f48c34d1c6..5674c09cefaaeb355b3d89f1961b01923a708eff 100644 (file)
@@ -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");
index 0f097990f4288d180b8ff7ca240d810554bc1f85..90992d4c088483073ae298ac6bac448493bf530c 100644 (file)
@@ -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
index 762f5ff71f999e40a27dc0b1aaf033b5744f1621..6a03027d3722987190d95759f7815967dcb6cc24 100644 (file)
@@ -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
index ad3498756ef989c2aa7b94b89c7641abd903e902..eb314d01fa1a899d75bd21c398c1851eaef456ee 100644 (file)
@@ -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 */
                    ) {
index 4e1549c0f01706e70fe1736e1af5bd21d6c3c9e3..bc51dae606d410b96bf34e81fb9b49858a295e7c 100644 (file)
@@ -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,
index bfcf6122e7d8b8f6f95889e0e39bd4b08e85110a..2dc77405225524b2ed437e4b79731e9013b1c9fb 100644 (file)
@@ -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) {