Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp866228imm; Fri, 3 Aug 2018 13:01:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcl44IFpqPXNxl3aGOx4UoEf8qwSMKy/St0VjNhYrvxbbwEWJBfWXOXzm6WynoIFDmRmICO X-Received: by 2002:a63:d155:: with SMTP id c21-v6mr5083506pgj.188.1533326489042; Fri, 03 Aug 2018 13:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533326489; cv=none; d=google.com; s=arc-20160816; b=SRG38xNotVFTZ1O39yT3Y5fUV3ucgdy6d0oTsU8BWYRbddqw5BP9HpvcOYWcZ8TveT rYt0gnOQm88ZpZKTdl2TPOHE7lB3xeSJX8xw25hv765n4tileFZyb5rW1MRJ9fBacIMH ZTHkGPnDH15PYjdAJA+iYLmgScjpQQCP3RuB+sX+gLfePv4Xi8SIBu4eh3rpq+fm6VXO iRzySDPxog2o3/yBQYs/eaZ6dC9zKecKL68p90pG+DaJmYXYmSlzHAvNmHhWCub5WJ1I DUeJM3nF16wbAkOkDptnw7f15YPB41POfLRS98JUEbNREITo9OKVLAWZdlsb0OabrfZe vcfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=pErKKv6F4MkqIuM85zPVB5Q1Ron22fUWJmwJd2N7CKU=; b=D7LxP7zEMgCxfYaIIECP6CzuGhpKkvLJdY9HCeAPndQFZYdPDIy5O88D2YSNcmrfFC DNqjFioaVdv/rGpLV659kftKUK4KtFkLBrszVgwmB5dOGRcBJm229xyU2XyopdZA+XOh 0K/QRg2huour9nL/FYqv3gTl09pXSo1JTeGhjj1M7zOClYLLB9oIh3thFHKpoj36SwL1 +hWiZSX810b9iVuKwQYwtUYlk0byBRhTViXlGzCln6FwTCzkgp7UASTnCjCHR+HtLQ5o PVbtxh+yBdcJhXVuHicC1vo9/Ix9+7hPGCkCXfrYXYzjY3C895AiCaAd5fwZZ4airXoB bs0Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si5967093pfa.116.2018.08.03.13.01.14; Fri, 03 Aug 2018 13:01:29 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732257AbeHCV5C (ORCPT + 99 others); Fri, 3 Aug 2018 17:57:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45358 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732033AbeHCV5C (ORCPT ); Fri, 3 Aug 2018 17:57:02 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w73Jx5NS027972 for ; Fri, 3 Aug 2018 15:59:16 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kmwghrcmx-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 03 Aug 2018 15:59:16 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Aug 2018 20:59:14 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 3 Aug 2018 20:59:11 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w73JxAT542532966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 Aug 2018 19:59:10 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB1C952051; Fri, 3 Aug 2018 22:59:19 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.204.91]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id B26965204E; Fri, 3 Aug 2018 22:59:17 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 03 Aug 2018 22:59:07 +0300 From: Mike Rapoport To: Andrew Morton Cc: Richard Kuo , Ley Foon Tan , Richard Weinberger , Guan Xuetao , Michal Hocko , linux-hexagon@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-um@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 5/7] um: setup_physmem: stop using global variables Date: Fri, 3 Aug 2018 22:58:48 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18080319-0012-0000-0000-00000293ABB5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080319-0013-0000-0000-000020C5BF45 Message-Id: <1533326330-31677-6-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-03_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=682 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030216 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The setup_physmem() function receives uml_physmem and uml_reserved as parameters and still used these global variables. Replace such usage with local variables. Signed-off-by: Mike Rapoport Acked-by: Richard Weinberger --- arch/um/kernel/physmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index f02596e..0eaec0e 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -86,7 +86,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, long map_size; int err; - offset = uml_reserved - uml_physmem; + offset = reserve_end - start; map_size = len - offset; if(map_size <= 0) { os_warn("Too few physical memory! Needed=%lu, given=%lu\n", @@ -96,12 +96,12 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, physmem_fd = create_mem_file(len + highmem); - err = os_map_memory((void *) uml_reserved, physmem_fd, offset, + err = os_map_memory((void *) reserve_end, physmem_fd, offset, map_size, 1, 1, 1); if (err < 0) { os_warn("setup_physmem - mapping %ld bytes of memory at 0x%p " "failed - errno = %d\n", map_size, - (void *) uml_reserved, err); + (void *) reserve_end, err); exit(1); } -- 2.7.4