Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp296271imm; Thu, 26 Jul 2018 19:27:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeFsYCdnaTCFavABglcwoYAQVgNEw+8OWNNVJ5kSqBCfzy9VcY+k+AAkYSdk4fAJwsvWq1s X-Received: by 2002:a62:d41a:: with SMTP id a26-v6mr4642690pfh.142.1532658456973; Thu, 26 Jul 2018 19:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532658456; cv=none; d=google.com; s=arc-20160816; b=CkYttrthlB2LBahbhUQVCcDJTypoeTykWB/qS9stGPJg/wUCl72Abd1F0NT3Lxu2OH L5wjE/ZfqlG+9pEXLi5aSE7/LFxVZ6/sllcWIteWrnboA7nsJHy+bbuddu7vnAiFITWS iJZ7GHuGg6+IzNOJ2D5/Hws+Ar9UbMrgZ4la2BArFlKyRi+JFE84iyqA2Ul/iQYqV4lD u4L5/mDgMU7/5S6dGFqxjhWOlFQ6a//KDnCzlml2XifIhf0uIalaCLTwmxB+pj74pO3j Pztmoc+wPjxzOLy+FMP/e3Us2Nnr3QJ3/UZTwUWdQQNsb9+D6dl6rMmqJ05v6VMzgZ8r Mc6Q== 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=09aB4mnXUPWnw9QWfGKDkygcyLROE1Zekoe4famf4AM=; b=w22ln3/SMX9Fk4uuyEWdlZ20W7IOgNadFOXFMvs2Ouipg2EpKzMjlDZ8mAbChqLx26 j6CxEvCqKhFKImFD01Q2gaj7S46QKEQzGO4VYrP5Wn+6UTmty4X2EBLfXD+C5oRM73Pd juki1eO6feZB9gikRrQcQQaiV1kW9fK3M3JUA+IoqNm17mD9UyTXFqbI/O8EwwmWA3V/ SoP5ShkMcWDUk4KY+tFOMF67v+7P5vfZtEaw9nCqEyJchF97Xlymis6RYtrYhr45XPSP 5A9uWn97jL76Hy2N/cRPBXPEwO6V0vdiwKmhVvSYIABQ/sIa9dEqDPKFpxKeKO+dsl4N twVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UtThO+bD; 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 v21-v6si2630651plo.397.2018.07.26.19.27.18; Thu, 26 Jul 2018 19:27:36 -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=UtThO+bD; 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 S1732108AbeG0DqB (ORCPT + 99 others); Thu, 26 Jul 2018 23:46:01 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41988 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732026AbeG0DqB (ORCPT ); Thu, 26 Jul 2018 23:46:01 -0400 Received: by mail-pg1-f193.google.com with SMTP id y4-v6so2297756pgp.9; Thu, 26 Jul 2018 19:26: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=09aB4mnXUPWnw9QWfGKDkygcyLROE1Zekoe4famf4AM=; b=UtThO+bDbWi2YH87tt6mBKqPsFNYXYTxzopwd1LVTHjt1hGhuUfy4HCqEVVEoAgOMg KFl6TEu6I8twFD9IIx/R9/4hFcTFjhhyWG8MuaZmMzBsxh5E7CF46f6aA2ufoPNNQJx5 RYJ/GruIhYBjemBCmIjceTrUM3yOWf4s7Y9lIRyN0JX8f18i4x4RXbp1hRJkoEQ97B4V RkUBtwp4ZUwsT/sjPZC9ttpGQOCphkUphcvKC6tLBIEigZf/fC4ifaAt/7Vn4jB6uO4a fhfWbRSgsZisGUSmTMi2ZafD4RtSrw34Idbod6QHLB4ZciQLZ2gcZxFYtagjBQU99/Kg jZoA== 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=09aB4mnXUPWnw9QWfGKDkygcyLROE1Zekoe4famf4AM=; b=MXXYvP1lMdcntX3Tt95jI0qr0xD0pHQxYJ5vN4z+HPUARHpSbHQ9cuVf/hUuk4E610 tgdETASAh+2y/ExzxEwctcl/YBNA6Uk4f7woaCGvi+OxM7GeVSHz/FT5UbDdFuf9Demf D78x5KbsVbF458TMvbrlWCXImh7vbwY6IRez5aJzrVrHo6O+aNca3hmr13inhL3cHvc9 OceCCcRaRkOpZyWIVSAPuX2pYZBqTATX36wJcjAVQLzHlxe/KILa/HiOqsdx28TP9Spd feFjhgJuoU8Mx+O0BkS8V3OKoxnn8qk5wJnpX6I2vLSb4xSY6VaDrWZM9w94TmCgW2JF pt8g== X-Gm-Message-State: AOUpUlHRxn6sCGTGdVxbTZ2RLMAfTLn1/efqxqFD2Ck3fMNOrRsIkjBa bR7607/kM7vXjtHgxAhjVa8= X-Received: by 2002:a63:b213:: with SMTP id x19-v6mr4147714pge.393.1532658386788; Thu, 26 Jul 2018 19:26:26 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id t9-v6sm3844842pgi.87.2018.07.26.19.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:26:26 -0700 (PDT) From: Jia-Ju Bai To: dmitry.torokhov@gmail.com, gustavo@embeddedor.com, arvind.yadav.cs@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] input: mouse: appletouch: Replace GFP_ATOMIC with GFP_KERNEL Date: Fri, 27 Jul 2018 10:26:18 +0800 Message-Id: <20180727022618.1007-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 atp_open(), atp_recover() and atp_resume() are never called in atomic context. They call usb_submit_urb() 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/mouse/appletouch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 032d27983b6c..f593ec96c95f 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -810,7 +810,7 @@ static int atp_open(struct input_dev *input) { struct atp *dev = input_get_drvdata(input); - if (usb_submit_urb(dev->urb, GFP_ATOMIC)) + if (usb_submit_urb(dev->urb, GFP_KERNEL)) return -EIO; dev->open = true; @@ -976,7 +976,7 @@ static int atp_recover(struct atp *dev) if (error) return error; - if (dev->open && usb_submit_urb(dev->urb, GFP_ATOMIC)) + if (dev->open && usb_submit_urb(dev->urb, GFP_KERNEL)) return -EIO; return 0; @@ -994,7 +994,7 @@ static int atp_resume(struct usb_interface *iface) { struct atp *dev = usb_get_intfdata(iface); - if (dev->open && usb_submit_urb(dev->urb, GFP_ATOMIC)) + if (dev->open && usb_submit_urb(dev->urb, GFP_KERNEL)) return -EIO; return 0; -- 2.17.0