Received: by 10.213.65.68 with SMTP id h4csp2451258imn; Mon, 9 Apr 2018 03:52:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx49GmJlD8b90kJ9uSKmx6x6v2npA2xPTZw5GtN/ILGjShrP0nGodXGrdy+L2kBFeB+8ezX1/ X-Received: by 10.98.76.68 with SMTP id z65mr28999961pfa.181.1523271134520; Mon, 09 Apr 2018 03:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523271134; cv=none; d=google.com; s=arc-20160816; b=RoswBKT0iosZaxEZpCXbHKgbXLRkpNQA4DBALqJMkCHyQZ8ECj2Kulh6rA6rGqY8LF SMcluU0OjVS5bYoHx/5grSK8gr/jF9sGGYuZsFn08phOmVa4DxIdaiLVwzoXzdFVHKEP 8cKkDQEQSPbayNVMfjZbxlEkZmnbeSoHRO1fLGNYZu9AZaOtGOpHrNyO+cuwig+vTvaD XOvgBIdqRc5Pd6vXhNIMQldtYOVyPLZeFAp808nH/l/VFPPYZ747dWxHfCWxGBRTFyf5 exJVe7xgN7BgOVDtnMn/AdZXTIMMmyQPrbNAEoZOg4G66zFi+BgYtozzmw8ODKFTVUsN z/Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=tO8XgnoUfbHrEcp3XKOoJW+ax7YA7F12H0dEsnwSE7g=; b=czb9jE2MLOdtPogIHDiYhhBbMos6yjWvYS380/vVSpqPFIabyqBlA4SbgjQncBRGRi Te4UVVAJbXdDP/VVsNuggEOKAHDIyiCAjJ0ovwsWRoj4KirJDhPipjM7FY9ZdOGNtBYE vDx+fO0MUuM2j6Bob2YPLoPoWq66WDb9REIQajrtbBcLM4KDJ09HacB7fvJ8y8nYMFyH fAycnHhdAPVTI+jcHo1oxADE/5Qml6bL7q3aPddgIz/FHJ/JRkUXq9ylT5hb52UavVXb WyeJFTbwH2OukapWeZcrxFBVGJ7piodQrbYlYo9TY3I73rroEfTGGy/4K4rV4ouZ/Vhj 0mZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Cqe+P1GH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si45955pgp.293.2018.04.09.03.51.37; Mon, 09 Apr 2018 03:52:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Cqe+P1GH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752052AbeDIKrp (ORCPT + 99 others); Mon, 9 Apr 2018 06:47:45 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:44756 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbeDIKro (ORCPT ); Mon, 9 Apr 2018 06:47:44 -0400 Received: by mail-pg0-f65.google.com with SMTP id v26so91168pge.11 for ; Mon, 09 Apr 2018 03:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=tO8XgnoUfbHrEcp3XKOoJW+ax7YA7F12H0dEsnwSE7g=; b=Cqe+P1GHdNtcnEP6fHs/ZRpC/k+pZe0ojv4WOktJ54PKxzDr58OLER/GgdDSdyv7ZD MsY/r/JHj1Ve/uk0fY9pq04DU+euMkyQo+CWALOoA2JKdt0m2kskF/bhi2jBVBZD4Qkk RG3Yidz12Dijt2UIND5U/3h5qsapUXIhhOFz7taZjAZkrTePq2FjYkO+sO9R6uapuQUd LOu8CxmWQrZHkZ66tyz3RnkcOyQ3Zuf4weo7DDB7p+iJ1UCtx8oUasA9svyDghNeFHtG ILSKqG5Q9skevDAOcIPvwJiPuxtBbXSNs/aYUE/+TAKwgBqDnLzsK3hXCtUGQnw0sYXJ 9noA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tO8XgnoUfbHrEcp3XKOoJW+ax7YA7F12H0dEsnwSE7g=; b=fjwnBNws1T6UjMTeQXJOpiDOxvRgnZpDAy6j91KP6W9BsiK3oeZEwOSOgZiS61C4V8 TNM++c7Zk4kKXHMRU+ecswOj6SLwoEa3iLxvflYKtEzgEpH0dTptDTezi7KZrxZmqM4F 4EWsEmvJZXlqGPL6g9kZnBVw3aTQcoq7pUKXCE5LIJNHuzm2j3VKgYV2JLMXOFqH6krf OGZ9eZf1RUG7wLEcPi5XFgVjQEdgMaHY1Dq0HTjcxm/nwzesdivON474szPI6W0lSqg5 DUn4jsNHTPW+fkPHkp3OKuK3/jjvMPXDvkOx2iA7hwmaIPbIwtVj7Of1EzYZ+PQ+6tLJ gpRw== X-Gm-Message-State: AElRT7HSFZirnDCiBftnjs0cVFjdO6aLAle4QSqDNxayV+GGWd88ZyWt EbgUB3grvyZpDqpbYDIZ9F8= X-Received: by 10.98.157.7 with SMTP id i7mr28271830pfd.85.1523270864350; Mon, 09 Apr 2018 03:47:44 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id q15sm273438pfi.140.2018.04.09.03.47.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 03:47:43 -0700 (PDT) From: Jia-Ju Bai To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, vinod.koul@intel.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] sound: soc: intel: bytcr_rt5640: Replace GFP_ATOMIC with GFP_KERNEL in snd_byt_rt5640_mc_probe Date: Mon, 9 Apr 2018 18:47:37 +0800 Message-Id: <1523270857-22795-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org snd_byt_rt5640_mc_probe() is never called in atomic context. This function is only set as ".probe" in "struct platform_driver". Despite never getting called from atomic context, snd_byt_rt5640_mc_probe() calls devm_kzalloc() with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, to avoid busy waiting and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- sound/soc/intel/boards/bytcr_rt5640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 4a76b09..e7705e0 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -766,7 +766,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) struct byt_rt5640_private *priv; is_bytcr = false; - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_ATOMIC); + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; -- 1.9.1