From 2d0bb370d010e2efe7330589db3a3efd21e36304 Mon Sep 17 00:00:00 2001 From: Yi Zhou Date: Wed, 28 Mar 2018 19:23:14 +0800 Subject: [PATCH] hdmitx: clean up deadcode PD#163222: hdmitx: clean up deadcode #457 #491~530 #579 #608 #610 #624~642 #842~843 Change-Id: I939566450c2c18ade53d4d7e6a264dccc4982872 Signed-off-by: Yi Zhou --- .../vout/hdmitx/hdmi_common/hdmi_parameters.c | 2 +- .../media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c | 10 +-- .../media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 5 +- .../amlogic/media/vout/hdmi_tx/hdmi_info_global.h | 86 +++++++++++----------- 4 files changed, 48 insertions(+), 55 deletions(-) diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c b/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c index f5f4f16..ff3836a 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c @@ -1548,7 +1548,7 @@ struct hdmi_format_para *hdmi_get_fmt_name(char const *name, char const *attr) sizeof(struct hdmi_format_para *))) { para = all_fmt_paras[i]; memset(¶->ext_name[0], 0, sizeof(para->ext_name)); - memcpy(¶->ext_name[0], name, strlen(name)); + memcpy(¶->ext_name[0], name, sizeof(para->ext_name)); hdmi_parse_attr(para, name); hdmi_parse_attr(para, attr); } else { diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c index 9ac0b02..f5e9a66 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c @@ -205,13 +205,6 @@ void Edid_DecodeStandardTiming(struct hdmitx_info *info, } /* ----------------------------------------------------------- */ -void Edid_CompareTimingDescriptors(struct hdmitx_info *info, - unsigned char *Data) -{ -} - - -/* ----------------------------------------------------------- */ void Edid_ParseCEADetailedTimingDescriptors(struct hdmitx_info *info, unsigned char blk_mun, unsigned char BaseAddr, unsigned char *buff) @@ -219,7 +212,6 @@ void Edid_ParseCEADetailedTimingDescriptors(struct hdmitx_info *info, unsigned char index_edid; for (index_edid = 0; index_edid < blk_mun; index_edid++) { - Edid_CompareTimingDescriptors(info, &buff[BaseAddr]); BaseAddr += 18; /* there is not the TimingDescriptors */ if ((BaseAddr + 18) > 0x7d) @@ -1058,7 +1050,7 @@ static int Edid_ParsingY420CMDBBlock(struct hdmitx_info *info, info->bitmap_valid = 1; } while (pos < data_end) { - if (i < VIC_MAX_NUM) + if (i < Y420CMDB_MAX) info->y420cmdb_bitmap[i] = buf[pos]; pos++; i++; diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c index 9a62fed..07333f1 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c @@ -394,10 +394,11 @@ static int set_disp_mode_auto(void) /* get current vinfo */ info = hdmitx_get_current_vinfo(); + if ((info == NULL) || (info->name == NULL)) + return -1; + pr_info(SYS "get current mode: %s\n", info ? info->name : "null"); - if (info == NULL) - return -1; if (!((strncmp(info->name, "480cvbs", 7) == 0) || (strncmp(info->name, "576cvbs", 7) == 0) || diff --git a/include/linux/amlogic/media/vout/hdmi_tx/hdmi_info_global.h b/include/linux/amlogic/media/vout/hdmi_tx/hdmi_info_global.h index 1e7fc3e..e143e27 100644 --- a/include/linux/amlogic/media/vout/hdmi_tx/hdmi_info_global.h +++ b/include/linux/amlogic/media/vout/hdmi_tx/hdmi_info_global.h @@ -145,58 +145,58 @@ enum hdmitx_disptype { }; struct hdmitx_supstatus { - int hpd_state:1; - int support_480i:1; - int support_576i:1; - int support_480p:1; - int support_576p:1; - int support_720p_60hz:1; - int support_720p_50hz:1; - int support_1080i_60hz:1; - int support_1080i_50hz:1; - int support_1080p_60hz:1; - int support_1080p_50hz:1; - int support_1080p_24hz:1; - int support_1080p_25hz:1; - int support_1080p_30hz:1; + unsigned int hpd_state:1; + unsigned int support_480i:1; + unsigned int support_576i:1; + unsigned int support_480p:1; + unsigned int support_576p:1; + unsigned int support_720p_60hz:1; + unsigned int support_720p_50hz:1; + unsigned int support_1080i_60hz:1; + unsigned int support_1080i_50hz:1; + unsigned int support_1080p_60hz:1; + unsigned int support_1080p_50hz:1; + unsigned int support_1080p_24hz:1; + unsigned int support_1080p_25hz:1; + unsigned int support_1080p_30hz:1; }; struct hdmitx_suplpcminfo { - int support_flag:1; - int max_channel_num:3; - int _192k:1; - int _176k:1; - int _96k:1; - int _88k:1; - int _48k:1; - int _44k:1; - int _32k:1; - int _24bit:1; - int _20bit:1; - int _16bit:1; + unsigned int support_flag:1; + unsigned int max_channel_num:3; + unsigned int _192k:1; + unsigned int _176k:1; + unsigned int _96k:1; + unsigned int _88k:1; + unsigned int _48k:1; + unsigned int _44k:1; + unsigned int _32k:1; + unsigned int _24bit:1; + unsigned int _20bit:1; + unsigned int _16bit:1; }; struct hdmitx_supcompressedinfo { - int support_flag:1; - int max_channel_num:3; - int _192k:1; - int _176k:1; - int _96k:1; - int _88k:1; - int _48k:1; - int _44k:1; - int _32k:1; - int _max_bit:10; + unsigned int support_flag:1; + unsigned int max_channel_num:3; + unsigned int _192k:1; + unsigned int _176k:1; + unsigned int _96k:1; + unsigned int _88k:1; + unsigned int _48k:1; + unsigned int _44k:1; + unsigned int _32k:1; + unsigned int _max_bit:10; }; struct hdmitx_supspeakerformat { - int rlc_rrc:1; - int flc_frc:1; - int rc:1; - int rl_rr:1; - int fc:1; - int lfe:1; - int fl_fr:1; + unsigned int rlc_rrc:1; + unsigned int flc_frc:1; + unsigned int rc:1; + unsigned int rl_rr:1; + unsigned int fc:1; + unsigned int lfe:1; + unsigned int fl_fr:1; }; struct hdmitx_vidpara { -- 2.7.4