Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp291563imm; Thu, 26 Jul 2018 19:19:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdE4rQBoHUWUV7r++kP/wvs1umUNf4XSY8UKTKL+iY6KUFoFzv9IuczXB3MVStsY0gErYWy X-Received: by 2002:a62:8d7:: with SMTP id 84-v6mr4595699pfi.172.1532657996837; Thu, 26 Jul 2018 19:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532657996; cv=none; d=google.com; s=arc-20160816; b=bL2ArDDbnDVxLwvVp6aW40Em8f8cZ0ZUa8JMRK28M26PnFaCWl8duXIOMYA9NnnTL/ exBOOLx6ufcskWEiwp71bgdM7k2gQpnupfN9hZaAUy6m6LNtUp96O0r8qYaSGqS4hefl 7h3RwLx1YGrWn+PNi1yO9Zckt5UonF87qSIglpcvOYNXCCGaGlJhHpigfsJW7rYKAqDO TusDhlpnJMTwZsRa+JyFpk+SP8MuFFOX3Yk8q4TAEUkQNlzX8419I8aMZy9ndyA1qLUY +BYgKR9yDh4o1GcwZqTpRnzGMRbSs4YOYb0TQZLbteesXILc2jm7jRJ7xLePWTAAEkg/ yFyg== 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=G8y7N9RH4AZkGuy8f62RMTy9APWhxwa4QK5qc88GqXI=; b=fmoS69iWTIZFEgNdexL4u5hb6hpWvnpxB/BJ5WnvdCFrDkMsMavGXbMn8JJiwg3Ixc jBenKiGxtUup6HZFtFFKipaT/VlLqwQH7eieeuJmhVo+7BBBM741DoV6EdfNEZzsgNJW 7TCASakTpQBTtb9ncB07/1t5U3yQDIu6SlnqZD099G6Ts/tJaI0BCUK2mPjjrUrGUzID 9PrIYAsiWTc6QA+EoGM3QJPOqtAQwLSK1qM7rVOqZ1joLDhV/bQ4hHLHXmACXN5pVLRX OUlEU4Ju3CGUH0FSzvGbV28Kd+sspvrs2aitfu7Uenu29H0M0nIf2CZN7Bc7LW9JNij7 CWOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L5V5RNf5; 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 q66-v6si2821407pfk.268.2018.07.26.19.19.41; Thu, 26 Jul 2018 19:19:56 -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=L5V5RNf5; 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 S1732157AbeG0DhG (ORCPT + 99 others); Thu, 26 Jul 2018 23:37:06 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42328 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732045AbeG0DhF (ORCPT ); Thu, 26 Jul 2018 23:37:05 -0400 Received: by mail-pg1-f193.google.com with SMTP id y4-v6so2285985pgp.9; Thu, 26 Jul 2018 19:17:32 -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=G8y7N9RH4AZkGuy8f62RMTy9APWhxwa4QK5qc88GqXI=; b=L5V5RNf5sSBsbQCk1PgyDjBJUfjGqGSIuvrwIOoI/1t+jw66a5B78CufrTekxOL9tW S0Uprpd6FZZdrU+p4mUPyvwbbZ98t8dRSQLfJ+Br0Dt8oxEMbETW/A4jx4QL/nR9YpNm 1ofb45mEwqPxVzhmX+Vhj3C9aSjVhGOGB3zAVdtA6LX7xtuyphciiNQu2H8Z5p9n1A0S 9qoLTLK53iYtnd4FzfGby7dL4mNGLB9KFhBPK/PY77glgo7yVc7bixZN21jX1SbfBWPH I8bq6ad9TkI7kgwJ39L5kWa+2qhlgNhpvfbPtc+nuF5jAh5yNMFit3xGTCURVnQp5/Lb +66w== 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=G8y7N9RH4AZkGuy8f62RMTy9APWhxwa4QK5qc88GqXI=; b=G5LlAUg6qoA3RU6MUiAPZSluq8VNPSJOb/EaOsoApufMSgar1NQuY0LkodUF8u9fhH c2s7lROSofgSH4G/nvvQ1g8eexwEBRu+7A1rj991TH9/0qo1V53eYGTTtq7QmHbr4b+A sdZWJTpzhILtSAGCa+qu145eP0Un2ItE80PDpp3zAEIb+cwqgr7Lh3zuI0Ppk7vRKeCR iKxh6OIMfVJpnEluCK+6nGazA8/3RhgCNSrDN/fbDZO63zioNhsV+NSjZjPTFn37JM2Q xpJCA7GC7lGmifCb1RKJVRvFhZqsSqZQXsL41HAiGHHEpnLr5bkJTYzegpevsH8v4MZc UMwA== X-Gm-Message-State: AOUpUlFBNOzGcdsQI+KuhtVLF47KGXuZGSNVvkuz6iErdHUYZ05tpUXo 76zJBeUhjBTJvbrVhv9kPWw= X-Received: by 2002:a63:8b44:: with SMTP id j65-v6mr4224804pge.248.1532657852447; Thu, 26 Jul 2018 19:17:32 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id y3-v6sm3364502pge.29.2018.07.26.19.17.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:17:32 -0700 (PDT) From: Jia-Ju Bai To: dmitry.torokhov@gmail.com, arvind.yadav.cs@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] input: misc: powermate: Replace GFP_ATOMIC with GFP_KERNEL in powermate_alloc_buffers() Date: Fri, 27 Jul 2018 10:17:23 +0800 Message-Id: <20180727021723.709-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 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 --- 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