Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp109897iob; Tue, 17 May 2022 20:31:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoTMsTEUa8OCCmlFmffEbmHfdF8GMg/tnZx+lbe9PHuKY5WDhzin1ty7CO5qnKxvNGh25T X-Received: by 2002:a17:902:8644:b0:15a:3b4a:538a with SMTP id y4-20020a170902864400b0015a3b4a538amr25497988plt.146.1652844675841; Tue, 17 May 2022 20:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652844675; cv=none; d=google.com; s=arc-20160816; b=Q2ZDLUMiMBA0vqZYzxcJRTXvNxLfNt5Di+R5KJGM+II3jGTl5b1L2MeL2ScFhM0SWG xlnaXlsL7oR/GV19MbERAMoXQUUHSZzGLgFBejKu8+o19R3eyqTT8/rfNNsNnDLHoxnT K2ImgnmYlnsrNHsqSzw3xtpnNdem06CEATlWOYEzlGMPbEbqbFw9zoszJEvt1eIq/2yg fFuqIvONaqiYtg4kMFzi2aYfg0+JuzhF2DTg+93oxlkm1Hm3V6RlhAcUTXepOG8/ekLk 7uKfaN3ibBhI+f44ciZm3D7ueWJRFiGzW5/PSP8fSKktfLtOfgFZ76Mkg80vJ/YKAwl0 0JbA== 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 :message-id:date:subject:cc:to:from; bh=j8sEoiGty+25BObvfXausZeD9ko192HJl9MctQ6znyE=; b=BR56b4NzeV8Akta3O4Djp4awPEsy0pQOJMaoJq0tHhcIPjP/N4JxMDYbmbX7rM5V5g xjqVe8fAyrn9EsH0dXp/bJwfpeUOdb9FtUAhOD1O8Z0d0p9002N8Li6SqYmlVJj5BxLW JgaalufwUsVUZk9+/qS0JYcInpYprDnvuXcw8bEoT5yrPVi/yxX56EWk1pkX23e1PLuQ kGdahWlW2Xx2vv+w0sev36znYZUL0LFnY63Ogu9EQgQrmA+LMs56RpPDY4LYbyzmXDJp tEJRdBZVz+8JR7d/Nn+ncKdyv2KvgdXU7S1A6x8krzfOZ+g1oIV4ALsJ6O8DfEx0nLfQ /gKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t36-20020a632264000000b003aa2211ac3dsi1021330pgm.730.2022.05.17.20.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F3CA0E001; Tue, 17 May 2022 20:25:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344137AbiEQOwO (ORCPT + 99 others); Tue, 17 May 2022 10:52:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349358AbiEQOwM (ORCPT ); Tue, 17 May 2022 10:52:12 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 229DA1C135 for ; Tue, 17 May 2022 07:52:07 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:c0f6:7ccf:c217:5f21]) by baptiste.telenet-ops.be with bizsmtp id Xqs52700B0nFbBY01qs5MU; Tue, 17 May 2022 16:52:06 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nqyYP-000ht2-6h; Tue, 17 May 2022 16:52:05 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1nqyYO-004IfE-Qv; Tue, 17 May 2022 16:52:04 +0200 From: Geert Uytterhoeven To: Catalin Marinas , Will Deacon , Mark Brown , Sebastian Andrzej Siewior Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] arm64/sve: Move sve_free() into SVE code section Date: Tue, 17 May 2022 16:52:03 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_ARM64_SVE is not set: arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function] Fix this by moving sve_free() and __sve_free() into the existing section protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that section has been removed. Fixes: a1259dd807192917 ("arm64/sve: Delay freeing memory in fpsimd_flush_thread()") Signed-off-by: Geert Uytterhoeven --- arch/arm64/kernel/fpsimd.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index d994bf0a6ca93984..819979398127e6f3 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -281,23 +281,6 @@ static bool have_cpu_fpsimd_context(void) return !preemptible() && __this_cpu_read(fpsimd_context_busy); } -/* - * Call __sve_free() directly only if you know task can't be scheduled - * or preempted. - */ -static void __sve_free(struct task_struct *task) -{ - kfree(task->thread.sve_state); - task->thread.sve_state = NULL; -} - -static void sve_free(struct task_struct *task) -{ - WARN_ON(test_tsk_thread_flag(task, TIF_SVE)); - - __sve_free(task); -} - unsigned int task_get_vl(const struct task_struct *task, enum vec_type type) { return task->thread.vl[type]; @@ -690,6 +673,22 @@ static void sve_to_fpsimd(struct task_struct *task) } #ifdef CONFIG_ARM64_SVE +/* + * Call __sve_free() directly only if you know task can't be scheduled + * or preempted. + */ +static void __sve_free(struct task_struct *task) +{ + kfree(task->thread.sve_state); + task->thread.sve_state = NULL; +} + +static void sve_free(struct task_struct *task) +{ + WARN_ON(test_tsk_thread_flag(task, TIF_SVE)); + + __sve_free(task); +} /* * Return how many bytes of memory are required to store the full SVE -- 2.25.1