Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1130831imm; Fri, 27 Jul 2018 11:38:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdY4cannmDVViQreeC+6wEp+8AHqNA554srQ2cXBJR+K4KOB76sTmRmSSAnhr6TIQ2jLva5 X-Received: by 2002:a62:4308:: with SMTP id q8-v6mr7902029pfa.86.1532716682032; Fri, 27 Jul 2018 11:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532716682; cv=none; d=google.com; s=arc-20160816; b=JFPThtN1PmoFPphKg6KwS+aYsB3clsnIO9sIEkBtVBYB9M5hgTPFAfgx4Y20BY+iZb PceZbTMUGIzyBN4hrMwtzQRZxJ6PubpB0Zxj23fuh8RswPo/K1zk54HqrwCTnFP/8YjF 93i4DRO6UF8rtMpBq6eU/w/6laaEbQ9KirsAsZbTuyONqIe+OIP7vcMLpEH5q7jiee6f aB9+fZ3KUfRdn0A80G/llIabOkCFT2k5nouu+jMZ9FBjPGcZ82nOjdcLNOildof+WPjK Fc+ZAsvp2aM7Zfq+uGOCMRfVQ+FWDrPRU6JZixO6n5izGDq7sh3CLvYBLlUsn8vwsF33 oV1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=rnKY7L6Y5APaSKcFOuqVVIEIz5Bgr3TAg5jAzdkGJrY=; b=WgEL5xn3n4qRiJwoKAUKnzIdvn3mfk6xAWXCjyHycGdVVLi3qaoVOVqvy/uqGI+Uy7 zevLl01FJqpOS2ktByBNt/wAKRle2d8mTyfOkOI3akVd+Dfed6SadBmeHDer+8lVMvXi Mmfz4OTkDccX3oy4UKkSvCnxa6PtydAtMCW96asC29eocYCT+SeAGn9Q5WFRflLbgJ10 TNAs1kmgUVd2sgauSfjjTrVc30AFts4XI6E2XQUHZkcOUtOLZZZYpfqYJSRowZQFFGEG KcJZXsf93LBizbjar81cHaqNLlJOogTzgSBAk4cDMD5ogGAGjXBq9NX4qRlaWzv/osPb 2A6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QffwvGbn; 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 p1-v6si4698319pfp.237.2018.07.27.11.37.47; Fri, 27 Jul 2018 11:38:02 -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=QffwvGbn; 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 S2389109AbeG0T7O (ORCPT + 99 others); Fri, 27 Jul 2018 15:59:14 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:39514 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730511AbeG0T7N (ORCPT ); Fri, 27 Jul 2018 15:59:13 -0400 Received: by mail-pl0-f68.google.com with SMTP id m1-v6so2663599plt.6; Fri, 27 Jul 2018 11:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rnKY7L6Y5APaSKcFOuqVVIEIz5Bgr3TAg5jAzdkGJrY=; b=QffwvGbnTQvLX15oAh1fpkUwEyUuMQKBQyOqJ/lgOyaqkyldRyWK2LxwOx+fQMSFJh HLzM25Oh1rvyRxmUJKCUgGq+85qojrBsGstppPSMeibB2eM5PmKnOa8xHAu2PLzQ/OKf uwmbZhLfwUqkQI8SOC8fEztNso4RH2wd2+nVKtmKusd1F1g2rlUs61vvOLsFB7iTgzpv 1WVdpIa522sd/XdedtXw0mvZL9btXeIbum0y1Eu72wP/FQcDqtzABjyxgza/zGK0aIBH I/3VSqMU5byq3DjCOdecAC52u6AGLWaAQfTlORPVO4C049VQWbkn2gPwbUL8OAXn7QOC QB/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rnKY7L6Y5APaSKcFOuqVVIEIz5Bgr3TAg5jAzdkGJrY=; b=swUNKEBDLD2oxM3Ym8mmjhHO5/57Lk/kn9STfMI/j7aIiEmX6Fmg3jZAH/KsaXUhnZ E9CUVrUVVZnJXA2ej0qRtQKxDMbpyFf5I0e8PAKcWGqXb/d5OWV7uv/rAXg41RznBaEq Z+7pIqR1K80Gtyx6SQEPodyHya76iozvNhtnRDp4IwFEsbLxnucy6z4bRfwk9cQwLYLH U3x3pgHvu8dXlKOpjNHblsLYE7xQfxtAFjcAfOFDN3pusYPa6uSHQTA5EWyBDnmvj4VR KPhuBm0EyyoloE9qRlSbpRizfvj/U/50hi0beqtSY8qyQzeT9OoFiBiIeQ0EiCDu1DDl BMgg== X-Gm-Message-State: AOUpUlEuKQIt7Bxzwc1KJGjenCgt8xl8iOeuwtqoTGtedjM8fUtDwZS5 /nMYSlNdahpIj9MsYdG/Fyk9L1Vj X-Received: by 2002:a17:902:b785:: with SMTP id e5-v6mr7025253pls.339.1532716566442; Fri, 27 Jul 2018 11:36:06 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id e16-v6sm6217847pfn.46.2018.07.27.11.36.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Jul 2018 11:36:05 -0700 (PDT) Date: Fri, 27 Jul 2018 11:36:03 -0700 From: Dmitry Torokhov To: Jia-Ju Bai Cc: gustavo@embeddedor.com, arvind.yadav.cs@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] input: mouse: appletouch: Replace GFP_ATOMIC with GFP_KERNEL Message-ID: <20180727183603.GF72640@dtor-ws> References: <20180727022618.1007-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180727022618.1007-1-baijiaju1990@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 27, 2018 at 10:26:18AM +0800, Jia-Ju Bai wrote: > 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 Applied, thank you. > --- > 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 > -- Dmitry