From patchwork Mon Jan 18 11:34:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 365563 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp93290jam; Mon, 18 Jan 2021 11:15:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJygAPocEa/8fCbhD3xIydOX7+Rt9EdzZjU01AMttL68eHc2JD6hKx1PN82vh11FR8d4VStl X-Received: by 2002:a05:6402:37b:: with SMTP id s27mr709255edw.266.1610997359447; Mon, 18 Jan 2021 11:15:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610997359; cv=none; d=google.com; s=arc-20160816; b=oOgRr4DmsH/aSlXz0f0ZizNh+N1E4YbqzvTqJQkqzfgqAfPYWpUoBFW9FVUG8f4TdX bogGqhKXWruyP8jsk6EgEOEg2Jq7K35IEQE00Ij2//UPZKarVIJ09ESREJ7w88XvkY+2 DwsNRi3t2APaW8Bvx9Az6/yxICioY94UU4CythL7GNMBCkN+dwvC12gYNUUw5M/qa2w6 N6i/d222UFdzDg266yfn+ShwBNb8f2qT+Tr3lpqoYIzN+nEQyJlTOBU1RJdI4aZ9lgaW jCI/OI1BP7NeJ6OQc2h1vZbSS2+aj6WUePw3i6tgHrztW+MV+mULSOcUPN3DEZVNpUJl OOmA== 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=SBI9OyoFOjtToAIQGKipNQJINKMpFrA4jHQNMQCZOcuoFF4e/Q2oy8XcAHRO/Xl6M7 T0Z0bv4EpAyYbiVj6tmQ4BKYvQ3cJy7wwUE3sX+D1Ox6p8W04HJHDiBxXzUJmUNx4+VR H6ayllG7/RhlJyWC4asaO2g9LP4bshVfqq3i03Mxped+HqpQBP3Uj5wqkMZ4bwZ4Nzx8 2Q5T9qX8KdsxOmCSaEpVtatAR5Lvpo95/xHg9lSsTAuB1Etbj1Fol8jF5Gb5LL3Gmc29 Soj8MORTAjqiIuqdlPGdyuLvcBykYqQE/+fIefy02f3pMZtYWqu4/42FN5R/uu70XX/P LZeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T8F0jif0; 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 z2si8327098ede.501.2021.01.18.11.15.59; Mon, 18 Jan 2021 11:15:59 -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=T8F0jif0; 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 S2390749AbhARTPE (ORCPT + 13 others); Mon, 18 Jan 2021 14:15:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:34160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390491AbhARLiq (ORCPT ); Mon, 18 Jan 2021 06:38:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A58C022227; Mon, 18 Jan 2021 11:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610969894; bh=gFezr+KIW0FwbmW6quW+HsgiqZDNUoNWDftos+HnCcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T8F0jif0Hpgoc2gAaBOH/76TrJQ4HnRHOdlRowp5LleY81fYfe1ozgF4PpyOsF9/r k1obft6zhCmdfdNOigQhNhjlv3goQevOBWzrriZ/IfiV2J39lzPS40BmDKTWUZTf1R LC3P6uurrJ/bF70nMvHORBezMJzS7/5FyER/8yxs= 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.4 07/76] mips: lib: uncached: fix non-standard usage of variable sp Date: Mon, 18 Jan 2021 12:34:07 +0100 Message-Id: <20210118113341.335761363@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210118113340.984217512@linuxfoundation.org> References: <20210118113340.984217512@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);