hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/dma/sh/shdma-base.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Dmaengine driver base library for DMA controllers, found on SH-based SoCs
34 *
....@@ -7,10 +8,6 @@
78 * Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
89 * Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
910 * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
10
- *
11
- * This is free software; you can redistribute it and/or modify
12
- * it under the terms of version 2 of the GNU General Public License as
13
- * published by the Free Software Foundation.
1411 */
1512
1613 #include <linux/delay.h>
....@@ -386,7 +383,7 @@
386383 switch (desc->mark) {
387384 case DESC_COMPLETED:
388385 desc->mark = DESC_WAITING;
389
- /* Fall through */
386
+ fallthrough;
390387 case DESC_WAITING:
391388 if (head_acked)
392389 async_tx_ack(&desc->async_tx);
....@@ -712,7 +709,7 @@
712709 BUG_ON(!schan->desc_num);
713710
714711 if (sg_len > SHDMA_MAX_SG_LEN) {
715
- dev_err(schan->dev, "sg length %d exceds limit %d",
712
+ dev_err(schan->dev, "sg length %d exceeds limit %d",
716713 sg_len, SHDMA_MAX_SG_LEN);
717714 return NULL;
718715 }
....@@ -731,7 +728,7 @@
731728 * Allocate the sg list dynamically as it would consumer too much stack
732729 * space.
733730 */
734
- sgl = kcalloc(sg_len, sizeof(*sgl), GFP_KERNEL);
731
+ sgl = kmalloc_array(sg_len, sizeof(*sgl), GFP_KERNEL);
735732 if (!sgl)
736733 return NULL;
737734