drivers: modem_v1: silence enum-conversion warnings
authorMichael Benedict <michaelbt@live.com>
Mon, 3 Jun 2019 08:47:12 +0000 (18:47 +1000)
committerMichael Benedict <michaelbt@live.com>
Sat, 31 Aug 2019 15:08:52 +0000 (01:08 +1000)
Signed-off-by: Michael Benedict <michaelbt@live.com>
drivers/misc/modem_v1/link_device_memory.h
drivers/misc/modem_v1/link_device_memory_debug.c
drivers/misc/modem_v1/link_device_shmem.c

index efcfbb99bf24177a0fbd6831e75b79c9cab661e5..1c7abece990ae17bdbf9efac8d3758ecace15752 100644 (file)
@@ -155,7 +155,7 @@ struct __packed shmem_4mb_phys_map {
 #ifdef GROUP_MEM_IPC_DEVICE
 
 struct mem_ipc_device {
-       enum dev_format id;
+       enum legacy_ipc_map id;
        char name[16];
 
        struct circ_queue txq;
@@ -734,17 +734,16 @@ static inline enum dev_format dev_id(enum sipc_ch_id ch)
        return sipc5_fmt_ch(ch) ? IPC_FMT : IPC_RAW;
 }
 
-static inline enum dev_format get_mmap_idx(enum sipc_ch_id ch,
+static inline enum legacy_ipc_map get_mmap_idx(enum sipc_ch_id ch,
                struct sk_buff *skb)
 {
        if (sipc5_fmt_ch(ch))
                return IPC_MAP_FMT;
-       else
 #ifdef CONFIG_MODEM_IF_LEGACY_QOS
-               return (skb->queue_mapping == 1) ?
-                       IPC_MAP_HPRIO_RAW : IPC_MAP_NORM_RAW;
+       return (skb->queue_mapping == 1) ?
+               IPC_MAP_HPRIO_RAW : IPC_MAP_NORM_RAW;
 #else
-               return IPC_MAP_NORM_RAW;
+       return IPC_MAP_NORM_RAW;
 #endif
 }
 
index 6b87776b0b5286918d38f407377c995b13e07308..f0b965cc3dcd769ad79d27f178217faeaef537af 100644 (file)
@@ -62,7 +62,7 @@ void print_req_ack(struct mem_link_device *mld, struct mem_snapshot *mst,
 #ifdef DEBUG_MODEM_IF_FLOW_CTRL
        struct link_device *ld = &mld->link_dev;
        struct modem_ctl *mc = ld->mc;
-       enum dev_format id = dev->id;
+       enum legacy_ipc_map id = dev->id;
        unsigned int qsize = get_size(cq(dev, dir));
        unsigned int in = mst->head[id][dir];
        unsigned int out = mst->tail[id][dir];
@@ -81,7 +81,7 @@ void print_res_ack(struct mem_link_device *mld, struct mem_snapshot *mst,
 #ifdef DEBUG_MODEM_IF_FLOW_CTRL
        struct link_device *ld = &mld->link_dev;
        struct modem_ctl *mc = ld->mc;
-       enum dev_format id = dev->id;
+       enum legacy_ipc_map id = dev->id;
        enum direction opp_dir = opposite(dir); /* opposite direction */
        unsigned int qsize = get_size(cq(dev, opp_dir));
        unsigned int in = mst->head[id][opp_dir];
@@ -116,7 +116,7 @@ void print_dev_snapshot(struct mem_link_device *mld, struct mem_snapshot *mst,
 {
 #ifdef DEBUG_MODEM_IF
        struct link_device *ld = &mld->link_dev;
-       enum dev_format id = dev->id;
+       enum legacy_ipc_map id = dev->id;
 
        if (id > IPC_RAW)
                return;
index 868a2432625fddd68f2c02196f7dd0ffad998845..fa6fe24e3b931244b241ce80f2db5aead2aa8048 100644 (file)
@@ -256,8 +256,22 @@ static void shmem_handle_cp_crash(struct mem_link_device *mld,
        stop_net_ifaces(ld);
        purge_txq(mld);
 
-       if (cp_online(mc))
-               modem_notify_event(state);
+       if (cp_online(mc)) {
+               switch (state) {
+               case STATE_CRASH_RESET:
+                       modem_notify_event(MODEM_EVENT_RESET);
+                       break;
+               case STATE_CRASH_EXIT:
+                       modem_notify_event(MODEM_EVENT_EXIT);
+                       break;
+               case STATE_CRASH_WATCHDOG:
+                       modem_notify_event(MODEM_EVENT_WATCHDOG);
+                       break;
+               default:
+                       mif_err("Invalid state to notify\n");
+                       break;
+               }
+       }
 
        if (cp_online(mc) || cp_booting(mc))
                set_modem_state(mld, state);