MLBEDSW-3653: Fix type errors in annotated files

This commit corrects a number of type errors
reported by mypy and refactors some parts of
the code which are no longer necessary after
making adjustments to satisfy mypy.

Signed-off-by: Dwight Lidman <dwight.lidman@arm.com>
Change-Id: I16b880b228e57f2a92fb8936f53e94886e0f9f44
diff --git a/ethosu/vela/register_command_stream_util.py b/ethosu/vela/register_command_stream_util.py
index ce49fc2..55fa620 100644
--- a/ethosu/vela/register_command_stream_util.py
+++ b/ethosu/vela/register_command_stream_util.py
@@ -68,11 +68,6 @@
     return npu_op.ifm2 is not None and npu_op.ifm2_scalar is None
 
 
-def is_dma_op(npu_op: NpuOperation) -> bool:
-    """Checks if op is a DMA operation"""
-    return npu_op.op_type == NpuOperationType.Dma
-
-
 def shape3d_size(shape: NpuShape3D) -> int:
     return shape.width * shape.height * shape.depth
 
@@ -302,9 +297,9 @@
         prev_access = memory_accesses[prev_op]
 
         # Check NPU consuming DMA output
-        if is_dma_op(prev_op):
+        if isinstance(prev_op, NpuDmaOperation):
             if index >= dma_index:
-                if not is_dma_op(npu_op):
+                if not isinstance(npu_op, NpuDmaOperation):
                     if (dma_outstanding == -1) and prev_access.conflicts(op_access):
                         dma_outstanding = dma_ops
                 dma_ops += 1  # Count DMA ops in the pipeline
@@ -313,7 +308,7 @@
         # Check DMA consuming NPU output
         else:
             if index >= npu_index:
-                if is_dma_op(npu_op) and npu_outstanding == -1 and prev_access.conflicts(op_access):
+                if isinstance(npu_op, NpuDmaOperation) and npu_outstanding == -1 and prev_access.conflicts(op_access):
                     npu_outstanding = npu_ops
                 npu_ops += 1  # Count NPU ops in the pipeline
                 if npu_ops >= arch.max_outstanding_kernels: