Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1129740imm; Fri, 27 Jul 2018 11:36:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcaUNdNqJ7n0rzFWkNBjuf65hq/lYreBSLm/waO9P6urHe5jCYvlvIAYTuc67D+kJi05Fgv X-Received: by 2002:a62:a649:: with SMTP id t70-v6mr7778325pfe.149.1532716603613; Fri, 27 Jul 2018 11:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532716603; cv=none; d=google.com; s=arc-20160816; b=V6oICC2tp2YQKWRZuXD1NpkYcGihRqxN2tsoo+wYB89l0tpO0GJpNwe79uTPmsRRcm zQKg5E4NhEZ40WHgri6dKF/4Z8uEZdA3IudmeyArUJHj+horNXsDBaJlz4lOPdY6VWjL jPFvN2kq0/RkzAsCXb9iPdaYywsxUOTVjy007wSjb5Tl4mXOQDEz6ljK6lcOrfa/9IDX abcPiJQ/BNcSiMGM/zWc6b0C9jAbpBtbBbgATq/UkReJ4AZdwIEhJ9SDPXHwKYAwNf6Q DtwHUlt91KRiCuw4xCKF+FaeDxb3TdCITy+WOKANmA6/Wqz8RIDy+5G4R9Q+YGEBZkLM gZ4A== 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=UB004HQSO3gYnGWIKDYrA5JVPKrH5SPmEO71VpgLfLk=; b=jBxsrhD85UazeFyPtw+2yuV+l3cAqtG5cykR4ixh5H9Ipbv/dk4FuEWQCHG6weDqjq 01apVioKdXtNZrMbTUlC2Y8PLbyp6xlBKC9vWHAcmlZyLmsDUi6RrtuH64e5G5pZvBqA XZg1lAA1sUeux8WqcoLsX4ZOB2Dut3TcdzCSiYQSCOCp6vghYIdAnLfiLHIR3HXDwomD HjD7jEY//SoZHEy3pEjuv9OpjV3ssS3g28vnV9jpw8wbW38qoH3NY4Bzmq2f7ov7IJRa EnvmJlnn6zkaPtLkxnljQp9wxoUsFPoP+judrB3CAv4KfPpfZkjnabN8Dh+4xmAqVIz7 /uBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Weq9mcyF; 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 q90-v6si4544041pfa.272.2018.07.27.11.36.28; Fri, 27 Jul 2018 11:36:43 -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=Weq9mcyF; 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 S2389006AbeG0T6r (ORCPT + 99 others); Fri, 27 Jul 2018 15:58:47 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:34847 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730511AbeG0T6r (ORCPT ); Fri, 27 Jul 2018 15:58:47 -0400 Received: by mail-pl0-f65.google.com with SMTP id w3-v6so2667073plq.2; Fri, 27 Jul 2018 11:35:40 -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=UB004HQSO3gYnGWIKDYrA5JVPKrH5SPmEO71VpgLfLk=; b=Weq9mcyFpSCbbREZ4HZqOMdqxLTSvKBwm180rVXV9fN67zjqohBeS0y5wBlvRi+SmD ueau8Foc6lITx0BOgWJgQsOM8nYYDAiqVIu1wt4yZMtD61cMoB9H8oqG6hft96VVDsxr /xxuzjdBwyZputPbDpxDbDrp0R65y5cTW+iR0fKIGXhOQYy4bksftLeUuuRmXizGfi09 rv08+OqYwofeL8wgqKQUWxe2RNEFVx+Cw9c1OFXPMjQPtg9XUBBj9ZQ+92cIWz8bVMtk YqQp7/i/vFv9SEGi9dyyABgWEvLi5f3V7TW2t3Y4ekomnRl3v7AL0wz/WG9iZbQnfvO8 TSfA== 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=UB004HQSO3gYnGWIKDYrA5JVPKrH5SPmEO71VpgLfLk=; b=G3rbWRjIlj9m5y/CW9Yz0As6dqK6B2BwO84LYUNsT2mCCCsHyuxhuHmsvQL5orP7hm 1WDUqX+ch5saOLOgJqsslDyViX+hTkZkzTa8vz4G+33y0VRwDB6v/7Asp6deUe4g1+R0 gq5WM2anBeDqyibe3nVH86JIVPmgsKPjXtyLr/kSVZTPpv5oPZ9p6bOcUiLDpC9JVdh6 C3oI1JTLCbxLj3DNYpM5Cv8weBF8sA+FrrUMDkZFryo2mzzuUAVnEu/bFiW8kh28J4MF Dqvlcz5DOeUaTqS17Rl6RvGypRn7Nq3UKnSXmDNi87FjkM/Oo0QrfAzz2Lh/GvvKqd+F 8rMA== X-Gm-Message-State: AOUpUlGLNatomNBkQZ1gxig14wWBqIZmNMHtOqFX8h7xK6KM08URGxs2 FOkwfTWBL4JrWUzAtBQCrps= X-Received: by 2002:a17:902:bd44:: with SMTP id b4-v6mr7155530plx.144.1532716540094; Fri, 27 Jul 2018 11:35:40 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id b73-v6sm7287869pfl.152.2018.07.27.11.35.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Jul 2018 11:35:38 -0700 (PDT) Date: Fri, 27 Jul 2018 11:35:37 -0700 From: Dmitry Torokhov To: Jia-Ju Bai Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] input: tablet: aiptek: Replace GFP_ATOMIC with GFP_KERNEL in aiptek_probe() Message-ID: <20180727183537.GD72640@dtor-ws> References: <20180727022920.1233-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180727022920.1233-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:29:20AM +0800, Jia-Ju Bai wrote: > 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 Applied, thank you. > --- > 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 > -- Dmitry