Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3438905pxx; Mon, 2 Nov 2020 08:55:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6NorrcWtmp07oSJdHNS4TKvfeoIP3i78dbU/j7ehCqDHsT3or/MsfdPg27gvk0zuLNrEg X-Received: by 2002:a17:906:e24a:: with SMTP id gq10mr15884863ejb.552.1604336155278; Mon, 02 Nov 2020 08:55:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604336155; cv=none; d=google.com; s=arc-20160816; b=je6/HFbkqZDsRaBsB8gwU34NbA1n0DrcOtExtwrybomPVFz2qo9KKQUQvSMrl99K/9 HkNS8dNvz6H5INOZw9b4Sz88D/Ad8kn/ypBDtMSRMDqazYuOFUoubeqbn+anhXON7p+8 9PDtKG/a/59psfFyAGBqrFtMv9NDmzpQU1dRSDk+OG++EZOUYsFQquQwSSlkdt/sgfAu EyzXSt+INb6KVYb4w4gPflpFl0VgsjDavPlP6S0ypz7of+QlDIBXC2u2kEnwPuMNeMil EMWRnOQWU8pG/TUTWoF6NXTUWUhkCrv0mKrA6JCwJnV854vXvDrDNRrFuzyTLSzQuenu zfxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6EF8lQwOXO2Z8DiQbYXGCQ2159bXf7Ji78BoyHo/jeA=; b=OZwnKebgWemZ80rM98cPKBMbmpTXyrvMtXTkQzkWBuZb+uY65xdIFXeJ2e9Q23fGeF 1fXVSM7/T2w3qTkA/YPPTUz/9PIwUyoBrDViGkjCAmW2yr0IxUp4d18kF51tEZYnFn7b rQ+R8gi5elNhcWluo4G+vCG/qqcDzyPJfdHGyRi0ifPg4pbend+jxPTLkaVoe76qp+O7 Er1FFIYQd1TLuBfX8Cr0rfsgfzEJ2uzJ15KChymVUInTRXmGmag0/pyC1cIk3gSKDAcA yKr8z+nc12YLCtJbtWDg7KGsV3el/Lk3PWLc5Y+R3tMTJpJmjwzrOiX4ubAgDB5EC0T6 9a6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=To8S2jHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u4si10801204eda.182.2020.11.02.08.55.31; Mon, 02 Nov 2020 08:55:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=To8S2jHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727513AbgKBQxJ (ORCPT + 99 others); Mon, 2 Nov 2020 11:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbgKBQxI (ORCPT ); Mon, 2 Nov 2020 11:53:08 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61531C0617A6; Mon, 2 Nov 2020 08:53:08 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id c20so11601537pfr.8; Mon, 02 Nov 2020 08:53:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6EF8lQwOXO2Z8DiQbYXGCQ2159bXf7Ji78BoyHo/jeA=; b=To8S2jHLUsT+F/DtIpwDe+1nsQoZHhatxgqGT8Sxc9KuSJcRM3S8ryS3lDtBN5YMeC eShZMSTpM3aCVSG4nLzekO+XOUtDj7y1FgYmyOoflsoop1hjOytHUrxV2RaxdVt1uR2K MsYuRH9Cm4h6i8pQu10lgzPWUt+Es7x0imUyp5peUkZWoz88nNq3tKjWLVQXyeoy5Ul/ z5pEcBNh47ZPnd7Kj8KAiwpTLOhaDKBFsZhXe+elVgnjgD1CuacyLxDuhKvU82nUQZGn tVYMZUv2X+pju79d8atKoU76RgvzTZQ64FLTcnhEqHIhg+OcbKdWCbaUTKMj13OhJ0Ia oasA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6EF8lQwOXO2Z8DiQbYXGCQ2159bXf7Ji78BoyHo/jeA=; b=d37kHKDzFpSjOQ915Qhlftyi96Q79AhiEdFGO0Pdss1OH3yeAJUjhwfnHrfQsOz7Qt vPWxNKQOt7fPi6a28yvMonDG51O9eIdVKmXq/lwmTHhdQdwb7+zJa3opTo0Jp9IxyfWj ysPrKMmDY47xt2Cjwbt7Spus3aQEXRBwNEl86BKLm0tgaZOZJ273oiatbXPuc4v7ooUH wfNOJxgq89YUdZxstLvGvIV7xamZnf7OhvcXe23KI8C7TyZiV5XZB03CZU4akR9t6hDn d09jfsDEU3PWmJRCW/EGzeJAYVeRpVnw7JxJ473YyNIfzSUxU4d85XTjaIbBwdvxGyzo 3u6g== X-Gm-Message-State: AOAM5301Ed8Xr0TZHYFimmSHh/2KmMqrWIMjfUUid6oKqV8+0fKA4c5l PrNCnhq9/jx4ni4nbUT+sck= X-Received: by 2002:a65:6819:: with SMTP id l25mr14077553pgt.111.1604335987979; Mon, 02 Nov 2020 08:53:07 -0800 (PST) Received: from varodek.localdomain ([223.179.149.110]) by smtp.gmail.com with ESMTPSA id t74sm4953233pfc.47.2020.11.02.08.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 08:53:07 -0800 (PST) From: Vaibhav Gupta To: Bjorn Helgaas , Bjorn Helgaas , Bjorn Helgaas , Vaibhav Gupta , Adam Radford , "James E.J. Bottomley" , "Martin K. Petersen" , Adaptec OEM Raid Solutions , Hannes Reinecke , Bradley Grove , John Garry , Don Brace , Xiang Chen , James Smart , Dick Kennedy , Kashyap Desai , Sumit Saxena , Shivasharan S , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , Jack Wang , Balsundar P Cc: Vaibhav Gupta , Shuah Khan , linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-scsi@vger.kernel.org, esc.storagedev@microsemi.com, megaraidlinux.pdl@broadcom.com, MPT-FusionLinux.pdl@broadcom.com Subject: [PATCH v4 14/29] scsi: hisi_sas_v3_hw: Remove extra function calls for runtime pm Date: Mon, 2 Nov 2020 22:17:15 +0530 Message-Id: <20201102164730.324035-15-vaibhavgupta40@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201102164730.324035-1-vaibhavgupta40@gmail.com> References: <20201102164730.324035-1-vaibhavgupta40@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both runtime_suspend_v3_hw() and runtime_resume_v3_hw() do nothing else but invoke suspend_v3_hw() and resume_v3_hw() respectively. This is the case of unnecessary function calls. To use those functions for runtime pm as well, simply use UNIVERSAL_DEV_PM_OPS. make -j$(nproc) W=1, with CONFIG_PM disabled, throws '-Wunused-function' warning for runtime_suspend_v3_hw() and runtime_resume_v3_hw(). After dropping those function definitions, the warning was thrown for suspend_v3_hw() and resume_v3_hw(). Hence, mark them as '__maybe_unused'. Signed-off-by: Vaibhav Gupta --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index dfeb86c865d3..9f0b4fe564cc 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3502,7 +3502,7 @@ static int _resume_v3_hw(struct device *device) return 0; } -static int suspend_v3_hw(struct device *device) +static int __maybe_unused suspend_v3_hw(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct sas_ha_struct *sha = pci_get_drvdata(pdev); @@ -3518,7 +3518,7 @@ static int suspend_v3_hw(struct device *device) return rc; } -static int resume_v3_hw(struct device *device) +static int __maybe_unused resume_v3_hw(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct sas_ha_struct *sha = pci_get_drvdata(pdev); @@ -3541,21 +3541,10 @@ static const struct pci_error_handlers hisi_sas_err_handler = { .reset_done = hisi_sas_reset_done_v3_hw, }; -static int runtime_suspend_v3_hw(struct device *dev) -{ - return suspend_v3_hw(dev); -} - -static int runtime_resume_v3_hw(struct device *dev) -{ - return resume_v3_hw(dev); -} - -static const struct dev_pm_ops hisi_sas_v3_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(suspend_v3_hw, resume_v3_hw) - SET_RUNTIME_PM_OPS(runtime_suspend_v3_hw, - runtime_resume_v3_hw, NULL) -}; +static UNIVERSAL_DEV_PM_OPS(hisi_sas_v3_pm_ops, + suspend_v3_hw, + resume_v3_hw, + NULL); static struct pci_driver sas_v3_pci_driver = { .name = DRV_NAME, -- 2.28.0