From patchwork Mon Jan 14 05:12:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 10761661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23F0A6C5 for ; Mon, 14 Jan 2019 05:12:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 103B12881B for ; Mon, 14 Jan 2019 05:12:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0286128821; Mon, 14 Jan 2019 05:12:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DE942881B for ; Mon, 14 Jan 2019 05:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PAFluBYEvozL+sVaCqMjjCfGE3w0WViCPAIrUuk7ywE=; b=B4UAe7ybItRU8F +F6JHqFOTQfxKdRobA2BUHJwL5OHQ/8xNm20UoHz72aaR7QPRseY0wnaTtdS6eRgtNrf3WPlz+KVv tcLrHzUzTlzA+7NDiI4VX++yoz/N3aogu18FTwOL4dVeJHYkPGik7OLJz8H7p+4lObNC4Hq9aWgDY 2thAR4NUS428GqKt/0crSpycOakCU7C4ytc+mwf9qd+YAitGEDAGgedfLyLQ5M4TgUd0yY8v/RS8Z /MgxLh+9OxgQ/FXmPJSjP5YBM0WZMuhAgvVEycx5Vfl7HbeasckOyQcpoHSrGdAeo1nZJrGGOFvqV nUJ6xJaHDh2WX+h2I25w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1giuXr-00028c-Ie; Mon, 14 Jan 2019 05:12:19 +0000 Received: from mail-ve1eur02on0601.outbound.protection.outlook.com ([2a01:111:f400:fe06::601] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1giuXo-000284-EB for linux-arm-kernel@lists.infradead.org; Mon, 14 Jan 2019 05:12:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kfp5DM7bQiq35wf+mlByfZd52IzYVeJWWPblxgYPipY=; b=O2C92bNBpJqVps4exj3fPrp4ctDfhLJNESOGNdy+qsn38ZGtqIc3mb1OYqRFHUZNIYPz3KbSHx/X9IeBgOV/hPhLEmB+27eLBCJL69msK9scAIGFBTpfOna5L0Uo1YZP5CYVFlFSLKrIgzGfGIx+jokYMgBNRyrlj7cXxkH/4Ts= Received: from VI1PR04MB4845.eurprd04.prod.outlook.com (20.177.49.14) by VI1PR04MB5038.eurprd04.prod.outlook.com (20.177.50.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.14; Mon, 14 Jan 2019 05:12:08 +0000 Received: from VI1PR04MB4845.eurprd04.prod.outlook.com ([fe80::a13c:ebf5:6fb5:8c7]) by VI1PR04MB4845.eurprd04.prod.outlook.com ([fe80::a13c:ebf5:6fb5:8c7%2]) with mapi id 15.20.1516.019; Mon, 14 Jan 2019 05:12:08 +0000 From: Bharat Bhushan To: Roy Pledge , Leo Li , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" Subject: [PATCH] soc: fsl: dpio: fix cpu range check Thread-Topic: [PATCH] soc: fsl: dpio: fix cpu range check Thread-Index: AQHUq8eyjXksS82nRkmGUg0ZzKV3Dg== Date: Mon, 14 Jan 2019 05:12:08 +0000 Message-ID: <20190114050237.32140-1-Bharat.Bhushan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.20.1 x-clientproxiedby: BM1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::29) To VI1PR04MB4845.eurprd04.prod.outlook.com (2603:10a6:803:54::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=bharat.bhushan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.143.254.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB5038; 6:P5k3tMpxjjKRh2dMyMWtcXYTbE4kwPt6dyx20s7V6VKOapOx3nIuF+uMUAme6D6rU05UDIBQFj5GTPNUKsf3O7c1QRPmPjca70nU4HEmuFzUv2iDs1H6Tw2/K4aipKaHtY9ksgSFZoQntN4C+Nn5FnD3/V8AR1lEKneiix6JjFkrW61WOl8qrtK5iacDXI7p8td0zfZPWjrKkCkVPRdh5WC7I7Z5/eo+KFeNl9n7OBg7tahYP+QgeH8cZQNb4hOUeXveAyrk9bTIfXdVjGfqoBfmQKDDtpsjebnjxvaR5LC808uAiNXy/j7ohPRErAVuJkaJ54i55szu4/Dl4OSMtq163I7xnZ9dxhWa+EOStFCi2LNmYE/6Wx2WFWx54eilgDWAq+WfP8ZMaQgsXKF4BzYJNdDXi+6OM0EtDRGwZLjIjjo+Pb/1WMZOmQbmHXRNRo5noTBCYWPsF4ONGUkLqA==; 5:XccgK3V1u04zieokYIPCDKi6dkeYV8QIVU9KOOmgKG65wA7D9W4lrlwS7XOGLGe654nv7KavHOQnljIJEsB2vxC47CPbLHmcf419paXE0t2zN7qmwqI8C3W6i1bBrv+M/NrhAMTTuQT5E9Z0g6/zB8jRne8O+aQHW57uP9EPKDJEwgKqHOzPhPxJMcjrSIjANycwz/BYScJgezmZLVxiaQ==; 7:vMQf+XMF8Ge5RQXUwkHl054qMCOIU7zfSr6vyntatNq7HIQwS3FwLzflOA0yp2IvTIc2qy72eLCrBqmG+pOvIfsHvsjB/bgoxfpUtROatjhXr/rQH2SNyxcIU1C8D1EumUCALeJ2OMR5PqF55AFUiA== x-ms-office365-filtering-correlation-id: 61a4e7e0-58fa-420e-b5f2-08d679ded4b0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB5038; x-ms-traffictypediagnostic: VI1PR04MB5038: x-microsoft-antispam-prvs: x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39860400002)(136003)(376002)(396003)(189003)(199004)(71200400001)(53936002)(14444005)(305945005)(6486002)(6436002)(4326008)(71190400001)(256004)(99286004)(4744005)(97736004)(7736002)(476003)(2616005)(486006)(50226002)(1076003)(78486014)(478600001)(8936002)(6512007)(81156014)(81166006)(8676002)(110136005)(6506007)(386003)(316002)(52116002)(2201001)(575784001)(86362001)(54906003)(3846002)(6116002)(2501003)(105586002)(2906002)(36756003)(14454004)(66066001)(39060400002)(26005)(55236004)(5660300001)(68736007)(102836004)(106356001)(186003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5038; H:VI1PR04MB4845.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: t1R0p6LJwFAXtLr2boopCsYeEfvifzRlIviTfmCxpv2a4U8ciObV9kPJHbXKJ0aAbBM/YaJD1N7BF6oC1JCKqqXrNlTtwsYhuu+AbXehoTJSTBf+ZYuQnMN6+87CluCLIM/SL43k50WsCqwfSADNcbeprhdNCXf6X2g1yLykoGOcvOZdK6hmeMDB5MjNPwjCVXeE4/9mJ/fi0Be9wXrC8M/MvNzJDEMZaCBhKmjC0ZeJDK6LE4eBNQjm8V4PTGLiYZUAfl/HmfvM4tPFuwqvxbx4sKCUMx7SZYtBbZ0etM+MHj9gN1GGESiNp7jlpE6uTRf94UjzY2NwD8EwiUEzjW8O769uZjPuh9B2v2kHopNrQs9Ybw7F+uE97rydJv0fYSL2KFHdFrld1Bwcr7u6fyW5TmsHEC9hXKZvkHSugao= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61a4e7e0-58fa-420e-b5f2-08d679ded4b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2019 05:12:06.3023 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5038 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190113_211216_553152_CDA93390 X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bharat Bhushan , "bharatb.yadav@gmail.com" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP cpu_possible(cpu) will always return true when cpu parameter is from cpumask_next(). Check for nr_cpu_ids rather than !cpu_possible(cpu). Signed-off-by: Bharat Bhushan --- drivers/soc/fsl/dpio/dpio-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c index e58fcc9096e8..eb369dd9e0a7 100644 --- a/drivers/soc/fsl/dpio/dpio-driver.c +++ b/drivers/soc/fsl/dpio/dpio-driver.c @@ -133,7 +133,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) else next_cpu = cpumask_next(next_cpu, cpu_online_mask); - if (!cpu_possible(next_cpu)) { + if (next_cpu >= nr_cpu_ids) { dev_err(dev, "probe failed. Number of DPIOs exceeds NR_CPUS.\n"); err = -ERANGE; goto err_allocate_irqs;