Received: by 10.223.176.46 with SMTP id f43csp504179wra; Fri, 26 Jan 2018 02:21:47 -0800 (PST) X-Google-Smtp-Source: AH8x224E99ifw/AcT1Iy9jClPt8hZUQiGSu5T8Rd7Akkro3D/JeJeIUBZTkN/H2fBGdCy/nmbxzx X-Received: by 2002:a17:902:6c41:: with SMTP id h1-v6mr13932169pln.25.1516962107115; Fri, 26 Jan 2018 02:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516962107; cv=none; d=google.com; s=arc-20160816; b=emc3OBYM6qQKRbAk/iG4ECrZN11ZbE0H1d9A/bjOEFQiyIGn7P5xd9IehMjSReQ9Vf N1xxhqCv0Y4UwIP9pa4ZnKOQg/6qLJA+CSzCH+Kybl2K3giTTk7UAruB+cLUape07O20 iDGOoXkjCdH8PBR2rQJuv2a3u/ZeFPJHwJ2uuZWKb9aBhm06Z1nN3C9Aak1zw714r2RQ 6uK+JkJs4JYO8NpgAaynvZxLKccICBGNyuC7slWyN/j5JknbAxpUK6s8fcUE0VcXPFyT dj+NppGEnQPmADgBsnKUA5GIKSH4o/NgEnEDe2EOdbktQpVdL9k0sO/mYLTnoy0ZpQVu 0HFw== 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=v01sSsPFW5HhHJizT4LmJbIMwIx3czfHFNOYRZCSgQg=; b=OYZN5Lmp7/lvwUzMFCJVfdc0gXieiUDluCER3IlJSFUWfOujvqlvsPx3koxyTFhvgq 7R+I8K/fWNOT2ukzO2dJCM95C9oLqQRvpL1hZwtedzyIzyLLv84/yqXBZvRFWrvRaXft meqAddb1RraJxXWmB3MPA22om4nWC2aCy19kbdIRrH9h+lnQrRyiTceILwJ7tuz/oqu4 lXbnA8JXj+PjUvl3beiTG6cbq4hDMZCbPnGyxP17b3gKdL53+Cla7FKnoQJNENHbvZ2f TLl/7c6zvY5BEnvWiiIj/BhLPzeBc58FevnJxPmxx4LaKOraX7hCciKHfY6nVkyf135b /5Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e/Gb8K85; 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=NONE 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 g6-v6si2893940plj.394.2018.01.26.02.21.32; Fri, 26 Jan 2018 02:21:47 -0800 (PST) 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=e/Gb8K85; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752303AbeAZKVE (ORCPT + 99 others); Fri, 26 Jan 2018 05:21:04 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46487 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752216AbeAZKVC (ORCPT ); Fri, 26 Jan 2018 05:21:02 -0500 Received: by mail-pf0-f196.google.com with SMTP id y5so8017014pff.13 for ; Fri, 26 Jan 2018 02:21:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=v01sSsPFW5HhHJizT4LmJbIMwIx3czfHFNOYRZCSgQg=; b=e/Gb8K85JWY82X1jZjUspT/75qWe5T/Zs5OE8vbixwok1iz1vQy8vAfLTNOeNkcpm5 FhD4gYEXzYZ4i9EUOUQtEIX+h+fkfBrrs7aO6nDiUOI7bBn9DZ3Cg+ODUFxY15qtCbVj lYekr14GWxXmHSPrWdOd+UrTT7ryx9vV9E9KmTBEWbFgpB0I2/3Ix2jNSwF6AaeyzyXw +VnF7zlYPqLncz9f19sVqO23nWq3O/35AkTzVNo5Ug+445oQcMgOBxlvXJRiGkkvWgd4 GSo2jhn1ZjmiTdmzV1CUR2/MVb6bKgbzpcX63ZQVAsA/mbtoBnC4t1KquP/h3Crv/mHM T4qA== 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=v01sSsPFW5HhHJizT4LmJbIMwIx3czfHFNOYRZCSgQg=; b=rBwPY8R4rEFde5uXa3qQrl9LOdQ9oem+I0VvImVGxntfobrFsfuq4VAGzTp2gSxgXT XbOm6KygZax8indjFroHsKZYrTMvewflUAbaz0omGSGP79vGFqP2T3ex7rzmWi7b/fPj daqgt1UrZKBvn1luWsV5PWSTnqtaXBoyARiMx1gnjL/MuyGrWUciSCnRynnTC0yBrRGS KDTbUcZvPtw+keDRcsqSuWXNB0aCwLq7s4pQ6TM1LxoHEpNKcvJ8RnTywcjMU8IbhKlZ XF7KFP3cukF91ySeuD1IrN0nCCrGscdUj8YoL3lH/KVAQgZci35CXcHAS/mJW2aZN3cF JKWQ== X-Gm-Message-State: AKwxytdoGYEusNWdJY6gVi8ZVPTJmDDqPRrvnLQY8iHsPPTncTE3Ih4G Oy19I2WvS/u9BPa7xhmwC7Q= X-Received: by 10.99.124.85 with SMTP id l21mr15229280pgn.401.1516962061041; Fri, 26 Jan 2018 02:21:01 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:3967:a579:e81d:66fa]) by smtp.gmail.com with ESMTPSA id q16sm20148842pfg.124.2018.01.26.02.20.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 02:21:00 -0800 (PST) From: Jia-Ju Bai To: keescook@chromium.org, axboe@kernel.dk, arnd@arndb.de Cc: linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] block: DAC960: Replace GFP_ATOMIC with GFP_KERNEL in DAC960_DetectController Date: Fri, 26 Jan 2018 18:25:33 +0800 Message-Id: <1516962333-2198-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After checking all possible call chains to DAC960_DetectController(), my tool finds that this function is never called in atomic context, namely never in an interrupt handler or holding a spinlock. And DAC960_DetectController() calls pci_enable_device that can sleep, so it indicates that DAC960_DetectController() can call functions which may sleep. Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/block/DAC960.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 442e777..25ee9af 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -2725,7 +2725,7 @@ static void DAC960_DetectCleanup(DAC960_Controller_T *Controller) void __iomem *BaseAddress; int i; - Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC); + Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_KERNEL); if (Controller == NULL) { DAC960_Error("Unable to allocate Controller structure for " "Controller at\n", NULL); -- 1.7.9.5