Skip to contentSkip to conversation

dma: tegra: make byte counters unsigned int

PATCH New Dmitry Osipenko 1 participant 1 message Nov 6, 2018 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 dma: tegra: make byte counters unsigned int

Quoted 24 lines · Ben Dooks

The buffer byte request length and counter are declared as signed integers but the values should never be below zero, so make these unsigned integers instead.

---
 drivers/dma/tegra20-apb-dma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/tegra20-apb-dma.c +1 -1
index 8219ab88a507..adfd918baedc 100644
@@ -155,7 +155,7 @@ struct tegra_dma_channel_regs {
  */
 struct tegra_dma_sg_req {
 	struct tegra_dma_channel_regs	ch_regs;
-	int				req_len;
+	unsigned int			req_len;
 	bool				configured;
 	bool				last_sg;
 	struct list_head		node;

drivers/dma/tegra20-apb-dma.c struct tegra_dma_sg_req { · line 176

Quoted 10 lines
drivers/dma/tegra20-apb-dma.c +2 -2
@@ -169,8 +169,8 @@ struct tegra_dma_sg_req {
  */
 struct tegra_dma_desc {
 	struct dma_async_tx_descriptor	txd;
-	int				bytes_requested;
-	int				bytes_transferred;
+	unsigned int			bytes_requested;
+	unsigned int			bytes_transferred;
 	enum dma_status			dma_status;
 	struct list_head		node;
 	struct list_head		tx_list;