Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: Use str_enable_disable-like helpers

Replace ternary (condition ? "enable" : "disable") syntax with helpers
from string_choices.h because:
1. Simple function call with one argument is easier to read. Ternary
operator has three arguments and with wrapping might lead to quite
long code.
2. Is slightly shorter thus also easier to read.
3. It brings uniformity in the text - same string.
4. Allows deduping by the linker, which results in a smaller binary
file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> #dw-edma
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20250114191021.854080-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
8e638918 753f324c

+14 -8
+4 -2
drivers/dma/dw-edma/dw-edma-core.c
··· 15 15 #include <linux/irq.h> 16 16 #include <linux/dma/edma.h> 17 17 #include <linux/dma-mapping.h> 18 + #include <linux/string_choices.h> 18 19 19 20 #include "dw-edma-core.h" 20 21 #include "dw-edma-v0-core.h" ··· 747 746 chan->ll_max -= 1; 748 747 749 748 dev_vdbg(dev, "L. List:\tChannel %s[%u] max_cnt=%u\n", 750 - chan->dir == EDMA_DIR_WRITE ? "write" : "read", 749 + str_write_read(chan->dir == EDMA_DIR_WRITE), 751 750 chan->id, chan->ll_max); 752 751 753 752 if (dw->nr_irqs == 1) ··· 768 767 memcpy(&chan->msi, &irq->msi, sizeof(chan->msi)); 769 768 770 769 dev_vdbg(dev, "MSI:\t\tChannel %s[%u] addr=0x%.8x%.8x, data=0x%.8x\n", 771 - chan->dir == EDMA_DIR_WRITE ? "write" : "read", chan->id, 770 + str_write_read(chan->dir == EDMA_DIR_WRITE), 771 + chan->id, 772 772 chan->msi.address_hi, chan->msi.address_lo, 773 773 chan->msi.data); 774 774
+2 -1
drivers/dma/imx-dma.c
··· 17 17 #include <linux/device.h> 18 18 #include <linux/dma-mapping.h> 19 19 #include <linux/slab.h> 20 + #include <linux/string_choices.h> 20 21 #include <linux/platform_device.h> 21 22 #include <linux/clk.h> 22 23 #include <linux/dmaengine.h> ··· 943 942 " src_sgl=%s dst_sgl=%s numf=%zu frame_size=%zu\n", __func__, 944 943 imxdmac->channel, (unsigned long long)xt->src_start, 945 944 (unsigned long long) xt->dst_start, 946 - xt->src_sgl ? "true" : "false", xt->dst_sgl ? "true" : "false", 945 + str_true_false(xt->src_sgl), str_true_false(xt->dst_sgl), 947 946 xt->numf, xt->frame_size); 948 947 949 948 if (list_empty(&imxdmac->ld_free) ||
+2 -2
drivers/dma/pxa_dma.c
··· 10 10 #include <linux/interrupt.h> 11 11 #include <linux/dma-mapping.h> 12 12 #include <linux/slab.h> 13 + #include <linux/string_choices.h> 13 14 #include <linux/dmaengine.h> 14 15 #include <linux/platform_device.h> 15 16 #include <linux/device.h> ··· 278 277 seq_printf(s, "\tPriority : %s\n", 279 278 str_prio[(phy->idx & 0xf) / 4]); 280 279 seq_printf(s, "\tUnaligned transfer bit: %s\n", 281 - _phy_readl_relaxed(phy, DALGN) & BIT(phy->idx) ? 282 - "yes" : "no"); 280 + str_yes_no(_phy_readl_relaxed(phy, DALGN) & BIT(phy->idx))); 283 281 seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n", 284 282 dcsr, PXA_DCSR_STR(RUN), PXA_DCSR_STR(NODESC), 285 283 PXA_DCSR_STR(STOPIRQEN), PXA_DCSR_STR(EORIRQEN),
+2 -1
drivers/dma/sun6i-dma.c
··· 19 19 #include <linux/platform_device.h> 20 20 #include <linux/reset.h> 21 21 #include <linux/slab.h> 22 + #include <linux/string_choices.h> 22 23 #include <linux/types.h> 23 24 24 25 #include "virt-dma.h" ··· 554 553 continue; 555 554 556 555 dev_dbg(sdev->slave.dev, "DMA irq status %s: 0x%x\n", 557 - i ? "high" : "low", status); 556 + str_high_low(i), status); 558 557 559 558 writel(status, sdev->base + DMA_IRQ_STAT(i)); 560 559
+2 -1
drivers/dma/ti/edma.c
··· 16 16 #include <linux/platform_device.h> 17 17 #include <linux/slab.h> 18 18 #include <linux/spinlock.h> 19 + #include <linux/string_choices.h> 19 20 #include <linux/of.h> 20 21 #include <linux/of_dma.h> 21 22 #include <linux/of_irq.h> ··· 2048 2047 dev_dbg(dev, "num_qchannels: %u\n", ecc->num_qchannels); 2049 2048 dev_dbg(dev, "num_slots: %u\n", ecc->num_slots); 2050 2049 dev_dbg(dev, "num_tc: %u\n", ecc->num_tc); 2051 - dev_dbg(dev, "chmap_exist: %s\n", ecc->chmap_exist ? "yes" : "no"); 2050 + dev_dbg(dev, "chmap_exist: %s\n", str_yes_no(ecc->chmap_exist)); 2052 2051 2053 2052 /* Nothing need to be done if queue priority is provided */ 2054 2053 if (pdata->queue_priority_mapping)
+2 -1
drivers/dma/xilinx/xilinx_dma.c
··· 46 46 #include <linux/of_irq.h> 47 47 #include <linux/platform_device.h> 48 48 #include <linux/slab.h> 49 + #include <linux/string_choices.h> 49 50 #include <linux/clk.h> 50 51 #include <linux/io-64-nonatomic-lo-hi.h> 51 52 ··· 2941 2940 XILINX_DMA_DMASR_SG_MASK) 2942 2941 chan->has_sg = true; 2943 2942 dev_dbg(chan->dev, "ch %d: SG %s\n", chan->id, 2944 - chan->has_sg ? "enabled" : "disabled"); 2943 + str_enabled_disabled(chan->has_sg)); 2945 2944 } 2946 2945 2947 2946 /* Initialize the tasklet */