Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp346911imm; Thu, 26 Jul 2018 20:48:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdEOf+4h+RHTmBVDAMvOJlOTn1bm16X9rjI4fnT3od8Mng0gYoY/jihDPxHBRaspASO0w+n X-Received: by 2002:a17:902:820a:: with SMTP id x10-v6mr4406211pln.261.1532663331376; Thu, 26 Jul 2018 20:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532663331; cv=none; d=google.com; s=arc-20160816; b=ZULKZbaBjMIXZd0GnwGyeS/lVb0eew6EDuL4aySPKDLseTnYfljJzHmkXWMq+/LkBN r6eZ5NeGJ6wEVvVzurM0ZTP52NYqXAgEOD6FTYuxDZL12qZ2bMJYjRuphZYtPGmQQSNB +z2FXWm+AQyyucKyhBkDROUUCo2/Jivs5JnAXJqskg93XqLRUClG7JTAZfF8MPMOAsY1 KzZIFky0gUBDyjelDg7VD3DiOLz6ZYJhol9S3jxKn0g68xmwW2dx4tfVD9DkV2lu7vuM P6RpY7tvivTc8JiGv4sKyFIh9n6dNRyWggOCQIENvW/2CFoz6yLGCzCN60OWFyveMtyx ffZQ== 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=FAz28giP30tTtKMNzD3J2A75r00iuvGNmBVlkqtctcQ=; b=WbAo4AiuX1zuaiu6I/X+rYOBfrFe/yQeIJZKR/uu+bNiA6e0yP5ABvJKtnZCAbEKRr ynmde5ofj6vhIWTvXTBoRvfFqy5alYXvLEPGOwIJvtH4SPqgoeB87ZCuIU60x8WQ4OD3 4uMOcALzJBsE0E26Iwp7gu9z2mocaa8Imi5vHI9axUmrOB7VEYZa2irMZHSkgimJz3ZP YhPS2EWTH1owrtMrcp/1rPTU6oP5ZjCLK+GXAQJgepqzaLOQLIMr6/lQVSmCSkcx8kAb Jip9W1bmiP9rZeGJHRbpjHt+C0kPf6D6W/vX+m8+Am78PuG2+RqDZMhk0mRdPoS8/F8L 00tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XhSzN8Y7; 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 o2-v6si2596102pgk.457.2018.07.26.20.48.36; Thu, 26 Jul 2018 20:48:51 -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=XhSzN8Y7; 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 S1727105AbeG0FHi (ORCPT + 99 others); Fri, 27 Jul 2018 01:07:38 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38200 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbeG0FHi (ORCPT ); Fri, 27 Jul 2018 01:07:38 -0400 Received: by mail-pg1-f196.google.com with SMTP id k3-v6so2406487pgq.5; Thu, 26 Jul 2018 20:47:47 -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=FAz28giP30tTtKMNzD3J2A75r00iuvGNmBVlkqtctcQ=; b=XhSzN8Y7OljFAQHWpludtSWdITsO16BODhW4JXbjnWU/npFr9HYd1PtF8GZ6u8YKus MWQL2Qvvz2xirN3kYQtV1+J4czDeTu5ZIO8rABI1mJlyzwlEN8HcG+VqPE9wXGHfHzs4 voCGK7VB4iIXhGs3t0xHZTluKyM8KR91vcAT49e/uPyLsLLPtcjGa87BFcmcUNWONiv0 qSHcbuiRZgzWrHPAJKpk9vU84SZpB5FmMrZqcl/qyDgUCAojXrzeZyjiRFSBiFz/8gU5 LpRvPH7trviJnx7wBmDHHkrUTjs+B8pp7bFeJbmKc8foDdu/KOUgda1UHxEk98926Ynj bekA== 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=FAz28giP30tTtKMNzD3J2A75r00iuvGNmBVlkqtctcQ=; b=bXGLjAfYZTsxWpprmMx//BFjHFBcESrccFGQbgiKKSICzJltkKHvKivhpicjCRceQQ m05UzGQqnRKKgRrwDTIPilu0t3CuO49IBgSIzdxqVZWf82Q6+YGc7gF8mJ8JGQt18eGH mMt0/xLfy80fe978rdeZCf+2XKrRb1nVL5JOnFOHsQTGaWbGrWMI+2APwrqHdzk1V0Zh 69KURI8a/ocL75dOOb64Z3Z3qWRjqaRyXxcJpJwyEF2ZpdtI5HpD9SuhcLjhJ9tnwNbS 1FJ+AgFlVNTWNawFti/Ydfl8xgdNWB1W8bx8Fie11SuyFxuC+xoirwpRAWinOSulk9Tm 6t8Q== X-Gm-Message-State: AOUpUlGLOt9tkXWxwv7F9miz2isvuNmPt97CQpK4W05sPs7T1/zDPNbk Gstl99UDkjO9YFqi6ahyIf4= X-Received: by 2002:a62:89d8:: with SMTP id n85-v6mr4811633pfk.83.1532663267037; Thu, 26 Jul 2018 20:47:47 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id p8-v6sm4199668pfk.186.2018.07.26.20.47.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 20:47:46 -0700 (PDT) From: Jia-Ju Bai To: sathya.prakash@broadcom.com, chaitra.basappa@broadcom.com, suganath-prabu.subramani@broadcom.com Cc: MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] message: fusion: Replace GFP_ATOMIC with GFP_KERNEL Date: Fri, 27 Jul 2018 11:47:39 +0800 Message-Id: <20180727034739.4513-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 mpt_attach() and mptfc_probe() are never called in atomic context. They call kzalloc() and kcalloc() 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/message/fusion/mptbase.c | 2 +- drivers/message/fusion/mptfc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 51eb1b027963..64aee8c96641 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1779,7 +1779,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) struct proc_dir_entry *dent; #endif - ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC); + ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_KERNEL); if (ioc == NULL) { printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n"); return -ENOMEM; diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 6d461ca97150..1febf4dfa944 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -1292,7 +1292,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* SCSI needs scsi_cmnd lookup table! * (with size equal to req_depth*PtrSz!) */ - ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); + ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_KERNEL); if (!ioc->ScsiLookup) { error = -ENOMEM; goto out_mptfc_probe; -- 2.17.0