From patchwork Tue Dec 10 20:33:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 181164 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp6395832ile; Tue, 10 Dec 2019 12:33:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxCoy+igzUmpeYIQD0vFdivY5Uxwgr9tTOxqQkQOG5IwF3od5ayvdZDVlY58sWvWTWMNeoR X-Received: by 2002:a05:6830:1415:: with SMTP id v21mr14080073otp.188.1576010036075; Tue, 10 Dec 2019 12:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576010036; cv=none; d=google.com; s=arc-20160816; b=dhNqRewzpbXksR9CZDlAy3r1Kzm6LzBNikU9/i/plCK9LxQKnTBgHnAjMVMGqXgYhJ AsNhveP6ouRMxgnefpBCwHWfgBWV0n17v2JEMpMVsxb1Nk0u5i4uFnTS3ipvBBC5sg65 tyYZgqr/O33bKkv3M1o24vsK5RvXoo8wFqXjVieY9/cP35WfdjG0SJVGo32sQ3d0qvG7 oX3xMd9q0/KlsVtmI+M5doICjrX+Ud+kSj+YuTs06cQfALkFrp/JHWudStOmEKotd0NN C65lgUkglf0RnMe6mtlwtJQZmE07WPL5T4Reqd0/4nTmqIfQXP1DbO35PYV6n3gKZ6rd EjbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=jmxsVJirRqK+c2OAu9EwXw+a55aK7/P1gmGLqNmpJ50=; b=mgc1ww2wFht2CiSRmGHtE1DX46oJkb6CU2s6I3Q0vaZGm2RbV9Ph9BgFVPzfGvPRXK cc2VSSJTdLeLwDn3ETN3zU3IDzNKR/ojF/CsyCHsfzKAhALOY9Fq9H3vH9b7fgjInXVA tszBYAAWcRAvLUyKLJm1Ngzdg/BYEIjlmAUT3DFEyFvAqVbQ5UEDyJtg5kwXKIXUIEWC 2Zp8UqWHQKu5CYLtzXXwxs9ll+hLotSI/IwbpHg/NBYfS3RoP9evG0TtBtoKniIb4IJo PTGI7/X/jbUZQVpBAdQu6+4MwFgHb75zXuO11zHDjaYuWfYDooR60ksOkkQeY8+4WZut M2mg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si2671577oil.77.2019.12.10.12.33.55; Tue, 10 Dec 2019 12:33:56 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbfLJUdy (ORCPT + 27 others); Tue, 10 Dec 2019 15:33:54 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:52423 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbfLJUdy (ORCPT ); Tue, 10 Dec 2019 15:33:54 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MTiDV-1iI4HB3JXx-00U2pg; Tue, 10 Dec 2019 21:33:40 +0100 From: Arnd Bergmann To: Mathieu Poirier , Alexander Shishkin Cc: Arnd Bergmann , Andrew Murray , Suzuki K Poulose , Greg Kroah-Hartman , Mike Leach , Sai Prakash Ranjan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] coresight: etm4x: fix unused function warning Date: Tue, 10 Dec 2019 21:33:19 +0100 Message-Id: <20191210203339.2830960-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:PZv6Q0/vdlVSHBHJn7T1gpGLlPiQ8u4vxmASJnEyI/W8tB+C7Ve 47L8q68zl+iwEznlpWRUChe6lxKnFsHUwqYKFHYEIbeSXPS+U0RIGw0vMzPYEzLaO7TqSw0 micRDY7OOQhNERdJ52106PBe9uWQunzsjC2rIFxPS12ZjkU/3nYpBC8aWen4FX9z1M4w13Z 3YVYvWnRVPTW02f6K7rng== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:5PIKYtZ1FQM=:89IFv7vKvpz0RD/0CpqeCv CcwCoqI74Hf/TI75aRAaX6frcGQMdlMQQFv+H1sU3tbdLh52LAaW9L8WVvdSILT5SY667EkZ/ rs9T7Q4W3kJ52a520xcjkbj5k5q1heM6KFdnk5cdhGywyNK11fDinVVg4UNN/9zeYC3HY+rMP JExZUgsk/GPyjEXOdgTD8RvH2vhEdFqrAdLt7IlJsD0YYeX6ErlWIlPuBl58N9vZM3NJezznO 1GE5RW7AFRScIp9pDOr9n+PMJfvAMZbQMM5O6HdPxem05lmVgLSUUZrOqza0XXkkxQ3hSYCIK Bt7vQWLwGd62u/71ZHM2gGcqCn5rkZb16m0jwPnW4VAzteFoZzaopTL447obA2u9JNmmwvslF j0TVFDS6ESa6YbaI2uq/+K6KRteoXwOGwYgudAz1diRzJsD2YZX6jS3qIQW6SdWiXd3JaQnDG KliVjSAWHp+N+9DhCAJHDExMgq4EuJKoowG6l4nnmIdi6pMZNUL/juWD0ATdyBeYTHdlJa2TV JrA9xj/jh67RhmrkQF7qCl3gFVd+d6UoBBsW0YUkQr6hgF2YTpZkCLY/l79PbnLJ3ONScq+Km IjtT6V8NbE9zJUM184uQbDybo29+z3uhgzzwvKQB4siR5Za5e47jg9MEt+IXf12FD1LO8xleO iWVanHRw/O8zcZflJbjHMSFGMZ3ApihHX8X+D8IHSlTh23XIO+rKrhYRn0W8BXEPQ5hvCo5F9 +UOnbMA49lZzR9+fNdooTbOM9gC4Rx/fgcmG6nSj/bCpXKWKiypegOyJ4zFV2aaMDWjUgvORM 4RQcNeyHcNjN2m8FJxOdu2U6DbSado1gqiJsL2w28u1Rf/W+jUtCcfLoKBqnMJml6vpbCr7RM 1wa7mhMTFhNyS+VcZWAw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of the newly added code in the etm4x driver is inside of an #ifdef, and some other code is outside of it, leading to a harmless warning when CONFIG_CPU_PM is disabled: drivers/hwtracing/coresight/coresight-etm4x.c:68:13: error: 'etm4_os_lock' defined but not used [-Werror=unused-function] static void etm4_os_lock(struct etmv4_drvdata *drvdata) ^~~~~~~~~~~~ To avoid the warning and simplify the the #ifdef checks, use IS_ENABLED() instead, so the compiler can drop the unused functions without complaining. Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Signed-off-by: Arnd Bergmann --- drivers/hwtracing/coresight/coresight-etm4x.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.20.0 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index dc3f507e7562..a90d757f7043 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1132,7 +1132,6 @@ static void etm4_init_trace_id(struct etmv4_drvdata *drvdata) drvdata->trcid = coresight_get_trace_id(drvdata->cpu); } -#ifdef CONFIG_CPU_PM static int etm4_cpu_save(struct etmv4_drvdata *drvdata) { int i, ret = 0; @@ -1402,17 +1401,17 @@ static struct notifier_block etm4_cpu_pm_nb = { static int etm4_cpu_pm_register(void) { - return cpu_pm_register_notifier(&etm4_cpu_pm_nb); + if (IS_ENABLED(CONFIG_CPU_PM)) + return cpu_pm_register_notifier(&etm4_cpu_pm_nb); + + return 0; } static void etm4_cpu_pm_unregister(void) { - cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); + if (IS_ENABLED(CONFIG_CPU_PM)) + cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); } -#else -static int etm4_cpu_pm_register(void) { return 0; } -static void etm4_cpu_pm_unregister(void) { } -#endif static int etm4_probe(struct amba_device *adev, const struct amba_id *id) {