From b15fc7c2c88e7a97fa347446301c37272de20ed5 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Wed, 12 May 2021 22:36:12 +0200 Subject: PNP: Remove pnp_alloc() The kernel will complain anyway if it runs out of memory, so it is not necessary to print an extra error message when that happens and kzalloc() can be called directly instead of pnp_alloc() which then becomes redundant and can be dropped. Signed-off-by: Heiner Kallweit [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/pnp/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/pnp/interface.c') diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 602c46893e83..44efcdb87e6f 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -214,7 +214,7 @@ static ssize_t options_show(struct device *dmdev, struct device_attribute *attr, int ret, dep = 0, set = 0; char *indent; - buffer = pnp_alloc(sizeof(pnp_info_buffer_t)); + buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -257,7 +257,7 @@ static ssize_t resources_show(struct device *dmdev, if (!dev) return -EINVAL; - buffer = pnp_alloc(sizeof(pnp_info_buffer_t)); + buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); if (!buffer) return -ENOMEM; -- cgit v1.2.3-58-ga151