Received: by 10.213.65.68 with SMTP id h4csp2452308imn; Mon, 9 Apr 2018 03:53:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/WJPx8tYDObNAPfGc5MaTNAzJCWBaD1QfCQkFoFHRpMX/xPB/WNxseGRu/05e5DpZlHv79 X-Received: by 10.101.65.75 with SMTP id x11mr25009623pgp.203.1523271199140; Mon, 09 Apr 2018 03:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523271199; cv=none; d=google.com; s=arc-20160816; b=C3wd1MG42ymthCp/i1Alz06WldxzN2UwYGHVyel3zz3qLyThLeLK+YGoLUSpcmulWo IUbl2Ca5Wo5YoaxAjG3+2zlMr/RoBYR28NmRRkblZ73anpWlshj6zZmv2nLSDWqquCwJ V3y1/xginweaZL6AGiTpK4h3laEkQwR8DigyFbWSchlAjF62rKrz1h+jGsEASODy+I87 LOsf2tPGBaOdjJtFS+1liaRIF1YU6Ht7i+zD9vfPEJw5KtwhZuBZ2EZsM5UisPOFgUqK MMkoX4IQXaaip9mRWiGI7GI/vTwbOnNrnBZTbykNvmvva/iLMr9an+mg/XYuQ6gHzwWk t3dg== 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=YqiCTOzynDGEkN7srckEgV9SHfF0vmz1+EaOS88ibNI=; b=PAhIBEPyqu/uFk7XWbbZQeVtRxD0xfzY/i7TxOov/1n+s9babIMyomNMShfK8kQmIr f6KiJvWOJiXMKKHg8diQNliWNZuKpHicy1VvO29EizMvOrsv35w8lCSwLaO3adMRqNdl FXV1FDEmfLqOIcUPOacb3EAiJrk/okX92D36kw0lBhE88eb1PJt0RWdXSaqnE33+Oyii AVpeBd07UBKgFNgHH0mkYgKy3yEUn9wU2IgrjJ2DKm8nyR80MgOooA8st+lnkDM0X0CY W5LT3CWThGoYQKeQTmcZoYh9loi1WSJBeWqvPcgiqYyMev9LFgp4GGb1Eic+xHsUXdpN KLvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SXkv2jKW; 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 d1-v6si63044plo.328.2018.04.09.03.52.42; Mon, 09 Apr 2018 03:53:19 -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=SXkv2jKW; 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 S1752168AbeDIKsk (ORCPT + 99 others); Mon, 9 Apr 2018 06:48:40 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:41635 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbeDIKsi (ORCPT ); Mon, 9 Apr 2018 06:48:38 -0400 Received: by mail-pf0-f195.google.com with SMTP id a2so5597191pff.8 for ; Mon, 09 Apr 2018 03:48:38 -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=YqiCTOzynDGEkN7srckEgV9SHfF0vmz1+EaOS88ibNI=; b=SXkv2jKWmM2vhHI9BO0BxDhkpq14UaQ5FAUuLrxWTJaRueiZ7JCXezz0UDcuGEUEZn a6H8Z9P5JdY8BXeGKhwR9oehnhelR/YWWR1tTp7TOaYVfAu+8S0Rq0F77T3h5X6Ia7v7 uWHQKEQCJt+Bq3H3dq+6yvwhX/im9RLf6GkfaEkhcxDlMDGR0xvbDOQyRQGQx+vkKQqM ZdoymGApTr7EzLW0IeFCx0wR8L3CnlvUKdxE4J2B39RKtjEAfb2ig22QG+b5zNx109H/ L0Mg+DMtFA8Pj9uI38woYJ4rdTwdcsm4Q6YToyFPioos5wS32UgY+nFkR7iMEqQZ2DqY qGQg== 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=YqiCTOzynDGEkN7srckEgV9SHfF0vmz1+EaOS88ibNI=; b=fg46DWQ0wzJXheV6h6ZqzXCFf/2c3Hs1MHOOsOfIsuHpfWx8f/ltuz+OGrjGqXq24M xefN/hjTnkFHlU7RnJQUUvA+U+DBANmaT6yDhKa37x18jMYJRGmw7eoPDAGsfBr6qWGb zwlM04JBb0ZH9xVkw1Zb0lsRCdlx/eUZcrZUFsuHhjAA24j3SF6Gp5b1y0d7NHnKr5XB vX8e88RlpHiFUlucZo5jgFs+QyZfMKiXkFpM3GqEW5lVDNfh05A/mrEBT43w151Ah45x h0hx5f8PBckcG+UYJAd+ejFc1USpIyKt2b4rI1dEu7jhKLv9PwHer20oU0s1AR0hlY82 j1+w== X-Gm-Message-State: ALQs6tBpCpI8mhCcsfXVmasAOFFXO++NUW3spJGA5V9SXzrgO9Lguy/l RSss1gAfy8HDhTHUA44rBm01Og== X-Received: by 10.167.130.146 with SMTP id s18mr16172125pfm.236.1523270918496; Mon, 09 Apr 2018 03:48:38 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id s7sm141540pgq.48.2018.04.09.03.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 03:48:38 -0700 (PDT) From: Jia-Ju Bai To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] sound: soc: intel: cht_bsw_rt5645: Replace GFP_ATOMIC with GFP_KERNEL in snd_cht_mc_probe Date: Mon, 9 Apr 2018 18:48:31 +0800 Message-Id: <1523270911-22937-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_cht_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_cht_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/cht_bsw_rt5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index 5bcde01..d31d0e4 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -555,7 +555,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) bool found = false; bool is_bytcr = false; - drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC); + drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); if (!drv) return -ENOMEM; -- 1.9.1