mediatek: mt7622: rtl8367c: add casts to fix compiler warnings
authorDaniel Golle <daniel@makrotopia.org>
Fri, 1 Mar 2024 00:06:47 +0000 (00:06 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 1 Mar 2024 01:42:36 +0000 (01:42 +0000)
Use type casts to prevent compiler warnings which are going to turn
into errors when we switch to Linux 6.6.
In the long run we should try to get rid of this downstream driver
now that RTL8367S is support by the rtl8365mb DSA driver.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/stat.c
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/vlan.c

index 3a328b0ca415d4d19efb301623631d09e926dec6..2fed6d9fc897b0ea4f742c9ebffba1d7caac6dcf 100644 (file)
@@ -140,7 +140,7 @@ rtk_api_ret_t rtk_stat_global_get(rtk_stat_global_type_t cntr_idx, rtk_stat_coun
     if (cntr_idx!=DOT1D_TP_LEARNED_ENTRY_DISCARDS_INDEX)
         return RT_ERR_STAT_INVALID_GLOBAL_CNTR;
 
-    if ((retVal = rtl8367c_getAsicMIBsCounter(0, cntr_idx, pCntr)) != RT_ERR_OK)
+    if ((retVal = rtl8367c_getAsicMIBsCounter(0, (RTL8367C_MIBCOUNTER)cntr_idx, pCntr)) != RT_ERR_OK)
         return retVal;
 
     return RT_ERR_OK;
@@ -172,7 +172,7 @@ rtk_api_ret_t rtk_stat_global_getAll(rtk_stat_global_cntr_t *pGlobal_cntrs)
     if(NULL == pGlobal_cntrs)
         return RT_ERR_NULL_POINTER;
 
-    if ((retVal = rtl8367c_getAsicMIBsCounter(0,DOT1D_TP_LEARNED_ENTRY_DISCARDS_INDEX, &pGlobal_cntrs->dot1dTpLearnedEntryDiscards)) != RT_ERR_OK)
+    if ((retVal = rtl8367c_getAsicMIBsCounter(0, dot1dTpLearnedEntryDiscards, &pGlobal_cntrs->dot1dTpLearnedEntryDiscards)) != RT_ERR_OK)
         return retVal;
 
     return RT_ERR_OK;
index f7480c4906fdb44a75b556d8fb1c45be6562b7fe..031eabf2efb2970da0b20be02c5c3cc9f7d0ff2f 100644 (file)
@@ -950,7 +950,7 @@ rtk_api_ret_t rtk_vlan_protoAndPortBasedVlan_add(rtk_port_t port, rtk_vlan_proto
     {
         if ((retVal = rtl8367c_getAsicVlanProtocolBasedGroupData(i, &ppb_data_cfg)) != RT_ERR_OK)
             return retVal;
-        tmp = pInfo->frame_type;
+        tmp = (rtl8367c_provlan_frametype)pInfo->frame_type;
         if (ppb_data_cfg.etherType == pInfo->proto_type && ppb_data_cfg.frameType == tmp)
         {
             /*Already exist*/
@@ -976,7 +976,7 @@ rtk_api_ret_t rtk_vlan_protoAndPortBasedVlan_add(rtk_port_t port, rtk_vlan_proto
     else if (empty<RTL8367C_PROTOVLAN_GROUPNO)
     {
         /*No exist index, but have empty index*/
-        ppb_data_cfg.frameType = pInfo->frame_type;
+        ppb_data_cfg.frameType = (rtl8367c_provlan_frametype)pInfo->frame_type;
         ppb_data_cfg.etherType = pInfo->proto_type;
         if ((retVal = rtl8367c_setAsicVlanProtocolBasedGroupData(empty, &ppb_data_cfg)) != RT_ERR_OK)
             return retVal;
@@ -1267,7 +1267,7 @@ rtk_api_ret_t rtk_vlan_tagMode_set(rtk_port_t port, rtk_vlan_tagMode_t tag_mode)
     if (tag_mode >= VLAN_TAG_MODE_END)
         return RT_ERR_PORT_ID;
 
-    if ((retVal = rtl8367c_setAsicVlanEgressTagMode(rtk_switch_port_L2P_get(port), tag_mode)) != RT_ERR_OK)
+    if ((retVal = rtl8367c_setAsicVlanEgressTagMode(rtk_switch_port_L2P_get(port), (rtl8367c_egtagmode)tag_mode)) != RT_ERR_OK)
         return retVal;
 
     return RT_ERR_OK;