From patchwork Sat Aug 12 11:31:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9897031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7398860351 for ; Sat, 12 Aug 2017 11:41:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64AEC28B85 for ; Sat, 12 Aug 2017 11:41:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 594D928C63; Sat, 12 Aug 2017 11:41:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AE8C28B85 for ; Sat, 12 Aug 2017 11:41:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F1988266EC4; Sat, 12 Aug 2017 13:32:44 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0CC47266EE0; Sat, 12 Aug 2017 13:32:43 +0200 (CEST) Received: from mout.web.de (mout.web.de [217.72.192.78]) by alsa0.perex.cz (Postfix) with ESMTP id 8CE13266847 for ; Sat, 12 Aug 2017 13:32:41 +0200 (CEST) Received: from [192.168.1.2] ([77.181.183.107]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lmu6S-1d8HQ80lae-00h4zi; Sat, 12 Aug 2017 13:32:04 +0200 To: alsa-devel@alsa-project.org, Bhumika Goyal , Fabian Frederick , Jaroslav Kysela , Julia Lawall , Takashi Iwai From: SF Markus Elfring Message-ID: <20c860e6-2aeb-eb8b-2ba7-fba216a70cfa@users.sourceforge.net> Date: Sat, 12 Aug 2017 13:31:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:bAEpienQK9NM6DdoU/weRQVAPSXM2NekDFekI0LaC5o5QobJUjj JLU6QiBKQs9YGUlhM/0qC7q1lY7Dt3tWQxygPKOlJURlhCeWGGe9x5+rSYlvcng232T7kOy 2MDMrQlZlScYcspfit23yMV0n6pyQHjsGFW9fEEG15+g9hvE/FZG0WJUNP0LF5KufuoX+20 rx4WvSanmUQp3JjiRgsKg== X-UI-Out-Filterresults: notjunk:1; V01:K0:FPYWQHv4iUg=:uB3z8AELlskNrwa3wobSpe 3EUEXLq6Jth4z8tHwAog7WT5+7rKWSbXwNx+p0l/HwXJ1RZW6Xy3hrQ1wKthT+9+0fn7U5hWb IU7uTA1NTo5EIFKX+/VDi6rEWfW6kQeZh+hEKpzNGr8ZVTXM9nsARX3LSNsVRGL8rbfl+uWb4 DYc7nJS7P6p4k6bzTjM7KQbRDQvOhFrbcZxJDr+RbkzxF/q+vpgK1HZ1LVO/yCayJjtciIAWe ZELhiJlnE7Wi48NfyNpi9HME9OhlD6/M46HsRf5E61EKNdsMu4fkBsq0tBA0A9MV+s0p56bCW e9zZKWEOzNJosL6ugIpjMJizdAy5Qtr5czIzmOAxIAfKrpEJFYIcOVTUmMmU4gTUn40DPNP4O Lf4vOGVSGzIg2L04Sy/TgT4sQfjZu5WUiFUHas0Hkc8ffBXiW/QLDW2NoCA2fiSgRD1+Bm+Uh E4dzVWAZgaGmC5fw/041KF7M9/0/k0WgysQ4zpgHwcjjdVE2LPEfB3gtZJjwkMZoZfmN0Jw5U kqS8GVTXF29CpnyYv9WBLOOLbPrFGcKrEmDIHB5bb/K6XzAOSK9m/QYXAAEwiUpzerL/AX9ro xAOuX5MEY56+AJsmja7ZtgdFFkA1zs4Ombg249ax8FbHhliCsmS9F+qwTfviaAANDoHSSqQ1I 0AvzSFxz0CDjMgm8pOAow4vn3/n0GqdQyUSfosmWNLCSAcXrUdKKWsq4NKyI8i6RPIqiAvqQ3 klqVVFTfg6k4oRAU+DxDygOmboeRRJHOY6SbfxK73y4dTGnDEHaS0OIsfdHWitN6xidUTLjF5 YJ0Rdb4+7YwKdw4Orme1mudBWFEzqH3nVp8qzAySaS5DVFDYO4= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH] ALSA: trident: Delete an error message for a failed memory allocation in snd_trident_tlb_alloc() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 12 Aug 2017 13:20:16 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- sound/pci/trident/trident_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 64d3b8eba4bb..0eca3c370990 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -3363,11 +3363,9 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident) trident->tlb.entries_dmaaddr = ALIGN(trident->tlb.buffer.addr, SNDRV_TRIDENT_MAX_PAGES * 4); /* allocate shadow TLB page table (virtual addresses) */ trident->tlb.shadow_entries = vmalloc(SNDRV_TRIDENT_MAX_PAGES*sizeof(unsigned long)); - if (trident->tlb.shadow_entries == NULL) { - dev_err(trident->card->dev, - "unable to allocate shadow TLB entries\n"); + if (!trident->tlb.shadow_entries) return -ENOMEM; - } + /* allocate and setup silent page and initialise TLB entries */ if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), SNDRV_TRIDENT_PAGE_SIZE, &trident->tlb.silent_page) < 0) {