Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3214471pxj; Mon, 31 May 2021 23:42:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn+NbW9A6kF3i8S+SUcCYlbwood43XFZjG8erl53TJXpy/b41Y1iQ3ktOS5/Zp0I0tSWat X-Received: by 2002:a05:6638:38a8:: with SMTP id b40mr24033728jav.37.1622529766059; Mon, 31 May 2021 23:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622529766; cv=none; d=google.com; s=arc-20160816; b=k7nxHDrfK05dbhyrcijemYiOTupqMsuerbPnY4PfjSp8DJ9WiISrWvpH7WtkFq2Lbo 1jJ4qFxRBhGHC9p2rIMyEJ10A7Adkql48goEyboEO5FajKY7yqiWkzQnBpRB0Js4mHht rdQpSzYqU9n12Z9b9EkTaqK7a9zKThovWYCr02W38owYYA9uUh1BTeuSttC4TDqPRVD1 /N4YrHCISaeoGgEyW1FqWF9GOCiwr7Hp5QB6ZNCZDGHQCPV0cEIWPu+oMQtmYXV5zhEi RSk+yQ+j7CchEqQ6EbJeswylVLYEPqHh845+6VH3iAmh77X6fFYFPJ16UeScFrqiUJj3 H0hQ== 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=dT0XuSJqt+KkVAKXETe4hcKfRFWBqSXZEeoTCQBaoGs=; b=FtxBdMmOeiWN+yRvLgQw1a4ZU6dvMKsEbYpW1us0YQfHf0SgXagaCf66/LxZnsitDE nmQEc1XcFdX4j2dpZLt8Jtjlhn6Y2cHo8MHNFLJLW8udRXI+l8Hog1dWFxgcRyPppJxh HsQkoaBIF5yGgQeDG/iYWQtTKVEH4NjuMhZK/M33KKx5zYgrYEJQVDFqtWP8D1t8AGqE g8XuovOkTjVBsfFRh7dJHr5nk8nWJneJ/JtQHQBydGm78giDKU2AKRVTtEaaPAf4ha+m IKu/a2nDF8BHGY8TpHlZwhLwXgtZtQMUnGv4djXoRZhKhfL6PzrAfTBmKj49CdFvKxz+ NCGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si7988803ilj.3.2021.05.31.23.42.32; Mon, 31 May 2021 23:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232789AbhFAGma (ORCPT + 99 others); Tue, 1 Jun 2021 02:42:30 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2811 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbhFAGm3 (ORCPT ); Tue, 1 Jun 2021 02:42:29 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FvMqn5zpWzWqMs for ; Tue, 1 Jun 2021 14:36:05 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 1 Jun 2021 14:40:46 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 1 Jun 2021 14:40:45 +0800 From: Zhen Lei To: Johannes Thumshirn , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] mcb: Use DEFINE_RES_MEM() to simplify code Date: Tue, 1 Jun 2021 14:40:38 +0800 Message-ID: <20210601064038.9936-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The value of '.end' should be "start + size - 1". So the previous writing should have omitted subtracted 1. Signed-off-by: Zhen Lei --- drivers/mcb/mcb-lpc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/mcb/mcb-lpc.c b/drivers/mcb/mcb-lpc.c index 506676754538b9e..53decd89876ee1b 100644 --- a/drivers/mcb/mcb-lpc.c +++ b/drivers/mcb/mcb-lpc.c @@ -105,17 +105,8 @@ static int mcb_lpc_create_platform_device(const struct dmi_system_id *id) return ret; } -static struct resource sc24_fpga_resource = { - .start = 0xe000e000, - .end = 0xe000e000 + CHAM_HEADER_SIZE, - .flags = IORESOURCE_MEM, -}; - -static struct resource sc31_fpga_resource = { - .start = 0xf000e000, - .end = 0xf000e000 + CHAM_HEADER_SIZE, - .flags = IORESOURCE_MEM, -}; +static struct resource sc24_fpga_resource = DEFINE_RES_MEM(0xe000e000, CHAM_HEADER_SIZE); +static struct resource sc31_fpga_resource = DEFINE_RES_MEM(0xf000e000, CHAM_HEADER_SIZE); static struct platform_driver mcb_lpc_driver = { .driver = { -- 2.26.0.106.g9fadedd