Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1128151imm; Fri, 27 Jul 2018 11:35:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQc0gYgAJM2Q+f+kghdkHGXKNZuPnn69rw/yN8ih8pIxQmVwRXVRS2VLVcwtL6niroSl2V X-Received: by 2002:a17:902:7c8e:: with SMTP id y14-v6mr7203145pll.265.1532716502832; Fri, 27 Jul 2018 11:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532716502; cv=none; d=google.com; s=arc-20160816; b=RUYnYsu4m4wJtZ0Nr8oTrEC+YtPfBSI1PxfLGFkOiXOpzAnJhqobAwQOTpnY9jHD9C F1yxZ6JdBx81F+Oh0baYGhvZR/0J2Vlr0AaFamGqC36xG3Sro7x1k0UadW+xlWLHYS/t G3ZaOmNqAkD0gYbSWCdrHgqdD24ItAAs8i0O+YGoxiraIkyHHKRPvhfpg5tFTOX8rbjP HCXVlGGSPpmfQGnzx1H3CofC+qD/MGbM1GhLPKtEgtPUgEXNMPRLDB3Z41nDxIbifm9i FY6ozwrJ69vXRBuOZo7XMzuTC77EkVrHUh0kP9++3WiMBIUnJSiJVyTVz/OyRjuP/o9S +wQA== 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=RhZSiEFN6VyaUkgQiJeGt7q8ya3y2Bqra4/HxQzdM2Q=; b=Qx9sR+CsU/m3j4p37SRnduEC5Of99vONUTfP2d66akumcd/WdO5l+gx3rXZrnBl8ad mzpjvSJ2evN6IvQiYmLnowas67SgguQToGGba7BFCBKJm2HTrLYoiMvzsnuYTanYNi1n YJa9E/+wr8F7ZwLRbJDV43KiIIn624lEKLjUwL9bg34GYdm89tpjRXHKrwyvQUOq/K5A ptMwHNVJgisrh4RNOg82tNOE2b2T5Ze8dYABKKYjJMNKtWhMOgcurVK3gvwmonCkQakn 1safZazzY5sHxZc2OZaPieOVTaaXwmjw65xmbJanlpJDcgbIzIxTnxFzrPpnQH/cDTdr f55A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hCPRRdiK; 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 193-v6si4415455pgh.407.2018.07.27.11.34.48; Fri, 27 Jul 2018 11:35: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=hCPRRdiK; 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 S2389051AbeG0T4q (ORCPT + 99 others); Fri, 27 Jul 2018 15:56:46 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43031 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730636AbeG0T4q (ORCPT ); Fri, 27 Jul 2018 15:56:46 -0400 Received: by mail-pg1-f196.google.com with SMTP id v13-v6so3694161pgr.10; Fri, 27 Jul 2018 11:33: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=RhZSiEFN6VyaUkgQiJeGt7q8ya3y2Bqra4/HxQzdM2Q=; b=hCPRRdiKLhDWtAIG6R3uDdhFV7LT+aS7Efai/KtwNIgOKsWYBc/+zzcs+y+PmAhfDC /wEEzBGKQ4IhCxFkAo5BL9d+qPBT0MnGp1GYwWRz+Rpuym3hZQkK8IsOm4U+V/IyqtXV YzB3FrmlvtPCajPbEDt9+b00OqDidoRvQV/sviseffX5FXiit99KD3VVzwBRnoeDRe3n PYMBhZ3l+udgPrDdE09rDewWoCU1+tIiv+X46B5H1ad5QahK7XMIRM5N0Kt4i7d+u0sB F0Fh4RzVsjz3E3RxrsJLK723il29rEoGdnSdHWV7GAxmvawBAsuZbGMrFZOYE5wurzBQ Zf6w== 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=RhZSiEFN6VyaUkgQiJeGt7q8ya3y2Bqra4/HxQzdM2Q=; b=S5m1tT+VT4ljfCo0SHeGhQUf/UQYjBoayqcC3oUZIm0wHOLX55QONWzDBpHO97/+Ke bII1a/0Ki/CI08Ff6HhJ3osYcd7Iw4wlTOHrpumDe9X9zDPPyB9tGug+mBH+DcWv5h6Q xjB/h/LYa71U7sLonkSDGQ5SyOGTgyM9cHZyVBf3fMbcKqNh0D6RKQDTJuKoWTZosj19 9h5UEKE1iUU41yFTlXTbeUF1fn0y+wO9UhL078WEt7RXyszzPfwof7sqRP5PIMREQua8 m1kutHLvSuGePaIiqIRbSx4hd02fyYn5LZSrxu/jpLELwscCiypLH14f3/6irEa3Vx8Z 244A== X-Gm-Message-State: AOUpUlHB0e1uemyWO0JoKI4qevfqA3VwLWFaqsulKocddep8RSuQiJQK m0rObuMN76SbuFdaGjQ0qQ4= X-Received: by 2002:a63:4506:: with SMTP id s6-v6mr7324605pga.422.1532716419974; Fri, 27 Jul 2018 11:33:39 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id 137-v6sm3033668pfu.121.2018.07.27.11.33.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Jul 2018 11:33:38 -0700 (PDT) Date: Fri, 27 Jul 2018 11:33:37 -0700 From: Dmitry Torokhov To: Jia-Ju Bai Cc: arvind.yadav.cs@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] input: misc: powermate: Replace GFP_ATOMIC with GFP_KERNEL in powermate_alloc_buffers() Message-ID: <20180727183337.GC72640@dtor-ws> References: <20180727021723.709-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180727021723.709-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:17:23AM +0800, Jia-Ju Bai wrote: > powermate_alloc_buffers() 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/misc/powermate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c > index 5c8c79623c87..e8de3aaf9f63 100644 > --- a/drivers/input/misc/powermate.c > +++ b/drivers/input/misc/powermate.c > @@ -277,7 +277,7 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig > static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) > { > pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX, > - GFP_ATOMIC, &pm->data_dma); > + GFP_KERNEL, &pm->data_dma); > if (!pm->data) > return -1; > > -- > 2.17.0 > -- Dmitry