From patchwork Fri Jul 16 14:33:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshitaka Ikeda X-Patchwork-Id: 479507 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=-15.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 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 36B2FC07E95 for ; Fri, 16 Jul 2021 14:33:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15EA2613F9 for ; Fri, 16 Jul 2021 14:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233212AbhGPOgJ (ORCPT ); Fri, 16 Jul 2021 10:36:09 -0400 Received: from mail-eopbgr1400087.outbound.protection.outlook.com ([40.107.140.87]:40662 "EHLO JPN01-TY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232988AbhGPOgJ (ORCPT ); Fri, 16 Jul 2021 10:36:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TYAgx3avoHvpMe/xO6ts7g16rJvDhNDEAQYNSgsniapdGNpaBV5POv/6qwreBR4VsbmsMccG7i93Z1jRXvvufEmmwUVRUXOvbWHjs04wyV8gdu2Eni4W3JtDXSuTP3RuWtg7dvqd8QbhPyhi6uDQq/nWmk8P9jIzl3KTCOOYj2FJLh09RHE1bOWZPbBPbtPfipEAKYBkHXHZGPuxK91jrPnLZakB94F13/SNiXAWwo/pGI2bc0wVmPy91i9TaxxQ2JR+hnCfTUykM0IcEo7hLGIzRCJkjOoww+vkczM+zqusOLBfOlY9e8/dNNUbvHt+wZAKDQnAcAgCpIy9JSC+cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VrqjxWwkfDwJ8whKfagaYu8Cp1eh7vkiW7WJF8hIjg4=; b=lwBuXJkhGjq9JxQbZeJGWoro7L/iT5sowjA2IBQcNjxd1VqqGlxj7+iLiCFy5kFWWPgzS3H+NL3gOqs1eh1pqYIYvb223xj84neh4uZcwqhsHhn3rFxKr/VJzpfea8YMfMnrAsibIInDzztNOKHUgM4F+Aip3picJgnb2kO7Zxmf0ZyqkgzSDZuZ4cvr5ENnhw7FTEhnlMaQrgXW1evYoHMgbTo/cc4qXPpKzRNiK1mnkrOHGBjslk66idOYPOir9DQoXzC785+IJ2HpxAzjCM6aLcmvufM/wHuc6Nri3KedF6WUZ/xuJ2ggGDx3VJ1MBaJGql6GM9vLXSjEU4OkiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nskint.co.jp; dmarc=pass action=none header.from=nskint.co.jp; dkim=pass header.d=nskint.co.jp; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nskint.onmicrosoft.com; s=selector1-nskint-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VrqjxWwkfDwJ8whKfagaYu8Cp1eh7vkiW7WJF8hIjg4=; b=Tl3Aa04b+3XPPK8luJtrnP062m22ZPL/Zwtwoxv4HglDIELffuv6BMjGyRnYF58JbefycHK81sV6xaRM9dYs5dpo7D1uNZsF14TkEVl7rbsgFO65HMesbHDwij0YXMFs+jFimN5kvORwaaW5To4BJxWwQegTcRziOajmaoDQ+bI= Received: from OSZPR01MB7004.jpnprd01.prod.outlook.com (2603:1096:604:13c::9) by OSBPR01MB4278.jpnprd01.prod.outlook.com (2603:1096:604:76::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Fri, 16 Jul 2021 14:33:12 +0000 Received: from OSZPR01MB7004.jpnprd01.prod.outlook.com ([fe80::94dd:c412:338:709e]) by OSZPR01MB7004.jpnprd01.prod.outlook.com ([fe80::94dd:c412:338:709e%5]) with mapi id 15.20.4331.024; Fri, 16 Jul 2021 14:33:12 +0000 From: Yoshitaka Ikeda To: Mark Brown CC: Yoshitaka Ikeda , Philipp Zabel , Pratyush Yadav , "linux-spi@vger.kernel.org" , Masahiro Mizutani , Ken Kurematsu Subject: [PATCH v5 1/2] spi: spi-cadence-quadspi: Revert "Fix division by zero warning" Thread-Topic: [PATCH v5 1/2] spi: spi-cadence-quadspi: Revert "Fix division by zero warning" Thread-Index: AQHXek+BBlohqeZEwEyahAOjis8lOg== Date: Fri, 16 Jul 2021 14:33:12 +0000 Message-ID: References: In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 authentication-results: nskint.co.jp; dkim=none (message not signed) header.d=none; nskint.co.jp; dmarc=none action=none header.from=nskint.co.jp; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a08c444f-f5cd-4c73-7737-08d94866a40d x-ms-traffictypediagnostic: OSBPR01MB4278: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:93; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MlZRIJx3p8lIRrAMAUG8f9Ut+wpUB8dZano5WXImBel0Y4usZ8rFoBpcOb0Q86rHruL4cnUD/atWkraBwpH1VbkymODK1HM39p9k1j8l0qojNXpGBbOW8b8ip+DMWE1/GKb3+O5Nj5lgRyXjsHpVBCZ/KNhdMtSk03Qc0wiL0JPFVQ0QRhdNSoDzHsgX6hFmkHDzYiOsJhxK9dRMLDiciPxZBNlA2m3f6Gp8kKlUyY86gfv0Sk59FrUh+Ufp8pMcVTCE3vomMaKLbgoIepOhhsfrjw/qM8QyE5ZrzbgBuTp36IOpdpwicAK361E0xJUKMzUd4Ld51umDfu9kykyA/WlY0D5G3JcDTkGGhWFrCsLVqFeQlbrBTZ9TyDxCH58ZiuFxkngq0H1RcYUFPJDeLZ4jYhDvAWWGjzqb6g8cMpqIHJgZqnhvoWOKPi1in+nQzI2glWi9Ukvjj6Xv15YfYmwltDy+By6VV19a6w5B94+mpymi7zFw0z5/tHRaU0fZ9BmeSHBS1RqC//+snBBJ3gsOS02ss8F7QyrFg5Qr87XGR2AgSBHSFIyY9l9dRUnSQ+dbZb+jfkwoSjbfcOS4kw2e7r8P0H6fdlY7/drwQFyWkjBvNPcs6YnWJMfZ/VeAqKy3M8VqQyqQcE4UZS63g7tNgPzCsr1G6GactXub4dzgdl6Fw1icXPYMO4uJI7lye+FFU9+6qJ+EFvOLBuEYTHooJ5to+8qQ/7XV11CXzCU7q13zItf0PG1kQtrS1UhYvwMvsrmPQc79+2Qe6FbHUw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OSZPR01MB7004.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(346002)(39840400004)(136003)(366004)(376002)(122000001)(38100700002)(6512007)(83380400001)(6506007)(6916009)(54906003)(31686004)(36756003)(31696002)(107886003)(8676002)(86362001)(8936002)(2616005)(26005)(2906002)(66476007)(66556008)(64756008)(66446008)(66946007)(76116006)(6486002)(316002)(4326008)(186003)(478600001)(71200400001)(4744005)(5660300002)(43740500002)(38070700004)(45980500001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?b?aWNRaDBhdzdwVXJR?= =?iso-2022-jp?b?UkJ5TVRSQ3lSckNtd3VvMTZ4andoem9ZWnNHN0VZVGluMDI4?= =?iso-2022-jp?b?NDJWbnQ4MmQ0NkJUaHZpcjE5VFIrZVdkczBWbFJrSVd0NDFy?= =?iso-2022-jp?b?RWxLVEVXSmJuK3lzcnpYaHFxUkxYSi9YVHVvS1piUEdpVk9N?= =?iso-2022-jp?b?Nlp2YmRmU2doUk1uR0g3NEE2S2dsUEJVbTBjc1phMHNvaHRr?= =?iso-2022-jp?b?cHhvTEVJMWtYbnI5UWpnRmVJTFcrNUpFSXIraWN3Z0VXSHF2?= =?iso-2022-jp?b?Q1VzNjNhVFVmMXpHR1ZVeUNlVm16Z1dqVitHdU1QNFRVbnRw?= =?iso-2022-jp?b?RkNlQzFmcVZ1UTNNV1ZoYys4V3ZhVkc2TmxPeEUxSEY0R1hn?= =?iso-2022-jp?b?eDBjSFBOVExSZ0w5di9BSlBQUmxyQWVKYk5MdGIrY1lteURo?= =?iso-2022-jp?b?WHJpZ1BKQWhTL05hVzBSbTcwa1hWdXpzS1EwUWlEOW1sdDFT?= =?iso-2022-jp?b?VkYxOG53cWkwSTMrSzFLMXdKODRMSURid1pOZytSb1h6K3Vz?= =?iso-2022-jp?b?bElSRG5HdnNlTWpLSHpDNzZyTXJaV2xGcUlJREt1NjFnNDha?= =?iso-2022-jp?b?YUNXWWpMQ0NVbE42V1VPVjRKa0FKNHZub3dkUVRpOFRzTld5?= =?iso-2022-jp?b?amxncnhSKzVVSHdYaFAzY0x0QXpTRHRVRGFIWnJ5ckt2eUx2?= =?iso-2022-jp?b?MnBSUkI4SHp4Y01vdEl5UElVMlFETmxINzJ4bWpvdGRBc1JW?= =?iso-2022-jp?b?cGRUc2JDTzlYUUVvVmN0UmpKSkpKQzE3ai9YbVh6TEVmSWRH?= =?iso-2022-jp?b?MjBmQzhLaTMvTG1CbXpIUHRLZkpHSVJxUGJpblhDK3U3cjNx?= =?iso-2022-jp?b?TnNUVnEvM1VOSXpPdDFkSFJ5dW14czBYYW5FSEo1Uk91MWlp?= =?iso-2022-jp?b?alpOcStDOUY4SzQ1ZnQvb3N4NzFOU2ViMndObjJzdnowSTFo?= =?iso-2022-jp?b?a243R3hrNDd1SlE2KzIzVU9XbjBBMGF3TzI1eldNd3FIUEJN?= =?iso-2022-jp?b?STMyVzNzZ1VmZnFTSDQrbFJERUk2YUNmai9XOHl4eGpMZC9F?= =?iso-2022-jp?b?VWtXYU5UTFZrcUR0RC8yVHZVbU84TEFOeEh0aXFzelVTYXdx?= =?iso-2022-jp?b?UmwyZWVxdXVocXNGdkJoWDhLY0RMOUplWlBrWU5QUzZPYy9O?= =?iso-2022-jp?b?NEovamNxVHhvUzMrRzFrbWQweWhkMklERm5KWU1jK1prZXFV?= =?iso-2022-jp?b?QWgvOVZuNWVRWWFZS3Z1TDVEUEhnNEpSRFR5b1FQNXA1cncy?= =?iso-2022-jp?b?NFhyVGNaRThwblZtWURJdStyREhyaGU2S253ZGptUUJnU1VN?= =?iso-2022-jp?b?eFZzd0VUK1dxTVBXYjhpT2ZRcG4rV3Fxb3c3N3JDWG1hRkht?= =?iso-2022-jp?b?SjRKQkJjUDlCanp6ajFBVmZaNTIvY3NsMjRJVkM3a0hwNm1J?= =?iso-2022-jp?b?QkQ5M0NGRUEreWVRZFVHMXNsRmIyZkwwd3RzczM0SDAxQmtT?= =?iso-2022-jp?b?aityNWtrUFpoTVc3T21vT0pnV2cydVVrVFdqWWhTSGVuWHVT?= =?iso-2022-jp?b?MDJXNlN6WHY1Vk5PNlliOThCdXB0TjVNZWwzeEU5OCtOS0lp?= =?iso-2022-jp?b?cUYyUnVFTTJBV2RhcEdqL0tjc0xsRHBRVExYamtNNk5YS2V4?= =?iso-2022-jp?b?c054eHFPWkdVWnMzWjRLVlVjdmlQbnpDUXozazV1T1BlcnZE?= =?iso-2022-jp?b?WkZuVFRYOXdsMXUwSEg0alU1ZEJzRjJPcDR0RmJidFU2K2dk?= =?iso-2022-jp?b?UWoyOExpOWF2NU11M1ZnNGZHekRXOWJjeUtQNnMxRmg4aWpz?= =?iso-2022-jp?b?NGcrK213Z202bmNPaTZ2b09YdmNHQUloRERYS1lyakYyNVBN?= =?iso-2022-jp?b?ekgwYUJxSFdJampNM0lmanNsNFNRV1Z3VWk0cEVxcll5V29E?= =?iso-2022-jp?b?WjgrQXNpMkMwSmpjdFA4RzRFeG42YVhzeXViKzlHeFd6N3VS?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nskint.co.jp X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OSZPR01MB7004.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a08c444f-f5cd-4c73-7737-08d94866a40d X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2021 14:33:12.4899 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 727455a2-9822-4451-819f-f03e059d1a55 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5VHzAFDj5e1yX14c3G9iHonxKk+gSmQiizVpagXxTyDWbcysS8dtg+QRrZxEzHrD7I68ZKMJQ+vFqB1A24T3Eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB4278 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Revert to change to a better code. This reverts commit 55cef88bbf12f3bfbe5c2379a8868a034707e755. Signed-off-by: Yoshitaka Ikeda --- drivers/spi/spi-cadence-quadspi.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 13d1f0ce618e..7a00346ff9b9 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -307,13 +307,11 @@ static unsigned int cqspi_calc_rdreg(struct cqspi_flash_pdata *f_pdata) static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op, bool dtr) { - unsigned int dummy_clk = 0; + unsigned int dummy_clk; - if (op->dummy.buswidth && op->dummy.nbytes) { - dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth); - if (dtr) - dummy_clk /= 2; - } + dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth); + if (dtr) + dummy_clk /= 2; return dummy_clk; } From patchwork Fri Jul 16 14:35:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshitaka Ikeda X-Patchwork-Id: 478689 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=-15.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_SANE_1 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 4B6D9C12002 for ; Fri, 16 Jul 2021 14:35:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2FFFF613F8 for ; Fri, 16 Jul 2021 14:35:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbhGPOiK (ORCPT ); Fri, 16 Jul 2021 10:38:10 -0400 Received: from mail-eopbgr1410089.outbound.protection.outlook.com ([40.107.141.89]:46018 "EHLO JPN01-OS2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232988AbhGPOiK (ORCPT ); Fri, 16 Jul 2021 10:38:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fal5tWAMS0lY/iRy2t3gZT4GKnF92kV9Aqu0Xmx8cyOvSwIWQ39p3cyrF6nKKeoUkLuaRk+fQfg7rcvbfoXSq62QHLy3ezzJCJ8E3ZeYMKsZdklTrCvqYnkuUxj1U+cpNwc0Kn54GsyDegiyLRSChYDQyMhO/6tmce2jU3uFowGQdPUc+OCd/tucKMUc72zzT2nnwd6Y2sbUvkZJ59Bn5oq/vohEpNSICpepcJ9X0UlY9smpRozXBLm4sF+mO1J/V1kpayxVVQLEb2cUEHTNktXo4WXavKVCx6DP/4+Fp5lR0TmtxMmRhWaykYtNgQmZbJZMnDlgQAAtCDpKBX32fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wOoX0RERd88j38vnZ45RHCQXZXrL7etzrOmDg0pIZug=; b=YH0Npxaok0FcF436q4meN3anPAWwXZU+1ab80Jj7TayO6MYV8AdWWrzmWgk1SEcns7bCEBbnKo3VdyO4Ym4603ChsyAfqvl1pBds4Npfa6OjY+5wowTc3SvnnhmCWHCNamS4C4RPjiBHq/TmKDg5JSItbC3mRsruowZssmDWJitS8laGs6ULzec8/g9ROImAfPnv1sIo5jvuRt7AKDYWhu26vruyZq57IV4wWL2Mq6WTpUpYz27LS0s/g8q1UADmxHY1JYRLq1tmJN9uP66s8sYUMdq0ziJk7pKzbNsNmsGR5zUZZcChZmrL33EO1IOUGXI4NpNl7m1aEUake2BLJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nskint.co.jp; dmarc=pass action=none header.from=nskint.co.jp; dkim=pass header.d=nskint.co.jp; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nskint.onmicrosoft.com; s=selector1-nskint-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wOoX0RERd88j38vnZ45RHCQXZXrL7etzrOmDg0pIZug=; b=PqGNkAGmZRRqaCKNjS1tNt7hDWaN4tcjnbNCBEqfuwRBFtmzRmvd87xdyLvxxDaIejeOI9EAuZMZgLHQrq2a56ag6ow9ZtvVs7XqHvFdxrk5aDuJjy9TNRPNQaB25a3qKhgKvOqtHB9wTlG8pQNmCxZxfLgotcJSSjRIleJ1lGE= Received: from OSZPR01MB7004.jpnprd01.prod.outlook.com (2603:1096:604:13c::9) by OSBPR01MB4278.jpnprd01.prod.outlook.com (2603:1096:604:76::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Fri, 16 Jul 2021 14:35:13 +0000 Received: from OSZPR01MB7004.jpnprd01.prod.outlook.com ([fe80::94dd:c412:338:709e]) by OSZPR01MB7004.jpnprd01.prod.outlook.com ([fe80::94dd:c412:338:709e%5]) with mapi id 15.20.4331.024; Fri, 16 Jul 2021 14:35:13 +0000 From: Yoshitaka Ikeda To: Mark Brown CC: Yoshitaka Ikeda , Philipp Zabel , Pratyush Yadav , "linux-spi@vger.kernel.org" , Masahiro Mizutani , Ken Kurematsu Subject: [PATCH v5 2/2] spi: spi-cadence-quadspi: Fix division by zero warning Thread-Topic: [PATCH v5 2/2] spi: spi-cadence-quadspi: Fix division by zero warning Thread-Index: AQHXek/JTWLD5iZQsU64LL3ZCMDkDQ== Date: Fri, 16 Jul 2021 14:35:13 +0000 Message-ID: <92eea403-9b21-2488-9cc1-664bee760c5e@nskint.co.jp> References: In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 authentication-results: nskint.co.jp; dkim=none (message not signed) header.d=none; nskint.co.jp; dmarc=none action=none header.from=nskint.co.jp; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7de8799a-ddb3-47f5-6bf7-08d94866ec2b x-ms-traffictypediagnostic: OSBPR01MB4278: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3EtXWmNq+66GCG2++RS930YqhJA0DPQxH9nHzn3n/8OUAB17ZRUuzcBwGw4Q7M1f5Zuy7LAp16CcoSvp7+luu68MVaet3fxl0G97pVAxnPf6YSqMwE2ElFSnTrTEbRZKql7YNMrQBzT+0LC7I99443HuzmICF2x/ssvEsvpaSUNy3zAeL1lSAQRlW2pqxyNQaG2IYB4lnk/Cc7L3/YtuR9DxRFBP2dt+PomMPmy5qDIm9MFk4GVsBAXxe5apsKETGMyA0zgifLpCkWL15/chGFMpjFrfr8izOsnUTrCvDuoXjBVqp9DXFK2libT/5tZ3zVOZ5JLxjnqehizEzBNe+UJ8lia1O2KV9VoKgKOSOYCHoTmFEcl4/4mjL3aqM4lU5ew1x+gFs4kIyyM5NC4ThWBbkOx1orRDNafJCtelYk9nZ7/sPRNSTmj76zxqzNIWe94QoD8e/NwHyU2qTsOrymknXEsFHjJw+RVax8DM+LetyfJhWHH48oZE+cwqOhsx3+OtTTDF8wMEEpXLdYTZcUbcr+7b4wKBzan6lXBf4FSEnVzmnnPRC9DXXmuv5Rt06khbHsDT7aFmzMjwnGNXpK0TetJWXKB2r4x6z1dCStTHkXzdboErMrEi58QMvxSvVJxjulpZSyU7xTqFQvdRfc1O6ObEJrpcWgLK+4IgTVzpkBOrbt1QQz07NGeAoeYoeCnbw1FSd5Hgw4gNo/GlxAVNjg1qH257UG0JU2YhjA62vJ1zZpFWTAL+nxUyWZLVgYMiIJiRTPW9cDVusxfNKg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OSZPR01MB7004.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(346002)(39840400004)(136003)(366004)(376002)(122000001)(38100700002)(6512007)(83380400001)(6506007)(6916009)(54906003)(31686004)(36756003)(31696002)(107886003)(8676002)(86362001)(8936002)(2616005)(26005)(2906002)(66476007)(66556008)(64756008)(66446008)(66946007)(76116006)(6486002)(316002)(4326008)(186003)(478600001)(71200400001)(5660300002)(43740500002)(38070700004)(45980500001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?b?QVliZ1l1UExRTlVu?= =?iso-2022-jp?b?V0NrbkdwZG14N3JvL3JXbXZHcXE0YTkyNnRMMlcrMWJsOVdq?= =?iso-2022-jp?b?aTcyNmFGa21EbjE5WE1yN3VCS00vYVk2VDdKN1RrY0tGbXQ1?= =?iso-2022-jp?b?OFJkSWFobU0zSTF5WXdQb0pBS1VFeks3N2lnaldMcldSTVdK?= =?iso-2022-jp?b?VyttdXdhVFZmN0ZqZmxnNGRkMmNtL3NRZmtnc2pVNHhxeDZp?= =?iso-2022-jp?b?QitrK3lDMnFIOUowUHFoZWgrT3NRbDRIbERmUjkzZ1BDTG40?= =?iso-2022-jp?b?QmZLL2YyRWV4ZENBdEhJRGtCR1lNM1BVZ1Z2MWE2Q3lSVlpM?= =?iso-2022-jp?b?V0hJdGdncnQxMkRoOFgrbGNBd0NtbEkreDZKWDNLTFNzV2tr?= =?iso-2022-jp?b?SFpLOTdoNmxGZmx6bmhoWkN6TVlHQmpRNlNsUU5UeURiYUNY?= =?iso-2022-jp?b?MkR4My9wa2pvMTA2WjdEYThJWTNPQ1FDT1BHVHFyWmg3am8r?= =?iso-2022-jp?b?VzZiQ1B2YnNZYTFzSDdOSkpmQWZzcEtLeTdvc0tiVEo4OUpL?= =?iso-2022-jp?b?c1Nra1VhaWFvOW1OWmlNaS9IQkRmRm5xTHE1QmF0MStDTFNt?= =?iso-2022-jp?b?V1U4eE9SeE9mZXdGTFh3WFJKdWE0ZnpuY2xFN1YyZ0swejZz?= =?iso-2022-jp?b?V0Y1aUlLS1haaENReHl1cTMwcmtkTUFWM0xQT3BvU2FCMmFI?= =?iso-2022-jp?b?T3p4NnQwMk1odEdHT2NobWNaaUJVRkMvZ01QQ2lERFcrU0Fw?= =?iso-2022-jp?b?d3h1Z09EeTdOQkVuMFAwdUFmNnBIenFaN01RUUVNYTVhZmxR?= =?iso-2022-jp?b?dVc0Mk9jdUVzWW9PcC9FNUVDRUU5VmxnRFJQcEZYRXZPWnVF?= =?iso-2022-jp?b?THo5UFZMLzhJcy9vMm9iaVEvMUkzTEtEblgyd1NKelNLTmd5?= =?iso-2022-jp?b?WEg5c3FzTE5sNWxUWFdqVkFFdjRqK01tSTBnKzRYQmY3dHRK?= =?iso-2022-jp?b?NHlBUUJ0bnUzUk9VM2JZT1NLMm1DY1h4WXUzdnlTLzl1Mnkz?= =?iso-2022-jp?b?UENNczFubkp0d2hHMmpNcURhempIV3FOaXlzVmZhdm56QVVw?= =?iso-2022-jp?b?Zk82MEs0RnBjVHVCeVFYbTgzL3l2UVo4ejZvcU5PZVhXeWpK?= =?iso-2022-jp?b?UDhENWtzdXdiaWVCOGMwVHhOSVk0cWVnWmFaUTRPbng1aDNJ?= =?iso-2022-jp?b?VVZjQ011TmRLM1VrY1VjOERmZXNyQTR0cHJBaEw1UWtBbVlG?= =?iso-2022-jp?b?NFJWNUZZMWpKN0o4d21Wb3ZzZkh4U0hqd2ZSOWtXb0ExYzUz?= =?iso-2022-jp?b?KzN2UjNvbXFzbXN5M2pUMy9lUHVKSm5sbDBlMVh5NUtRZXVm?= =?iso-2022-jp?b?cnl5eUxsUnJNbUtMVnZVTmEwb2VBRk5yejg0TEMyNTBITzNz?= =?iso-2022-jp?b?WFJKOU9XMitrczg1cXFJUWM2Y0s4OU83Y09jWWFEVjA5ZnAy?= =?iso-2022-jp?b?a1dSYWNPSU0zczh6UTQ3UWo3MCtHVEpKNml0NlJNbFg0T0t4?= =?iso-2022-jp?b?QjZCLytkeXRrcE5QMXpuZklvWUk0czc0QUJZL1k2QjZXTHZX?= =?iso-2022-jp?b?UFFFUER3WlVETFpXcW5kQWI5Qno1Z3pramlqZVJVVUVMV2Vv?= =?iso-2022-jp?b?eUV5RGpDck1MZ1RBN3VtWDNCZHh5WDFMbUZKOEdOWkV2Qldw?= =?iso-2022-jp?b?L2ZPbUlTWFRTeUZld3ZUOXAwekRTZWNGaWJOeDVqSzIzaVVC?= =?iso-2022-jp?b?aHlPMmxaM0w2Uzh1L0tYNjdOVHc0ZmVLejRxYXg2ZmZZc01q?= =?iso-2022-jp?b?VTRCRmFmaktJNTdwQmxGQkd3SjhHS2p2YWpUV0FYbi9jSFpQ?= =?iso-2022-jp?b?bmR0NHhtUUhXWkNLSUpsYjVsa2RqMDU4QUcxNXltOHdvbWdJ?= =?iso-2022-jp?b?Y2Z6aXRXZlIwYmZIRjM2VXpjYUlrSnlaNnlGeFl1MkswVFc5?= =?iso-2022-jp?b?ZXByN1VvamlXMk9LUS9Bb1EwWk1pRHNlQk1QZU5EcWVSMU9J?= Content-ID: <1563C88FFEACCF4BBEF972AD0151C488@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nskint.co.jp X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OSZPR01MB7004.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7de8799a-ddb3-47f5-6bf7-08d94866ec2b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2021 14:35:13.4902 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 727455a2-9822-4451-819f-f03e059d1a55 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NkVbphohn+y7FJ2GUa6IqDrUKJFquBtsvwGPLtU1+A1/QlLQegVZDpcq64km2wWa7Uc4C9e/fjL5Ajqt4YYkAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB4278 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Fix below division by zero warning: - The reason for dividing by zero is because the dummy bus width is zero, but if the dummy n bytes is zero, it indicates that there is no data transfer, so we can just return zero without doing any calculations. [ 0.795337] Division by zero in kernel. : [ 0.834051] [<807fd40c>] (__div0) from [<804e1acc>] (Ldiv0+0x8/0x10) [ 0.839097] [<805f0710>] (cqspi_exec_mem_op) from [<805edb4c>] (spi_mem_exec_op+0x3b0/0x3f8) Fixes: 7512eaf54190 ("spi: cadence-quadspi: Fix dummy cycle calculation when buswidth > 1") Signed-off-by: Yoshitaka Ikeda Reviewed-by: Pratyush Yadav --- drivers/spi/spi-cadence-quadspi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 7a00346ff9b9..d62d69dd72b9 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -309,6 +309,9 @@ static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op, bool dtr) { unsigned int dummy_clk; + if (!op->dummy.nbytes) + return 0; + dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth); if (dtr) dummy_clk /= 2;