From patchwork Fri Jul 27 02:26:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10546571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2B5A1822 for ; Fri, 27 Jul 2018 02:26:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1AF62B9FD for ; Fri, 27 Jul 2018 02:26:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C37B02BA11; Fri, 27 Jul 2018 02:26:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C9A02B9FD for ; Fri, 27 Jul 2018 02:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732043AbeG0DqB (ORCPT ); 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-Google-Smtp-Source: AAOMgpeSoU2ZBATsEJEDoj09W31mlSu5SQ9oy/SDfnE79bhVZBHSOe3H7L0vyX1nXBGPZI1lA3Or0Q== 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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;