From patchwork Mon Jan 18 11:33:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 365551 Delivered-To: patch@linaro.org Received: by 2002:a17:906:fb05:0:0:0:0 with SMTP id lz5csp30227ejb; Mon, 18 Jan 2021 07:06:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0J0DqBctRyc80nBwkUcDxRRtr/KvRq4+744WD9k8WPmNvs7O0cqgLqjNfSHRi7naIX8Oe X-Received: by 2002:a17:906:f895:: with SMTP id lg21mr78813ejb.321.1610982409182; Mon, 18 Jan 2021 07:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610982409; cv=none; d=google.com; s=arc-20160816; b=HO9A27W1mcxiLH3xJBfDyWl+jU8QQUWvIs3pTFFOAO/pBT3Ee4jAlD29kuMk0wjX+H +jX2UZdmerV8iQfDxXw9FqTwDmpVSWs9SVggQHS1W4EpE/UkZFsGqd9w/+hcaGa6KgP3 XPI2J7WEHC03wOT/MB6WA8aSTxpEbshky4mgv6PIdX0BKGDIb4co7LtyVCESCJht0JqS ML1HFRGlWzyk/D8vnk6XjVsn18FUidzEZPNyq5AEZKYv1hzFUjtC1p7g3cSfj1lGkckr HTDPPlIL1YQerNHYNntGlZb+7fSqlQ/C+k40KywdXEc+ex+joZN31nECzH8Cm31lLpSI NmUQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iQFPTmNmknyo2MJhCiJ1CTvPeJPXxcoD634ccYN53GE=; b=Q3LG59kkVkP3dc6SUMupvDsMkrZvPLgB+ROt5ABtvvdCbt2LZzjyDPRzVSSHtfNbYr SnpKTtAUeI3l75RiB5Nj4gM0FVUHXZTRoN3d8hYc9yJzVyVHK4TGVJZwc7S6AZTXl79t NfZMS0QZsOJG21vez4vZHNp9hIBWKKI5Mnj/aICjWyZChHcziXet5Bq0GOZsFE4v8Utf J1kpmjY5HB+YPMPIwXJZu9dYdBJEA/hCArixzUa8ouFONTBNMcpNulVm9WyM9cArjPHi B72nyxPmUzvI1WmhBt3NztIHrbDbdvtGSruL0Rn3ePoLGr+HTGQPZdCHCBykTkAdzldd VWkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MsjAf+A1; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si5599616edm.151.2021.01.18.07.06.49; Mon, 18 Jan 2021 07:06:49 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=MsjAf+A1; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405523AbhARPGo (ORCPT + 13 others); Mon, 18 Jan 2021 10:06:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:37676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390379AbhARLmH (ORCPT ); Mon, 18 Jan 2021 06:42:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5235A2223E; Mon, 18 Jan 2021 11:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610970086; bh=gFezr+KIW0FwbmW6quW+HsgiqZDNUoNWDftos+HnCcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MsjAf+A1BdwGZloSWi+9XOSGgWIkZ/vTaCj7Oib5Or+a3aP6TkK4byb2vUPmwp+GO 8kyL0PAk8bqqtL2s64iCS0PtfDG4IN0s2zpTnhlwtnTZZAO2qVJMg3gSC6JWAqbfZ+ PGUi0e6stO/iUF+i8789LNzJ9ZjZJi2Im3Br4wdo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Roxell , Nathan Chancellor , Naresh Kamboju , Nick Desaulniers , Thomas Bogendoerfer Subject: [PATCH 5.10 030/152] mips: lib: uncached: fix non-standard usage of variable sp Date: Mon, 18 Jan 2021 12:33:25 +0100 Message-Id: <20210118113354.223625171@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118113352.764293297@linuxfoundation.org> References: <20210118113352.764293297@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Anders Roxell commit 5b058973d3205578aa6c9a71392e072a11ca44ef upstream. When building mips tinyconfig with clang the following warning show up: arch/mips/lib/uncached.c:45:6: warning: variable 'sp' is uninitialized when used here [-Wuninitialized] if (sp >= (long)CKSEG0 && sp < (long)CKSEG2) ^~ arch/mips/lib/uncached.c:40:18: note: initialize the variable 'sp' to silence this warning register long sp __asm__("$sp"); ^ = 0 1 warning generated. Rework to make an explicit inline move, instead of the non-standard use of specifying registers for local variables. This is what's written from the gcc-10 manual [1] about specifying registers for local variables: "6.47.5.2 Specifying Registers for Local Variables ................................................. [...] "The only supported use for this feature is to specify registers for input and output operands when calling Extended 'asm' (*note Extended Asm::). [...]". [1] https://docs.w3cub.com/gcc~10/local-register-variables Signed-off-by: Anders Roxell Reported-by: Nathan Chancellor Reported-by: Naresh Kamboju Reviewed-by: Nick Desaulniers Signed-off-by: Thomas Bogendoerfer Signed-off-by: Greg Kroah-Hartman --- arch/mips/lib/uncached.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/mips/lib/uncached.c +++ b/arch/mips/lib/uncached.c @@ -37,10 +37,12 @@ */ unsigned long run_uncached(void *func) { - register long sp __asm__("$sp"); register long ret __asm__("$2"); long lfunc = (long)func, ufunc; long usp; + long sp; + + __asm__("move %0, $sp" : "=r" (sp)); if (sp >= (long)CKSEG0 && sp < (long)CKSEG2) usp = CKSEG1ADDR(sp);