Received: by 10.213.65.68 with SMTP id h4csp2452046imn; Mon, 9 Apr 2018 03:53:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49iek7pCKRx2wNzcYQRt+v4h2pWq17Xnz7HPsvUDFpWnHcKftZPv1H5bLck7fqRPS5DD4rc X-Received: by 10.99.143.30 with SMTP id n30mr25398942pgd.213.1523271183080; Mon, 09 Apr 2018 03:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523271183; cv=none; d=google.com; s=arc-20160816; b=xDZdk+sizDg2EFUAtiuq+pq3ZyeZ/6UA9jpliC4WjtIbiKKXA3A15Ol6IK0IMfnWit rONh/Q1hSORN7u5nv9NLueEECA3UBLcnFFmEWSaJHB3sbZYNH1QAUQJp7ARvbVFTkroA 3AUE773reMQEQocxeLCU89UrK409vz0ioHQfRTlDXV0jG6duray5xm2xM3M3sWJ880of 3puPU8+8s8pPj1UFS8QvpPqlxWVqMvImtwRIaB7eMqCQvJCtD1oOly4MhLZa7vx/ZZ39 wHrx5r7CnV55tJKM/i8hMI7NO9eYkzmNIGYPNE+hxnwgFM/hrh9dDUdA2aXzunBrq5WK NSgA== 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=daHxaEu6v76lNTDlJU0uIA95FPB/HSlPvFyGo/9pPT0=; b=WtEVeBE0/p8mnuwb/1tHim+ufcs//pogq+0DAK3m2hSYUTnZue5hLIwzmDcgQYCHsl NC1orXhUrz28mZmyuYs+1ezF/E7XA295Zp0dBUq5ekjDswSxZiBgr7nORsWC540pKh8r 0PeKkww56DzGTRhQlZDF5AHsq1EQz7kWJSHw48d9DabtqpsuN04/AtiJ5aSFH2whjqil hz99sCJjjLSYCcKJyyZ6hZBCg+GbS1aqnpz9N3NP6DlphFeRrRmRDOFqAbvygDz5euKq 6UVb1zaTDnZq/jNgtET7VZQ2jidxEh8rEsfgbXolaOwS+cBpLZbsFD/hApgpGna5AbY+ 2X+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZMkQkuc8; 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 c22si40124pfe.29.2018.04.09.03.52.26; Mon, 09 Apr 2018 03:53:03 -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=ZMkQkuc8; 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 S1751629AbeDIKsR (ORCPT + 99 others); Mon, 9 Apr 2018 06:48:17 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39772 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbeDIKsQ (ORCPT ); Mon, 9 Apr 2018 06:48:16 -0400 Received: by mail-pf0-f193.google.com with SMTP id c78so5593398pfj.6 for ; Mon, 09 Apr 2018 03:48:16 -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=daHxaEu6v76lNTDlJU0uIA95FPB/HSlPvFyGo/9pPT0=; b=ZMkQkuc8mXH8e4dLZGsrMLVgMFVQM7DdnM1+wcIKzLquGtl6MwvlVtPX346MdGfENZ EEQ5dkfzhaflzb/1mW8K156NUzThM1g+7s3GQiTogzcRVaMWVjXXSjgVHfxsr7HORNJQ 83Aw2tsejBiTHwIvWBWVFepyA15cHDBW2ejBA9/UC2CwJm7N1UOcMKTAUuX4t+C+8iG3 RfyMBqbBuyqQ2qFHo3WM5Pg2hmMlxe0jjQALMDImEHU8O0GQltHH3RrYXGNMvfeNNe9W mvKAlV3T8k/uJiv5Ni326g8oDfiY0sqWAvS2ECo4BjKHSZQGXhGNNi2T1E5Vx8t8Mi1E BA5w== 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=daHxaEu6v76lNTDlJU0uIA95FPB/HSlPvFyGo/9pPT0=; b=EMZXEPMMJySe20S0c7oD998202Q/ma1uDniz98ylex3C1obbZ24E3IW79+y5X1rf2T ZdIy/+iOJbeWkjHLdy5HtMqqKBCEHU+tL1uLIDlYUdTGBqPF3m/gA6C2SnGJYlBFoSsR pNAfh19w49Iylfp04WUvgqqvP0m/BMg9PnEw6iiviOuSGFi9aXZKexgUIGkpuJn+W43+ IdiekqNFsGbbrSF7kECVzpAByqT7PR2QEkCafCKSZRhP6AvAh8FASHoKqAMrM2idzAPA ws7AF/OppcUZgLprbKJK57J2BnjTbvxAP6CLQzWepQha2S3U6eI7xCmqzYY0UK3dHWdV 75uA== X-Gm-Message-State: ALQs6tABxV+2ZkIeOkDpXX5KJMQivy9Z57ffJ7B4C/nplxE0Prpub8Wi NsHhzdV8B6kRzRjll4vsM3Ap5g== X-Received: by 10.101.82.138 with SMTP id y10mr4725910pgp.343.1523270895796; Mon, 09 Apr 2018 03:48:15 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id u27sm223976pfk.100.2018.04.09.03.48.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 03:48:15 -0700 (PDT) From: Jia-Ju Bai To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, mka@chromium.org Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] sound: soc: intel: cht_bsw_max98090_ti: Replace GFP_ATOMIC with GFP_KERNEL in snd_cht_mc_probe Date: Mon, 9 Apr 2018 18:48:10 +0800 Message-Id: <1523270890-22889-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_max98090_ti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index 20755ec..bc2ec36 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c @@ -280,7 +280,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) int ret_val = 0; struct cht_mc_private *drv; - 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