linux/drivers/dma/qcom
Gustavo A. R. Silva edd3c38999 dmaengine: qcom: bam_dma: use struct_size() in kzalloc()
One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2019-01-07 18:07:21 +05:30
..
bam_dma.c dmaengine: qcom: bam_dma: use struct_size() in kzalloc() 2019-01-07 18:07:21 +05:30
hidma_dbg.c dmaengine: qcom_hidma: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-17 11:49:41 +05:30
hidma_ll.c dmaengine: qcom_hidma: check pending interrupts 2017-12-12 11:02:43 +05:30
hidma_mgmt_sys.c dmaengine: qcom: simplify getting .drvdata 2018-04-22 11:48:44 +05:30
hidma_mgmt.c dmaengine: qcom_hidma: Check for driver register failure 2019-01-07 09:50:39 +05:30
hidma_mgmt.h
hidma.c dmaengine: qcom: simplify getting .drvdata 2018-04-22 11:48:44 +05:30
hidma.h dmaengine: qcom_hidma: introduce memset support 2017-07-19 09:33:21 +05:30
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00