ソースを参照

dmaengine: pl08x: handle the rest of enums in pl08x_width

pl08x_width function does not handle rest of enums for DMA_SLAVE_BUSWIDTH_xxxx
which causes gcc to emit below warining

drivers/dma/amba-pl08x.c: In function 'pl08x_width':
	drivers/dma/amba-pl08x.c:1119: warning: enumeration value
	'DMA_SLAVE_BUSWIDTH_UNDEFINED' not handled in switch
	drivers/dma/amba-pl08x.c:1119: warning: enumeration value
	'DMA_SLAVE_BUSWIDTH_8_BYTES' not handled in switch

this patch adds a default case which returns error

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Vinod Koul 14 年 前
コミット
f32807f1ff
1 ファイル変更2 行追加1 行削除
  1. 2 1
      drivers/dma/amba-pl08x.c

+ 2 - 1
drivers/dma/amba-pl08x.c

@@ -1123,8 +1123,9 @@ static u32 pl08x_width(enum dma_slave_buswidth width)
 		return PL080_WIDTH_16BIT;
 	case DMA_SLAVE_BUSWIDTH_4_BYTES:
 		return PL080_WIDTH_32BIT;
+	default:
+		return ~0;
 	}
-	return ~0;
 }
 
 static u32 pl08x_burst(u32 maxburst)