From patchwork Mon Jan 25 23:32:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 778C5C433DB for ; Mon, 25 Jan 2021 23:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4491322AAA for ; Mon, 25 Jan 2021 23:35:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732798AbhAYXfV (ORCPT ); Mon, 25 Jan 2021 18:35:21 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:5580 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732913AbhAYXej (ORCPT ); Mon, 25 Jan 2021 18:34:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617679; x=1643153679; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Lq+Okxl3S0+ZzfUmJqwSdxWxDX6euQesnVDFdpzNkYc=; b=F/R6vZCZX2bxkTgq1hg9NQB2PGZThgs3ms2x4BEOaJRX86jy5bVI7L9S jtsZKqPFhKJLsjxMtV0VV6zFV3IcyA4C70rvWR4bePcJrC+6dr51kuz7J bmyOLn5+Wf1bfPEVMQ/tAe+dbNpt+zLdz7+ohcT47fMfsFRFzoemCmzpq SXPc5wDyNP+g+DVcsn7tML4O8mLp36bzPlTWmaa1pbNJakj4rbgW9N2BG NK61TCRcqvcOnKhvL7w48gZvFEoPqzjtIq0o0BL3eG/u0PJhEg+qQ6bsl H8QztMAMPsRUanJvemXitjGDQ5WYc5o3i/m40DRRpFyU7j0OF1/k5p8TD g==; IronPort-SDR: WZnOysLRWdZ/8Iai+rfa0ugk/GGRIS65uYQeSyuvr/TgFXPuHw6XTTNjdPrCVyopPd0ZJTtz6V siMC2N6nLxUTdD3P3QQzGDAv+Ekcqy+elFu4o54t+XtwQRrN1TmCSJqA8y2abKgsUBzOScwj9M uUPjBvFZCiqSU/9psAiz0Cq6+L8NoDISJANC1wJFZ56m1hotPlRXu1qwxIArSVmqU899QjJZtc LE2/Q2y5oIA/vFGXgj/M96lDPIE9N8hnaZXjWA58Ywaydv4jE93AVNEuBrYyDllcFJDXQJIPkN YJE= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="159472146" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:32:50 +0800 IronPort-SDR: HJr4c4HFO0S3fPHrqjA232p3wABtmewJ2I1IyCSqm+eUY9bnjmY4GOz91IyDwsJC79UjyB7LJk Kvs0DIf+XHmwYuM/k9XLnuRviEPo7tolP1dN2CtVGYnz7GuHbs48N/FspvpUf8OB7NieJBWY7x olpQN6FyMZnyq8E45ZyORmtpnRjV2a1d9bkeALzEekA752fkZzbfy82H8z178Qgx4DXctA9ixl TI7XXrHisJGhtbEvAwyLvwNgBGoAwIj+GMtczmZWJ352Q54HMHX9weFXyo9gF1lNpYGCEnctt6 ZQmXIzjPEZOErUlmk5sOzG18 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:15:17 -0800 IronPort-SDR: 6r1N4OgNjwfs/47sjUscH0fEuDfb4rPU7oQh6vecOxKfn/NvAX36oBYWIHVBP9XeOk9i4wRFOG OsOYqj1PWr/JzFN5AnLit1JrusMPRBtvUKPNsl991nN5yl7efQ0j+YiDJFBFjfJRDr9/TF0wIF YS9rXV51a4F/HAmgoqcufAYqbswJaTCajU/07zTyFAY9fpz5RKIESFOmY3fosx0FzGiGzHjkCq GxDJ1LHWVkq/xLRkEqN3auKp95OpN19DWGRC/iEGmf4a+wmLgcJOMnK0Fy0A62Yjv3Xe2Pdn81 +ls= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:32:50 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 1/9] n64: use pr_fmt to avoid duplicate string Date: Mon, 25 Jan 2021 15:32:35 -0800 Message-Id: <20210125233243.5982-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Instead of repeating the n64cart string all over the module use pr_fmt macro and remove the duplicate string. Also, replace and with or in the one of the error message. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index e76722acba46..8c7c9249071b 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -5,6 +5,7 @@ * Copyright (c) 2021 Lauri Kasanen */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include #include #include @@ -117,12 +118,12 @@ static int __init n64cart_probe(struct platform_device *pdev) struct gendisk *disk; if (!start || !size) { - pr_err("n64cart: start and size not specified\n"); + pr_err("start or size not specified\n"); return -ENODEV; } if (size & 4095) { - pr_err("n64cart: size must be a multiple of 4K\n"); + pr_err("size must be a multiple of 4K\n"); return -ENODEV; } From patchwork Mon Jan 25 23:32:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044875 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A4EEC433E6 for ; Mon, 25 Jan 2021 23:36:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6871722AAA for ; Mon, 25 Jan 2021 23:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732742AbhAYXgZ (ORCPT ); Mon, 25 Jan 2021 18:36:25 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:5580 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732870AbhAYXgO (ORCPT ); Mon, 25 Jan 2021 18:36:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617774; x=1643153774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J5Nh6XbO+rv4ltyfrH9y2HGfS5ss18cJZZOYPR3E7YU=; b=fL/R7KqAJ2veK1oC7BCkgNP5Hl8ub1k0YRMfep10ZmC8unQ5PUeQMf3r BcxZ2mpy4o90SXkqLS/5boVj9rQ2Ak8yBDOzWqqXLN5+p3F8mq6qhjPiG U51AZaSvDSHiUmpKarV+XQkDJ7dv3w9QDgGLvzM0owzYPFRU28loRUCVu 5e8xPgWi/+UJQPH5KZlvnCa6gXAiT60Ngmtux4jZsj40h4a5XRmeKIyru qXpYjorWuJufTRL+nVu/AGrlWDM8PU0oAcl1KTv+etQ1jt99ljIPAkJIy H476P98jg6FtP8sujs78R6sGRZ6DCV+EfoTWLaT2wVkqbyc84zsAJC8Pi g==; IronPort-SDR: 5PNXT20qukbG9wcG7aGuSfzOn6BHrxpWJiypHHHtxrzsY6VAjweypbfOjFkbH0Txp4TgYDEeOv 7otFgR5487W0Zg/gct48fMCi7/PYzzt3D8Ma6qqBIkNtKsbivMXbOrU0nMFahVjS0rVZr+Rk1K wFYDkioOsUV4EsScpNhEGfIZmQ2/NGxb1s5zDkWGPKJVgbOzCV3U0jXMzSHSPZGM0CX0UWO2g9 Xny79NWyyimm01pf62cq1pg+JWa4YjrbuaXhvXcTtejlaSB1CdLp2D9sFrTHKww98hO3Rh2mut Tn0= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="159472148" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:32:56 +0800 IronPort-SDR: jQsH750BBmg8dnxTkUOFQYIeO2bYvnHUPLQI7PdF2kJiDDYSKAsNwzAqWVhYkFWz3cO2YWfjvB z+tUD/eWpvJEAVy6kMwJZHtscntb1OWstDX++J6Tykqj0vHfhFQdnogmJ6Mdl+u+MgevMBTLwC VuLsJE5Vr+YCCpn5BAhbgoPFkmPDgLH0JnoADQt27KTRmjrQPMn2iLNb9F7XWRGAQnRddPyzCS bg564qkcbMfxNKdoi/TF6hf5XC0iehnecyEDCkj07VrZDLHLUZQi0KcImoHZrOMdo2P2uRl2E8 pHfdXwq5jm6AakgAVenrHSbL Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:15:22 -0800 IronPort-SDR: Bg7P0DPkHkgl64EdlwfbKutdxVwqv61t0M+bcK5sGmfBSQYOuZDOXDNXwyFItyZrTjAWfUZq4y WI4cjbXBkyjhKq/fyJQHOLLWws+uvLdwyJ+OMATEDEN/ldsM/b47TTrcCfEirSrYBJF3Y+mcz8 D4E1P3XTHbQsR2jVZ4/9gK/HgcYM09JiVbicH956GDLqjbVMpUxxQ/kY7ZehzcbIJzUQFgzd9g KkAe1W7oWSDYs6OmKCXUUO5CRb4/MfkFD/3Dvr+Mzxe0KQP8njmbdyG6kIEhNyMvFB986+CmOP 78g= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:32:55 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 2/9] n64: move module info at the end Date: Mon, 25 Jan 2021 15:32:36 -0800 Message-Id: <20210125233243.5982-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Move the module auth, description, and license at the end of the file just like what we have for the other modules. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index 8c7c9249071b..63090030ed2b 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -13,10 +13,6 @@ #include #include -MODULE_AUTHOR("Lauri Kasanen "); -MODULE_DESCRIPTION("Driver for the N64 cart"); -MODULE_LICENSE("GPL"); - static unsigned int start, size; static u32 __iomem *reg_base; static struct device *dev; @@ -188,3 +184,7 @@ module_param(size, uint, 0); MODULE_PARM_DESC(size, "Size of the cart block data, in bytes"); module_init(n64cart_init); + +MODULE_AUTHOR("Lauri Kasanen "); +MODULE_DESCRIPTION("Driver for the N64 cart"); +MODULE_LICENSE("GPL"); From patchwork Mon Jan 25 23:32:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24099C433E6 for ; Mon, 25 Jan 2021 23:35:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5AB222A84 for ; Mon, 25 Jan 2021 23:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732535AbhAYXeu (ORCPT ); Mon, 25 Jan 2021 18:34:50 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:19917 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732923AbhAYXej (ORCPT ); Mon, 25 Jan 2021 18:34:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617678; x=1643153678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5m9gUeokQN0sy90fPToB0a5giSO64cwa9Bxli7WeYwc=; b=EtV7DVtts7UEloCnOblpfyxv+Ci/68HyeeLKqvoFk4JOLt43eEzIQF3G t7LBUWoXAQzIqUENSWHbUp/tLQfMG5KcBO/EFMXWIDCQbapAEQbnSeSqH rjOHiNo4caGkFoGB2irU4gZGs62aLt8IbElyK7rHhVxaBmekV3p5STy1W 56ax6JKWNXqFgWwF5Mqej/apkk1mCmRHwQ7W2zRouM+lelLOewjyRA+nK O7OBH1O4tW1T9wHCMoch3bqYBC8+uaFtycNzXZNt+PE94tYMKO7m419Dv pF8N3HRG7G/gKZVQwCRh2q43zJQXsCd9reKero2zopXd0kvodhUkoJGMk w==; IronPort-SDR: 2wMObJ2QjSHImr75N6JJHXwqbI0oX1UTdsmxr2ZWF1RvaMbEEAxmmJWA5/iVHlExMROmd7DgBZ 6MWuwetb/hpQpeFpWoCO+2nMXbF+LxYt73X6srjnEdaL782Ed8i1RHKAKYJrWiUIcltRHLOSy3 S/vnTMMGuNyf1cZzMnEmdgHmF2a5FKgP8IJUaQpA7Oj+20Zf5+Onr614LkIngKdU3qkl6txLHQ SsBBocAx9nd8bM3/1k8pE7fnZhGb9gdUvNOdmm8RsUpl/YkI+YTrL9uqczaNiF0EwPHoktp07x L/Y= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="158296159" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:33:00 +0800 IronPort-SDR: aztBhC5gHG0ZQpObWF56ODASP2B6OmH/eoRcYeYTsDInYC3Z9saNuvL2qqkRxUt3oo9uI7V5p/ h2dwwZfGY59rPo308kNvhO054/A06H18MWknp1jmXbK2XgB/QrNs/oUZt9/t/9+0yl3iqGAkem 8XrD9nkleG6z4i+EfClBXAMp3OIR3XwV9m68F2c6x52YkU/gopnZA3wHwG4ykG9GdfsWDjrZbT aQwwyMOEHq3mll9J973F/Y0BYO++8nYrYDRPq59l7Dtu4pY/tMAlp/UyrWb2HMG2Mgt9+1kSW6 P45WUx1OMCSJB1ms3a1uaZuc Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:15:27 -0800 IronPort-SDR: tx6bo1E7gstAcB8yskVCrUkZDUZlx+a/G5jMGhk7gchHRsQ4SryEqx4VzqO3m2u2UYIO5IlCKg M22LSJ3viGNCmqN1A8fjke5LrbsE5/kafCgfnXyQaI47Z1fmc8ViT94nbNXsZZI2Tyh21OzFtk 09J2D7iz0hJNM2PSI6U7TzZwHtpTpRh7hQNUoZK3TDBFO+Aq5QPzUORZZ4oGBBqWkI2hZrQc2P 26yXgP/bp+csRArNPxk3NYo0FxIGIH56VeJ6gHeBEDcNNa/4BUJ54mUa5lSt/3LlrbW+ByBpA5 Rfo= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:00 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 3/9] n64: move module param at the top Date: Mon, 25 Jan 2021 15:32:37 -0800 Message-Id: <20210125233243.5982-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Move module parameters at the top of the file after macro definition & global variables below macro definitions just like we have for other modules. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index 63090030ed2b..b18f034ee1ad 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -13,10 +13,6 @@ #include #include -static unsigned int start, size; -static u32 __iomem *reg_base; -static struct device *dev; - #define PI_DRAM_REG 0 #define PI_CART_REG 1 #define PI_READ_REG 2 @@ -31,6 +27,17 @@ static struct device *dev; #define MIN_ALIGNMENT 8 +static u32 __iomem *reg_base; +static struct device *dev; + +static unsigned int start; +module_param(start, uint, 0); +MODULE_PARM_DESC(start, "Start address of the cart block data"); + +static unsigned int size; +module_param(size, uint, 0); +MODULE_PARM_DESC(size, "Size of the cart block data, in bytes"); + static void n64cart_write_reg(const u8 reg, const u32 value) { writel(value, reg_base + reg); @@ -177,12 +184,6 @@ static int __init n64cart_init(void) return platform_driver_probe(&n64cart_driver, n64cart_probe); } -module_param(start, uint, 0); -MODULE_PARM_DESC(start, "Start address of the cart block data"); - -module_param(size, uint, 0); -MODULE_PARM_DESC(size, "Size of the cart block data, in bytes"); - module_init(n64cart_init); MODULE_AUTHOR("Lauri Kasanen "); From patchwork Mon Jan 25 23:32:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33E17C433E0 for ; Mon, 25 Jan 2021 23:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C12722B3F for ; Mon, 25 Jan 2021 23:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732634AbhAYXgq (ORCPT ); Mon, 25 Jan 2021 18:36:46 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:5731 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732824AbhAYXgi (ORCPT ); Mon, 25 Jan 2021 18:36:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617798; x=1643153798; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u3nLlME8qfr7Z4mJ4z3Lc1197XAsZU5OOL/6R2Ttjyk=; b=X7Rj5omlZ/SWNOa7Onr/nV4y7+p2lOmnBDQIqi7gJ4Wa4DT+XFsQafZ3 LfrWjONR+FphYID/uvFwv/NXpVE2v6a8nyx3J4fMnw/kaGNSHr8biYd88 vTVy1Bx8EkOlS7kfZ/9wfI6bLmrA3ZndSzvzZBjaK7YcT/2Jab3DQgwn5 yBAJz01eAEyXe2RDzllNOGNC/7/MKzKP20LiYOc07/gNTHjZgYRItW1Dl UKOdNS3lGsdf39pXb4ySX0+rf/J1mz7vH7FIx453ocZh6rKeiMv2g2CFo R3dua+cb6OsjxLiRp/5d5OBT42GysFgjs8g64M2RP0fRaMQr+WBY15kKY w==; IronPort-SDR: G3eVZmJux4XdIkxQqcD8w1tcmim/uZZix4CVfaOBgfWlAhFJdQlYdC7ZFMuChqTSOIllwitfO4 lKFbnDGK7XOiYaRGAec0uKskM6f/DH8/uYCXxFo8cm7wF8CgjqQlV40asX4ct2DV7iSVF6WS19 OxXhmwp7v/c+dAQiStRFvUT6nULBkl3kN7QXQLAzsyh5WP/zZqOxCChdRPYquS9LQis+kfHjMf dF17DK7LJCqLU1dLltA3moN2KsdPfvNsWtoLf6SY30NsSmlY8IsmhUK6hX/R0/CFRhsIMT+PgY X3g= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="159472155" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:33:06 +0800 IronPort-SDR: 8k3RVkrEbbHaE1VcVctrg8MAVOLmN30wdZ1+qPKhzZxtNMcKlgTTBJ+2AaSDbBn+sgz/CMVwZZ 3gBaCRYuyOXAtTa9BoqVPy6VxC2ay5KZ8XbEYtKfDZhev6d/24pec7GKd/XBNhnEU5RhtbpppK Vpcy5OKObgR2J4Mcwary4wgOCVnf/A/Z6/MSqxlyX55t5fA7c7yEpbEXEMLRBAp5P+cmU5Vnv9 ND57BEGSEqwP5NdU0JwHo5Gc1gwBHAMTyhzbi1bH0zgRD2q41Ojg1WUc6taSZyQnaioyl33CIy 05LQTIWfZwKAlOX65PFCxYr0 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:17:33 -0800 IronPort-SDR: yo7oXNN2lrYZFpZD6I7RWNcFGKdhwIDE/Ub299+V8sHqICebm5BaoOfVMdyZP0oCbPg6db68+C kWYNyzwxMk6oI4r9a06x8VjqEZOjp5hhw49Y5huLZ9X7w8EejhN5BylbrWBnjhie/Tp7TCnou/ ROVmBsyP0LS7zgMYNoFQZQkivYH5xajdyE5hebEnSh5SvFcjRFzxWL6GuHDbuBx2jsZDMjlXaU 1tTK6QqhSYPM3/AHUYXWEvivcQ1wZpk4EEzDKOXbXClospMEirLuxyFdbuYgOO0Nvyy/dhrRAT 8ds= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:06 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 4/9] n64: use enums for reg Date: Mon, 25 Jan 2021 15:32:38 -0800 Message-Id: <20210125233243.5982-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Macros tend to be not type-safe. Use enum for register definitions. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index b18f034ee1ad..620f9e080d5d 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -13,11 +13,13 @@ #include #include -#define PI_DRAM_REG 0 -#define PI_CART_REG 1 -#define PI_READ_REG 2 -#define PI_WRITE_REG 3 -#define PI_STATUS_REG 4 +enum { + PI_DRAM_REG = 0, + PI_CART_REG, + PI_READ_REG, + PI_WRITE_REG, + PI_STATUS_REG, +}; #define PI_STATUS_DMA_BUSY (1 << 0) #define PI_STATUS_IO_BUSY (1 << 1) From patchwork Mon Jan 25 23:32:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E3D5C43381 for ; Mon, 25 Jan 2021 23:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E1C422AAC for ; Mon, 25 Jan 2021 23:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732691AbhAYXhU (ORCPT ); Mon, 25 Jan 2021 18:37:20 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:5580 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732706AbhAYXhE (ORCPT ); Mon, 25 Jan 2021 18:37:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617824; x=1643153824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VVy/lgGRMlIuhUP/DqeEb03EWvoZ5UbBH4eS8ECqgU0=; b=hzCViwAJLIqDUxoYY1NGnbCGihhIwNCneAcGCehHcQSOyYDHqvHdlcsw ePNQDmII8iXOabZlUHZC0/WV1GHLKSALS4zLThw3xwKjnmub3I6nkm7US CEuxfcCoPxG5hr8NwuCAwSR5cRdjCPmZz3LmCLB8HguBQIvedrEpM6ov8 0iQ4yqKSImeKAw/k7tekjeVnI83lgRlmKC6gUmj4UnmIu/WwNYSLX5/9l FYkE8yqImt6bKGzviHY6ArlhJYWB2IcmvzxtGrBaWa2vadufqNiEdH5Wo n92K1jIGaQUycG8vo94C+cJKslQNrxm+2MKb6F3ZAzASrb6wMXF57E+YC w==; IronPort-SDR: rGU2dM2huKiRkU+glDxBCreton4E8nA1o758FnPyR1Ho6jTv66OosdwULIhkLt3AK/TLankrTS 2M4KEMHKXaZ2WvAPjtvRwQnTvPuzbbCruGDM0LtDJUF17oJ/jxoPJPlXwXYXxBwSM4YibK3jta K/w+Ab2XPIXrtpxqbr/C74W5Ycpg5iNeWxcuhVm82CXl6DBYAk1l3dfKdZlX5RSPlajruMnXIq WB4q9RNLBBwXP7UV7ZHnvoNMivczI9eSd79CMFQnrZF69hN4kHG/vyjDP50XYUMyT+Y8exENgb 6PI= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="159472164" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:33:12 +0800 IronPort-SDR: CqpwEKKyU/8bJ7mJa7AcarwyfGRcsz+VwefEFYN80KxwvzWlaw3tgxWCr76IV1qkdpfbM8Oycx eh+bJ/miOmFeF+0VNE/dKIAxUzO9Unf0M26ZVb7CfLdOKmaWybt6pf+uuYb4EIRLg8q8JKvko1 H2OA+YuvdfgK0MCwZLnoND0cFp7nTeIpirXeak3CIXoOZ1GXHlZe9R+Fvc89HyAuWgLogECRuh XYCOCzF4rOb3+AFUdJs0aT0i4twnKWwIFpSlTRR+R5I9+B49Vq0qfLgIE3EVw2cHgcnh+5WEck Hv/UyFWRanftsJlwmXxO9HBN Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:15:39 -0800 IronPort-SDR: oWhdoet6Gh4qVwfcNiWGteoSOHuS0kWtUkuFcLEbgHYuSnjHhSTXeTuUQSIzpt1S6o35nKfDt5 3c+PYzpijP7nirBawu5iVAL3zOc7CGrB5ZmdOMvqOmmChcmRNWPN6pSoIFtzhc/Zi+YWr0MI2O 0vjvu+YlnJoMBm09BYFEko8YkVZnvYUnwxdbHwZ/pFJwP3jmuqAsZ5mcmdSVsCSZWl/tt67zzr vc6qhrJ/QNym6RjsNEIXQXoy/Y2MQ6AH0aX7hAnctBj0lH/qv+1LPoGDd3X5a2WzzY/zAnYBiU cHI= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:11 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 5/9] n64: use sector SECTOR_SHIFT instead 512 Date: Mon, 25 Jan 2021 15:32:39 -0800 Message-Id: <20210125233243.5982-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Instead of using magic numbers use SECTOR_SHIFT to get the number of sectors from the size. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index 620f9e080d5d..c83a6af5a718 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -157,7 +157,7 @@ static int __init n64cart_probe(struct platform_device *pdev) disk->fops = &n64cart_fops; strcpy(disk->disk_name, "n64cart"); - set_capacity(disk, size / 512); + set_capacity(disk, size >> SECTOR_SHIFT); set_disk_ro(disk, 1); blk_queue_flag_set(QUEUE_FLAG_NONROT, queue); From patchwork Mon Jan 25 23:32:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 692D9C433E9 for ; Mon, 25 Jan 2021 23:35:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E41C22A84 for ; Mon, 25 Jan 2021 23:35:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732672AbhAYXfL (ORCPT ); Mon, 25 Jan 2021 18:35:11 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:42755 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732634AbhAYXeq (ORCPT ); Mon, 25 Jan 2021 18:34:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617692; x=1643153692; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Uxp6EwTgU3uwmdxB7GLUpGFxLslWIIrZ8nm7dltbi2M=; b=ZlcrccaEx1sh+TxMNU4Oc4tJQwDO0qblVuzLvfCCQ6tFouS5i9yC/BOi xCmqnm8uKxnONvqdZPQIFzJddoXOMOVuz01W7eBUeSu16/o1nka7feYSX f8xMcQzkhLeXVHNNGRc5oSg7xkTpjYh2JCnhVcmWuqgbu1W5oRilxW7dD 9zimFJqpInRsdYSf0nLcTYnqhHgsiUW64gC7+rSmUdd90+4pLalZ422e2 1jAhW3CQyX9DF/VG6CEypVqPAvCMzV9lUHJoa6wkN4y3m4oPJyd3HzGIf Zcuu4bWawFi1SHloS6G6oVW+turOBc2YipmirIxxUW+dDjIAm5Yl+NE33 g==; IronPort-SDR: QrR21EVqiUHRyOj7CtZ7A/NuLXEKY/6py31hzfYzuqr32vx0cTpNBo4/oXj9l4BdlvEZ0AtDGt lwREqB2fy260krMVn54dXyaucMs5b7jj8DobxlMA6obw4UcYWPancLPJsbTS3WBJ0X5CKjzyEF MWL8oLIRMJoaR+ik0cgG9Z5jISZZa1ukQ3qXy3KPplZcEQ2LghPoF7YfBJM9oj0k1LlbbkJXmK 0E7+Ci8BKsDkXzEWQbf+x5XROn+rXWz/syYyENp+HLLo1ZQK+/2xxLDpyvQjZhk86Q4vmTpqma DbY= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="262307387" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:52:56 +0800 IronPort-SDR: +KFYK71zOOqJO/kv5pLrRZs/wcZgZ7mzgTUhtyq/hGGVmv7Q1W3VBGMs3r5+T8PGvkq+yylo9i RhK2L2lezrJ03gznrWzeFnPFyo++K7rUILjBBm3ynZIJgqwBsuNBli0VmE7tvCE2/lZ1w3pCKp R1e+oIDfsImRajTFJtegxCDAeC+pElQDn57iIWoEVbEAXtJLKbmimXuWVt3qlAr0Wd1gDBtoME f8RmvpcFPXamNgs4ayPNbVRSr1x74ObcV9ar04MkfDOeXThMZ9sQmapXx6Y32pxZf+RV5t1A5M uaUdzm/mGqX8nuzMtzMx0tkj Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:15:44 -0800 IronPort-SDR: hnUaIIauLc93vVOvot/Xt8Pb7COrHUEV6foA8wF4+MlI3x0xmtcmM0UrfrQXVCkRR8RPRK/+f+ uWTOm/P2y5NYDbedNNvuJZmmrNhPt9yxcN4FRD1+39H7JmdnXi7RwgcGtiHgiKFqVBps61ByqN As6/r/EG1lWLCLfBHrIxjwotgtSdMM/36erVjs1+5h4Isjh2q6EbUWklxH8i0aMmTO6Luu2Ixq jP3WgIcJXjLTtHhuQMzmgi97WzLIATyXhgoYQjnjdWoSXbz4KGmXZ90kAQAHtRJZpSBlfBMw9D QCo= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:17 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 6/9] n64: remove curly brackets Date: Mon, 25 Jan 2021 15:32:40 -0800 Message-Id: <20210125233243.5982-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Remove extra braces for the if which has only single statement. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index c83a6af5a718..7906b5b2f12e 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -133,9 +133,8 @@ static int __init n64cart_probe(struct platform_device *pdev) } queue = blk_alloc_queue(NUMA_NO_NODE); - if (!queue) { + if (!queue) return -ENOMEM; - } reg_base = devm_platform_ioremap_resource(pdev, 0); if (!reg_base) { From patchwork Mon Jan 25 23:32:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97BCFC4332B for ; Mon, 25 Jan 2021 23:35:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B2CD22AAC for ; Mon, 25 Jan 2021 23:35:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732293AbhAYXfB (ORCPT ); Mon, 25 Jan 2021 18:35:01 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:31536 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732754AbhAYXeq (ORCPT ); Mon, 25 Jan 2021 18:34:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617685; x=1643153685; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0k5bSmKlMDaTbEC9mr9VlyhcPgLOqERH/sYvhfMb1dM=; b=QWPJ4yWfzqFtHnlass7+XdlE2zmKXJvi/1IRE68baHvPoJm/Whml12hT QSPIfL4js52IyBl48d4XuAX/PrapAJXPd2HfhYepgBHx1gFDXhacnuIF1 ETFwyb3KpctYld/XbVl5eal6FF9UcEiKJAgo6Y17lhXrMJowzDXuGPjDz 4fX5gGgsk0HU1ZUCgopt10U8DfCE1S2DJPAATquz40+43R5JaTfXowWxy em2wORS11Nxvyue1nZA5KNSNZwXfRtOiwsY/amaG7rpgJ1ZMaOzMe1EU4 IXEybD8psTCC1vNISVBFkZZxicFuHb6gYVuBIrfS0QhvVQkyw8aOUow5A w==; IronPort-SDR: 2zDq5lCjnjQ59eHoVKLoc8bS+DT5k38nB1U648wEHzNBFDgBeEwCWPxkmRJA/SA/m+FzAmEFgB zDl4Lj8TKnrZcBylvlDBEDuznJZpC1mcSUhSKqX1nZFQgxNgBqWzPQUFYTTIrJHaNAwcChy1mU kWEOolu+ndoqy3uTjA6mjbzB0FYT2TfZirbatMXcxmi6ioy6yybU2VhDshUpySgByYJIWwJqZT jSaOOOe/IwC7/5AanLZLSx5qjNUPP9LrNOmvh7GW49bhCVASbo/Kscp4K67ydJIEQSXm8hLYLQ P2c= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="162741776" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:33:22 +0800 IronPort-SDR: YdO9rMxUmp1u3kHtkNALnzFZHdOjqqy9oJSpox7vA+OQJa7uORqblGaqLu8dJpI5gmerm2Niuy ovYTvBS3z1Qd1BNFooMz2n9AIz0KmWBlYSXXh48C6y/zGffkwTPeqXZPnntb4EqdPziKUNnFyu sVUuMXh0Lu0545rtyF4VTwFvlZLWsz7rFoKwZWE3kx+0/4uHWga47sltRSarRmN77RlNPJsPEt FWNjtxlfS+M8FES4tl3GTh33iPh9UeRY4ezX0G230vTzdVf11EN7JSo9kzDNNZ23rgeZr8fR44 +gcj1qN1O4wTm9/trXswccR6 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:17:49 -0800 IronPort-SDR: i7/cMYd+hocFNqXoNg50Q+gNh2mAUaB2Xz9Hk9stP9jTQ17ckpizvgtuG3p2+B/L7fNDjc3Q3c 7yJjlixVeeRL5GIsDOkNgwBxbCBYrbgKfL11kaFamhL88LU84SuMfCdY3e2OLD0hFTVTv1k7KP iHd2QLpDDJT6rD0G/1nBekfkAJjkNMVyXgOuX85CwxRYQ94Vur+25aXYKZQvC+BQ+K2PkbscUb q65ZKm6GWdsKTUwk2oQsUOxylzXnAN3xFtNUoXlASpyv6ROcjOWfVpfAmlNjx/EXEL0r9y9XUV wI8= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:22 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 7/9] n64: cosmetics changes Date: Mon, 25 Jan 2021 15:32:41 -0800 Message-Id: <20210125233243.5982-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Make the variable declaration ascending order and initialize the variables at the time of declaration when possible. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index 7906b5b2f12e..3bfb010402e3 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -88,10 +88,8 @@ static bool n64cart_do_bvec(struct device *dev, struct bio_vec *bv, u32 pos) static blk_qc_t n64cart_submit_bio(struct bio *bio) { struct bio_vec bvec; - u32 pos; struct bvec_iter iter; - - pos = bio->bi_iter.bi_sector << SECTOR_SHIFT; + u32 pos = bio->bi_iter.bi_sector << SECTOR_SHIFT; bio_for_each_segment(bvec, bio, iter) { if (!n64cart_do_bvec(dev, &bvec, pos)) @@ -119,8 +117,8 @@ static const struct block_device_operations n64cart_fops = { static int __init n64cart_probe(struct platform_device *pdev) { int err; - struct request_queue *queue; struct gendisk *disk; + struct request_queue *queue; if (!start || !size) { pr_err("start or size not specified\n"); From patchwork Mon Jan 25 23:32:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC68C433E0 for ; Mon, 25 Jan 2021 23:36:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67FFB2226A for ; Mon, 25 Jan 2021 23:36:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732870AbhAYXgZ (ORCPT ); Mon, 25 Jan 2021 18:36:25 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:31536 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732861AbhAYXgW (ORCPT ); Mon, 25 Jan 2021 18:36:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617781; x=1643153781; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rPCotImD7rAjKRPI/PLmqgAnxhIjMj15dDdEMuR2BcE=; b=fNP8F1yTXKvKVVHZIpPIzhZPYOJ6+XitdUWa/HKQ0sxSro/HY7s4TiFd YK56LCGC9BNWZhcW+9NRtxVOin+AamcIzFZrW/L4MOYfJ2fRsLl/11F0u QucOEdNqMNTX04q+EQ4hVK5VfXJGe5hv1+Tu5sqngBhScmSz5lnLLLwou Hl1OqHRZL1Fe1nt+FDs9qdfMgxoROcoYoZ43QFX2D387GMQxm/tNZzrNo eOB9y5fItEvwpkiMUWu4QymWawHEsLDQ8U0fPjT6odx3Tjn2BdgKfvtzO LKadT17jzaZfArSFqZrLmVG9makTeRIsOMjBG7kt8kf5hgs0VE4ZbmzIj A==; IronPort-SDR: YyfHHqqaWuZ+LYwmH3evzKfAkinYRv5Y+1ZDkQB7tXIkEkYs6PEfJvz6aXvsWRPbPYwK6LpuAI 0vqiKsluAvsbSaxud4mSaSVy2aNto00m1xeOLPrj+xQUS07M2/27Le6b17j+/EY3KBfoA21ToE 2NnyOFV85CfI3R7JShkhnwlrLpr2rG4XwQoBSEmVyHPw5xCO0tz8DUlzf4VfSmBEshCPfkQ2OQ Y05Mi8FgJ1QXM6v7tmCwZbeGMdvBp+/BPhM1BtnX5wyhSZRgFepAvGiC+fOkE0x4XJIqK5XUF9 UIs= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="162741784" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:33:27 +0800 IronPort-SDR: VQHJcwFx0m81jq4TVR3Co/BVXy5aHrEiOCyudHd4BS2vpV7U7WwVGD1zD544lUD52zCSKNsdsw KAFYJnQ6Lk0YYCkzZJzL7tIViptbZuFzRKRCIKyOPNrYib6DGbjf2WP64T8fxNYDeIC1FjR3kU uOaiW1TfxFQeoPSavCVCDWq3mG3cxIyvwGQTYaeELiu4FvLYglwPLZUL+yjQimOH72eRgI1Coi 1ecj6BkkGAFcEZ3zVXkb89F6jldGls5Myuo9f+oRYfndWn02EhFZBD2p/cIHNaW0Z1vuqk7/My 81XyiS4+DaPW7RRPFahypyko Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:17:54 -0800 IronPort-SDR: gnYazxzyuD7vJI6y65OiQIEOjAoLuxQ7OSOHI8h1EhhMdNXKTyY1kifTRpadVCOKuiSIFW6GG1 3JFv6cXLZmoGz49u5uYuVG8v+7lD9D7HeAKh6Zpv5m6oBDvL4CHG0mB1KFvGK38pOqvOBEh19j wfyEPjJp9DR5ASAKh+DC//7ZVGJgcGDvkjo0RkQsJ9rR7WPZ6XScyLAfD493astmQLYKPJzOrN cacd5jF2e0JykNBRFhjD8b09rx8dFpEF5XPSu9ZcSfMhmC58KhO8YPlDF7CR+G/dx9ZWIymwlv sYs= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:27 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 8/9] n64: cleanup n64cart_probe() Date: Mon, 25 Jan 2021 15:32:42 -0800 Message-Id: <20210125233243.5982-9-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The goto label fail_queue is needed to cleanup the queue allocation when devm_platform_ioremap_resource() or alloc_disk() fails, either of these two functions are not dependent on the queue variable which is allocated prior to these calls. Allocate the queue variable after successful alloc_disk(). Return error directly when devm_platform_ioremap_resource() or alloc_disk() fail. Remove fail_queue label and a call to the blk_cleanup_queue(). Direct return from these two functions allows us to remove the local variable err and allocating queue after alloc_disk() allows us to remove the local variable queue so we use disk->queue directly. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index 3bfb010402e3..43482d158640 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -116,9 +116,7 @@ static const struct block_device_operations n64cart_fops = { */ static int __init n64cart_probe(struct platform_device *pdev) { - int err; struct gendisk *disk; - struct request_queue *queue; if (!start || !size) { pr_err("start or size not specified\n"); @@ -130,26 +128,21 @@ static int __init n64cart_probe(struct platform_device *pdev) return -ENODEV; } - queue = blk_alloc_queue(NUMA_NO_NODE); - if (!queue) - return -ENOMEM; - reg_base = devm_platform_ioremap_resource(pdev, 0); - if (!reg_base) { - err = -EINVAL; - goto fail_queue; - } + if (!reg_base) + return -EINVAL; disk = alloc_disk(0); - if (!disk) { - err = -ENOMEM; - goto fail_queue; - } + if (!disk) + return -ENOMEM; + + disk->queue = blk_alloc_queue(NUMA_NO_NODE); + if (!disk->queue) + return -ENOMEM; dev = &pdev->dev; disk->first_minor = 0; - disk->queue = queue; disk->flags = GENHD_FL_NO_PART_SCAN | GENHD_FL_EXT_DEVT; disk->fops = &n64cart_fops; strcpy(disk->disk_name, "n64cart"); @@ -157,19 +150,15 @@ static int __init n64cart_probe(struct platform_device *pdev) set_capacity(disk, size >> SECTOR_SHIFT); set_disk_ro(disk, 1); - blk_queue_flag_set(QUEUE_FLAG_NONROT, queue); - blk_queue_physical_block_size(queue, 4096); - blk_queue_logical_block_size(queue, 4096); + blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue); + blk_queue_physical_block_size(disk->queue, 4096); + blk_queue_logical_block_size(disk->queue, 4096); add_disk(disk); pr_info("n64cart: %u kb disk\n", size / 1024); return 0; -fail_queue: - blk_cleanup_queue(queue); - - return err; } static struct platform_driver n64cart_driver = { From patchwork Mon Jan 25 23:32:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12044897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26C11C433E0 for ; Mon, 25 Jan 2021 23:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0EDB22AAC for ; Mon, 25 Jan 2021 23:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732666AbhAYXgr (ORCPT ); Mon, 25 Jan 2021 18:36:47 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:31658 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732878AbhAYXgh (ORCPT ); Mon, 25 Jan 2021 18:36:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611617796; x=1643153796; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CppnLNFdDfx1rBWN4d8ngNiQ+nl+NvmcK/8f1AWUUzU=; b=ZwRBGpcoeNjZofjLya9MkoYQaMqR4a2V7VK4W1SyAye4gpnSPIr8PPSC /9kKfDdJI6arTX0WhZa3AxjOC4jDpr8fe1swbGClzsn/gruzxgqeobMa7 MbDdV6MmqPBNaZucIAcZE30unlsh3UKjooo/XooSSzcdfIoXuBdRWfIBQ 9UGAQsApJcG5TAoqI7O9f6Jes49M1Yr7K6re+/fIqGu9w7clqzDs1UpCw L+LvC5KWrTt+GxiHrz/1V+zB5I+JKbw+3+8Z/zdtWm2iKFFGIayZfseR5 u7lofw+tFwe5x8XICi/QpyI2YhZj23++g7gQUOPN5ezPbA+2flBH8bBhx Q==; IronPort-SDR: cVvqNKDDJ8GJ4tyOtqxkN3IYm2+vrGQpR/j1OUbeb4bH1IU9NGTKlDpb/qR/T5iPBE55Vqyto9 xQAbsQ/z9CgJIbesPg8hU33oMNohqrNtLT90AWrkl5IJ7dG2mE9/ctl7HMMLViizF4gbGEnrq5 tWLtPIX/0Xkh2bMrIE9rZLPBn/tkiStsd7BlkQ9iEQc1rxK4jF04D+t0EptrE3UmQdBn0wXTOE KeGXymNE+kOqnCF57qhrcdVWxXfz70I0CZVMuEvlR6BFgBlgeHIBGV5zo1u/a2XlsHw+3+NtBi /VA= X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="162741787" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jan 2021 07:33:32 +0800 IronPort-SDR: zUGvYLqzkArXk8NI+57/DPuPlcu+a8U36b7Lkkqa1yOXM20DxcE2xF2/GlLlzCvY6g7NzdCufU YpBGQE7lrAaCI5eEt1LdZqZx5hc0I5Louk55JzXyr5ujcWfBUNohRmgU0mPwBDsNOlX2mNJp1p rNVc2Rwo9KzVTCuycUFJtE9A6flDKDPLcdYIUoayiz6UjMEd3535a2aM6DSYGJfSdWKTqc4221 ksaAHhnIjWAA3eT9+tlAHHHFgyILC7rpYqLnmORCEDQZwS1r5SZYFjEfltWbKgz/x63rSUbmJ5 GbhSJebraviC+4Vulc2aBFg/ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2021 15:17:59 -0800 IronPort-SDR: xE02mVV0/lnc7WFzb1tdGlLAjo63FILGTAmOCBz1cYBWPXP+HcOiX67J4oOSUhTN9WyIih0CSX h/zWzIE5F4XCEclSBCSiAsPx9NWyzOIR7QqRU8cEu09v8/JaGbJUMgQay7XWAHwnG4WlmUtgKx cWtVhZdjLlblxUpYNi0nSq+pWmxAlJWzmmE9SrT2bQ05JBKxIyIqYij2JPLoYx1y9rGBWUpsi0 q4afLyWaX8XaMmGxZpOs1r0pqxZnyR/Z/xyjtT5hmcNeJq9vB6vLViMaIVHO2Grnz/fBhJpQ2u v/Q= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jan 2021 15:33:32 -0800 From: Chaitanya Kulkarni To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, axboe@kernel.dk, linux-block@vger.kernel.org, cand@gmx.com, Chaitanya Kulkarni Subject: [PATCH 9/9] n64: store dev instance into disk private data Date: Mon, 25 Jan 2021 15:32:43 -0800 Message-Id: <20210125233243.5982-10-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> References: <20210125233243.5982-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The device instance is declared globally. Remove global variable & use the disk->private_data to store the device instance in the n64cart_probe() and get the same instance from bio->bi_disk->private data in n64cart_submit_bio. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Lauri Kasanen --- drivers/block/n64cart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c index 43482d158640..47bdf324e962 100644 --- a/drivers/block/n64cart.c +++ b/drivers/block/n64cart.c @@ -30,7 +30,6 @@ enum { #define MIN_ALIGNMENT 8 static u32 __iomem *reg_base; -static struct device *dev; static unsigned int start; module_param(start, uint, 0); @@ -89,6 +88,7 @@ static blk_qc_t n64cart_submit_bio(struct bio *bio) { struct bio_vec bvec; struct bvec_iter iter; + struct device *dev = bio->bi_disk->private_data; u32 pos = bio->bi_iter.bi_sector << SECTOR_SHIFT; bio_for_each_segment(bvec, bio, iter) { @@ -140,11 +140,10 @@ static int __init n64cart_probe(struct platform_device *pdev) if (!disk->queue) return -ENOMEM; - dev = &pdev->dev; - disk->first_minor = 0; disk->flags = GENHD_FL_NO_PART_SCAN | GENHD_FL_EXT_DEVT; disk->fops = &n64cart_fops; + disk->private_data = &pdev->dev; strcpy(disk->disk_name, "n64cart"); set_capacity(disk, size >> SECTOR_SHIFT);