summaryrefslogtreecommitdiff
path: root/drivers/fpga/dfl.h
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2020-06-17 17:10:39 -0500
committerMoritz Fischer <mdf@kernel.org>2020-06-18 18:22:12 -0700
commite1d9ec3af3463c1721723f68403ee14214d0d2f6 (patch)
tree1b628e10210769aa1b3490babdd5cd281c22afec /drivers/fpga/dfl.h
parent23f872b6ece695750667a44016037154b91addef (diff)
fpga: dfl: Use struct_size() in kzalloc()
Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. Also, remove unnecessary function dfl_feature_platform_data_size(). This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Moritz Fischer <mdf@kernel.org>
Diffstat (limited to 'drivers/fpga/dfl.h')
-rw-r--r--drivers/fpga/dfl.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
index 2f5d3052e36e..044b0e88e5a8 100644
--- a/drivers/fpga/dfl.h
+++ b/drivers/fpga/dfl.h
@@ -299,12 +299,6 @@ struct dfl_feature_ops {
#define DFL_FPGA_FEATURE_DEV_FME "dfl-fme"
#define DFL_FPGA_FEATURE_DEV_PORT "dfl-port"
-static inline int dfl_feature_platform_data_size(const int num)
-{
- return sizeof(struct dfl_feature_platform_data) +
- num * sizeof(struct dfl_feature);
-}
-
void dfl_fpga_dev_feature_uinit(struct platform_device *pdev);
int dfl_fpga_dev_feature_init(struct platform_device *pdev,
struct dfl_feature_driver *feature_drvs);