From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752640AbdI2UR2 (ORCPT ); Fri, 29 Sep 2017 16:17:28 -0400 Received: from mout.web.de ([217.72.192.78]:62704 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbdI2URZ (ORCPT ); Fri, 29 Sep 2017 16:17:25 -0400 Subject: [PATCH 1/2] ACPI: Delete an error message for a failed memory allocation in five functions From: SF Markus Elfring To: linux-acpi@vger.kernel.org, Len Brown , "Rafael J. Wysocki" , Zhang Rui Cc: LKML , kernel-janitors@vger.kernel.org References: <267c842c-d38a-67be-f61b-a2056f7e71ee@users.sourceforge.net> Message-ID: Date: Fri, 29 Sep 2017 22:17:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <267c842c-d38a-67be-f61b-a2056f7e71ee@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:41trYJdY64GFvfAiIO8o/bLKI5M425l5LZIn3RxSTWVmvwND+bf bG6CxTEurFJlLTo7vglhkLfd01cSnG+ibLmr1dAAad9uBwToaPbOIxM14eOSpFrinEOYzQ3 MqWo31UlJX6wgGCMJIot34uubtM4FqboUZrZC8R8i2LtN4PtRJHzbbTyY62dcsgAjn13riK 6II4j/9ZuObxA5/C6YjEQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:7HvmzZqNv9o=:Dya+1AIoy/v2hoGof1Y6Yw j2w6ac7Ka2tRG374riRFJFtrwRqL+bP8vw/tetzTRIFqGJo+Ig/eaYQRQwqByBodSoWSRSpyQ WrWWOxdeYNUiR82xLEj4eTlVsESoD48eCI8Rkz/Xb97bFfKUMyo9D3dGZGrMMRlkw1gAtPXBX mLJRLce4r8ZcE3b6mHGAOu7T8IGFzZLReRs5CGyNe4LT2uJoMqZWhV+aAFiEzaZ4DQ+Ph87Dm azEggUxA9Rv3kWnXgDXnn+fwC0ijexbBcpcRG1NueW5GWdhZrX+yF+d5qy6MzbRijtPpzJeXH UZkUTEDASmbHYb17LwivPSpe+2tV0IS7xKgnae5IfZat0oapw3tWorPs2OpXNHP0smZXU38Tl BgJho4eTczgcr5XmusAotil1cN9b61B4gGEwDSBAw0/isgPwCIhUg2tpa6bBfbRXPYzbGYS2j n4lsmR0goepDiL87JfU8q273XxtNZR1a74F3uNQaEXENGERx32mHDT1mK2lvvLwKZm1Go3Jcl K9xnwVOmPijomDPlXI06l8RwzD9SH0ur7di/2WYLn3GCi+leNxSZrvZXYuu3Vjuzpv5NpbxtI E0SVZjoroYJxvzWsXOi2b7UUC13k//Vo84wuRG50a+ZLsQtWhVsMtSGzZHmBA/JmXHBfTG2C8 lXvO2LBsZNIzZ3pqcdJSzmjPhvOH8G+T5OsNqy+LXjEQyoHtIA0qoBUHzscyJmmonojxhSU7i Ua4eNfyiTnSj6vJ1FHtqoF1W1AE9V9W7ym8SNdPVQ2Bs0T30X4iEAwyLfv+tamC9v1AwBfyOu eNiofriFcBgozspgLVh3dGqGzwjI5DwHFesf1Ldt7sLelI9Wsk= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Fri, 29 Sep 2017 21:52:44 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/acpi/acpi_platform.c | 1 - drivers/acpi/acpi_video.c | 1 - drivers/acpi/ioapic.c | 1 - drivers/acpi/scan.c | 5 +---- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 88cd949003f3..9ca1fa1806ae 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -85,7 +85,6 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, resources = kzalloc(count * sizeof(struct resource), GFP_KERNEL); if (!resources) { - dev_err(&adev->dev, "No memory for resources\n"); acpi_dev_free_resource_list(&resource_list); return ERR_PTR(-ENOMEM); } diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index 0972ec0e2eb8..0160f237d963 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -822,7 +822,6 @@ int acpi_video_get_levels(struct acpi_device *device, br = kzalloc(sizeof(*br), GFP_KERNEL); if (!br) { - printk(KERN_ERR "can't allocate memory\n"); result = -ENOMEM; goto out; } diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index 3595aa9c7c18..99d7c69eae9b 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c @@ -124,7 +124,6 @@ static acpi_status handle_ioapic_add(acpi_handle handle, u32 lvl, ioapic = kzalloc(sizeof(*ioapic), GFP_KERNEL); if (!ioapic) { - pr_err("cannot allocate memory for new IOAPIC\n"); goto exit; } else { ioapic->root_handle = (acpi_handle)context; diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 602f8ff212f2..7df7bea1e177 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -652,7 +652,6 @@ int acpi_device_add(struct acpi_device *device, new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL); if (!new_bus_id) { - pr_err(PREFIX "Memory allocation error\n"); result = -ENOMEM; goto err_detach; } @@ -1579,10 +1578,8 @@ static int acpi_add_single_object(struct acpi_device **child, struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); - if (!device) { - printk(KERN_ERR PREFIX "Memory allocation error\n"); + if (!device) return -ENOMEM; - } acpi_init_device_object(device, handle, type, sta); acpi_bus_get_power_flags(device); -- 2.14.2