Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp298005imm; Thu, 26 Jul 2018 19:30:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdqgsRC90DofryjdPPs43PWibKGmLugdS/UmWSayRCJZJ2/UKLSuvROSmF6G4368z1Sh3Pz X-Received: by 2002:a63:5055:: with SMTP id q21-v6mr4023952pgl.397.1532658628720; Thu, 26 Jul 2018 19:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532658628; cv=none; d=google.com; s=arc-20160816; b=T5Z+ACEOk3ASvFsPxn13DxG0DRl7K+EASt3zQOCHX2CV+Xisp4ulseGmv4rADAI9ZE mmUTltvTHjOp+XoUcHuyulABZFZIcXrx10BnpeXOrYZ5GW1ZJDqN4CFFWYVua8OnHKJ4 zqfHyde/pcGgpEpi+Zk3DdxJNvzCnVCaj/E4MQnDbnI3Ap5/HpbRbrKbruU9Yr+zugOy Thhr3VvA7hbELOtOFVgkjzXYfeM9QnZQOdQgnp8OuQ5g3kWZeVgiejjfou9vObVDpYfi Xuc5rjs6EPHMSYTwEtIC7zMv5jCJlFd3+N06SMXJnd8Ig7i+IVwQo4XnHyKdr1qKCIq3 TU3g== 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=/fkGNK+QWkyH2mt9ZNA3ms785gxxvkLfa+DGEin9lUA=; b=ne/rzXLs1mBv97INdgO5R65evJEkx61wIJuzWNu1VBZm/6UbHP6e/xyf6ZYpaRSY2G tz4dLM29KQ2Tkr/RFgLQLZ69+voliqV7mx5vyVAOxeEtc+fxJYU74GWQUaw87+uQD6UW ZPL8cYI6z1IexxdTuOpdYv7pudN2PAfCCgVzmfzeTZ80XSK6hFlLyBL42a4xyGTiIpdE a691qi6NdCz57No0rJGCKjUiCvZRkDOJKXDGaxtSH+yEWjQDV5ZLKsVtxk1Edet2Su1s 28WRsX6j1xpn0BhZUdnIBudIdXYozGvu3QzO+ViY6n1kZRCW6fZuzxIufc4sOHUHwccp CbjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uUkIuxJC; 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 e66-v6si2749527pfk.198.2018.07.26.19.30.14; Thu, 26 Jul 2018 19:30:28 -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=uUkIuxJC; 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 S1732113AbeG0DtC (ORCPT + 99 others); Thu, 26 Jul 2018 23:49:02 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37092 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731961AbeG0DtC (ORCPT ); Thu, 26 Jul 2018 23:49:02 -0400 Received: by mail-pg1-f195.google.com with SMTP id n7-v6so2308050pgq.4; Thu, 26 Jul 2018 19:29:27 -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=/fkGNK+QWkyH2mt9ZNA3ms785gxxvkLfa+DGEin9lUA=; b=uUkIuxJCcpLb2Inaanuhq2XUrYBS6Yk0bKowzFrQGnAXWvnTJonM9g9p0Fvgo//r5+ QcKucWWJpMW+RY2hckOR0SxExCp0kpbl+ct/UlN5NBLtw0ogfdMX1EtWP0UDdsf40l2g RGIi8dZhP5+j2jwQk776CNJowdemzoyTj1TgUIQBE4Y7BK7e0WSAfUfU0x7XgL0ZEWYb CTySO0cydKIFENLKQ5tsAqS54VbMCf/YCZI4eQmETkVke2JeViH3l2Lz3lYtnlWPuaUT fz/MggeF1oljhRnyT+sF2YUe5kG3yBkwGqr6QV8s8DyigX/VESZvI/jUSw0vL9O7cGwX mrZw== 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=/fkGNK+QWkyH2mt9ZNA3ms785gxxvkLfa+DGEin9lUA=; b=gH0/J+smKhmiiKMhMBOxu/bLNzXWIFB9/OV1avyfVpm7z1V/IZiVJmYbNFFKruXNO2 EZ+TtbReqn637va1QxwYJ8cn4vmb1fshia93ZYkgxlL9q3EAbpRNjSCn7sVivdqrui0w iL+gtIw5UtYBV8dM0RvwSj/WEsOOXTpKXW6BAqCJiACW5tWgfBl47SH26bT0dvfjEh0d W/mPOd5c2fFxHisLcopoXpcN6ftJvM7Vb6GVsMQsH3zr4xaVfna8GwuLUaoWQ/vPrvmj Pof4XySWAWfHkvvrrsKVrL6AOFplprr1naYQ92gvKigOxm/Mr5TZhvWky0/ef3jQNqkY e3OA== X-Gm-Message-State: AOUpUlFAwckLML1NcOYJJOOJsX0d9q38oH//iQTVruL9XOkW03eYOFzl VzFzFXYqlw6P+DRZI/D7qS8= X-Received: by 2002:a63:a745:: with SMTP id w5-v6mr4337096pgo.374.1532658567307; Thu, 26 Jul 2018 19:29:27 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id c1-v6sm3687725pfi.142.2018.07.26.19.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:29:26 -0700 (PDT) From: Jia-Ju Bai To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] input: tablet: aiptek: Replace GFP_ATOMIC with GFP_KERNEL in aiptek_probe() Date: Fri, 27 Jul 2018 10:29:20 +0800 Message-Id: <20180727022920.1233-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org aiptek_probe() is never called in atomic context. It calls usb_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC 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/input/tablet/aiptek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 545fa6e89035..c82cd5079d0e 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c @@ -1712,7 +1712,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) } aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH, - GFP_ATOMIC, &aiptek->data_dma); + GFP_KERNEL, &aiptek->data_dma); if (!aiptek->data) { dev_warn(&intf->dev, "cannot allocate usb buffer\n"); goto fail1; -- 2.17.0