Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6972123imm; Tue, 24 Jul 2018 06:24:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeAk2yrFsPNOcd82EO9AgydBu78dI/bCQlG0iAIOswXD8JYWOKglFIyFc6JUlRMVhsL2yWm X-Received: by 2002:a63:f:: with SMTP id 15-v6mr16455941pga.430.1532438690427; Tue, 24 Jul 2018 06:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532438690; cv=none; d=google.com; s=arc-20160816; b=GxtuiEu3HXkcM025GZAyZ1v6Mc7USQRXgSX8jHFayaK9vHWnrNPyBUG23HdxVA0dDo y9dpzbxNn912tmbXeJuMBjz/HZ83EN6ctUWuf2tGHkVNSc4MyQjlleHrx7gLq3ljcXNi X2pjoOHzghxkp8MdF45rdUDJ6383ouEaz3MpfvK2sIzDlQIMEsSGnWXu/Wi7I/OvETVO JyYaZ/PWVSzyU0/ISgE/UaS6HJmmgUX1fkl9sDxFlkBnLay397NyOVfb0werrbEnk9b1 aOF9DqVcpLoMrhAvJM628wf6uITqC4SrM66UfJ4+eEA2c3utXb587YIYDsjNbxP7o7pS ZsPA== 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=I/QOyX3PFEfGRaiBPb16nRsZihtMU1MD5iWobTE4cO8=; b=XKecU4MpBNSHdlLWzs67RuHLmsSV/4QdhPm3lXtaxSMYEFOpKyzaB1napCxkPJMS5g EDdjZ7DncoIAq0hEARDJ0cQkisNC9xr2G2qz5NvKiL5xNsfDA3VjnEFYBfZgU5sPndg+ paaywpdtq8AEPcwftgd35bI0o+HM75oPKLCPR4aDRNqV9kLL1/Mr3AqI3PQtWQNel+Im I+key2q1T2wFJbfnwe/cnsHjqrvbzwhuQd8mrMVHeqm/xAp1X4qui8qrhombc1xv5oOi 7s7l5Cess2G+YxiYreb50kPVwTUCd7vWfgN006I2KyoOz8NBbgg0On6rc2QcsFBq/INK zZnA== 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 66-v6si11613406pge.159.2018.07.24.06.24.35; Tue, 24 Jul 2018 06:24:50 -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 S2388369AbeGXO35 (ORCPT + 99 others); Tue, 24 Jul 2018 10:29:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51442 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388297AbeGXO35 (ORCPT ); Tue, 24 Jul 2018 10:29:57 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6ODIasr121863 for ; Tue, 24 Jul 2018 09:23:28 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ke49wa0fa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Jul 2018 09:23:27 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Jul 2018 14:23:26 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Jul 2018 14:23:22 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6ODNLch40894590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Jul 2018 13:23:21 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39E6711C04C; Tue, 24 Jul 2018 16:23:36 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8D5D11C054; Tue, 24 Jul 2018 16:23:34 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.56]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 24 Jul 2018 16:23:34 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Tue, 24 Jul 2018 16:23:19 +0300 From: Mike Rapoport To: Jeff Dike , Richard Weinberger Cc: Michal Hocko , linux-um@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 1/2] um: setup_physmem: stop using global variables Date: Tue, 24 Jul 2018 16:23:13 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532438594-4530-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1532438594-4530-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18072413-0028-0000-0000-000002DF8A11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072413-0029-0000-0000-00002397702C Message-Id: <1532438594-4530-2-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-24_04:,, 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=804 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807240141 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 --- 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