Received: by 10.223.185.116 with SMTP id b49csp2618720wrg; Sun, 25 Feb 2018 02:05:25 -0800 (PST) X-Google-Smtp-Source: AH8x224U5or423/0hSxkAR6DAMFxK8BAKV55be9GfSvV6zhofpeHhFugklLnXW+74wXo+YRRo95e X-Received: by 2002:a17:902:6884:: with SMTP id i4-v6mr7159679plk.259.1519553124932; Sun, 25 Feb 2018 02:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519553124; cv=none; d=google.com; s=arc-20160816; b=EhdivCxEPCE00L9FGWIpBjb8XIqaajjvQcHCYgbFu6Tdk7DX3A3cXlc/Es13Q6eyIT Ntnt3zOkB7VmPSUJ3Qr3LBA7haYvQP/gorJ1KzO5+0fOY58egv/9JnLvUUkSrPNM9Nyw ZvD8ET6UC7Es0I5/jdqw8X4xuLR5miStjJNvh52kF4CVjIMTiSgDcLlgYPXxIbMDVV5Y J41EPwCsYn91SZX9i3AM0grsY9t05E0S83rSt6VhqBLVjFGevEz1CyqPUncU1caTLxgx y4XaI66ZKYMd7FJsCDnQ/4BwkrOBOi2sc4Zj8GnqjaeC3MNuD4P0OnkthpJ/LjmPFPyr lynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=6aszUij4LoBT/Dm18V1qdijQoQb9s5LChC+I8/F5ijU=; b=Vd5U87pIr+XJhgSH8SXgHzD358OZHnUCgBJlc5wPAEvWb8W5wC3rVlegOqDH/V2Mxa Hg5kiqN6EEplIJQ1dpckFN+ItahPTMktLlNaeqJKAvXn4/V8sk8zzsEu+IgT2p4RfhK+ Gz5j57ar817iitc0VVcstm6degVjwXH9NvVFWHRhVFN2Vleg1h8c7NY9VfOYJAgvWQMj teMl7CwlMcKX5ycrGij01YzaVcmlu34SuGLFmcBRLbMFXG2+WhE6eagxSmPCDJzMJ2eV wAYRIT/XzUMrnod4L4dvvVuddjBUTye1M3SZXUb9VZ5QMLlTny2+1CuO1tlRd08gzw44 ZR/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=U9epWDWe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z124si4056241pgb.811.2018.02.25.02.05.10; Sun, 25 Feb 2018 02:05:24 -0800 (PST) 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; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=U9epWDWe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751762AbeBYKE2 (ORCPT + 99 others); Sun, 25 Feb 2018 05:04:28 -0500 Received: from mail-eopbgr50059.outbound.protection.outlook.com ([40.107.5.59]:61172 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751653AbeBYKEW (ORCPT ); Sun, 25 Feb 2018 05:04:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6aszUij4LoBT/Dm18V1qdijQoQb9s5LChC+I8/F5ijU=; b=U9epWDWengg2qAGQ2jvR9lQkAgG2NwCFvxQIRp2okIi+xtSJJxAil7U2H6wI6OzeY5WIXmW1UvhHOWe/kCF9GhIpF7vxwa2gwbTRxtau7I0FMHb3aKf/BuheEQACKMehGn7H26Gw6SvClPiPxxCBAZ7ja42izdB5mDZRoLB34WE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=arkadis@mellanox.com; Received: from localhost.localdomain (193.47.165.251) by HE1PR0501MB2459.eurprd05.prod.outlook.com (2603:10a6:3:6c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Sun, 25 Feb 2018 10:04:19 +0000 Subject: Re: [net-next PATCH 1/2] mlxsw: spectrum_kvdl: use div_u64() for 64-bit division To: Arnd Bergmann , Jiri Pirko , Ido Schimmel Cc: "David S. Miller" , Wei Yongjun , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180223131540.1065413-1-arnd@arndb.de> From: Arkadi Sharshevsky Message-ID: <7de58656-c772-c13b-5a35-b6065adc2128@mellanox.com> Date: Sun, 25 Feb 2018 12:04:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180223131540.1065413-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: DB6PR0301CA0057.eurprd03.prod.outlook.com (2603:10a6:4:54::25) To HE1PR0501MB2459.eurprd05.prod.outlook.com (2603:10a6:3:6c::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6ecf822b-d11c-4d60-ee28-08d57c372364 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:HE1PR0501MB2459; X-Micro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uPh2VrjqFbnUv1sEHV+fcIwyAC4B6qzV5UCssD8e3cutxzfHJHG39OWt/H0WKxSGfA5vvPjkaKwzyWe0iXko3eWvNC28k8WZHWIF0ylZHG9MRGc2eUCUDeAKcwgQHte9l/Wf0geMMhFDR8XHjthjk6wZ/VAy0riC3ofuUTurVwhegSK/SFAWo7VgGXeRml2OuXmzbApiZlJX3IEpO5u2wWaqxE1bZW43mF1o28t0SbUkZ4T2f8KYMxfb2X8C/rYihQCSVQScAUo8fp1IkXLnOTlGb562FKD8FkIVL01gVdSOo0qwF6OlID45KuIlomnnYbe0USpeIXuhKmoV6QjyTTJLOXjBDM7WhzZ093AALWWfEqoMM0Mv4bvDhooN;4:FR+ufb2EMvur4ck83En294jHK726w/rbV2/zNRDn/OGaTqV81/xZSwy1QJaD+CwcfNI0wsqRyT7eMvCncpsBfaSOPqvi4Fzmnb+Hk/58bgknFISjiUyYqSdfm5qFX+dQVk1prJpNv4qcN0ZiHHde0/CWhD7XgbeQP4DUwZcOSyTrceruqLW2tajX2WWuzprfjTRCK6w1yY+LWhvXf6TBkmS/rswhu0OGaRnFhto8sAr1M4ty2ZTU1RBoUh+JjSlj5cxf7cJKf4fpCv6z/64xjg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231220)(944501161)(52105095)(3002001)(6055026)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:HE1PR0501MB2459;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0501MB2459; X-Forefront-PRVS: 05947791E4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(346002)(39380400002)(396003)(366004)(376002)(39860400002)(189003)(199004)(97736004)(66066001)(4326008)(6666003)(478600001)(65806001)(65956001)(47776003)(31686004)(36756003)(229853002)(76176011)(2486003)(52116002)(23676004)(52146003)(86362001)(8676002)(6486002)(6116002)(25786009)(3846002)(5660300001)(26005)(2906002)(65826007)(6636002)(7736002)(50466002)(68736007)(16526019)(305945005)(386003)(59450400001)(53936002)(6512007)(6506007)(316002)(8936002)(186003)(81166006)(81156014)(2950100002)(106356001)(6246003)(31696002)(230700001)(64126003)(105586002)(53546011)(58126008)(54906003)(110136005);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0501MB2459;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA1MDFNQjI0NTk7MjM6V3BzbTN2cU5qdnZDNlQwLzRnNnBQV0Q4?= =?utf-8?B?OVRISGVLYWtWeXJ4b0Z1TTVheEFkekNKL2pwNlJOYmpPZmtueGRzR1FpRHg2?= =?utf-8?B?ejZ6bmltLzJvdmNPMzZVeUprZ0RUYzVRdFc1NWh1eTEweDR2WExjVGpTbjMr?= =?utf-8?B?WFIrMG1QT0lNSi9aYjJzNTBKSlVqTlVyWk5ZU0hnM2dSaXhwc0k1ZWFrbVQx?= =?utf-8?B?M0ozalpKUGxsbXEvTlM3dWE1MHlMa256cURqeXRSemdXc1JmbCs1eUMyODN4?= =?utf-8?B?RDlMWk5ibi9udzJkN2dRWTN3cmE2eDlVNU81U0UxQU1nandQYnc0VjFPYVR4?= =?utf-8?B?SXNBeDlwRjZxVEhUM3g4clVhdGJXcW51N2JoeFRUcVBaUFUwWUF5QzB3Y2FX?= =?utf-8?B?cnVRKzdGRXk4VjhIeFdGblk2T2ZxNFdHMzFLWW55VzBLekxqaVptQVRFSytQ?= =?utf-8?B?cEJxd2FZbG45VWtWa3liNmtmWmcxNDJhdStHQ00vOTZETytKcGtQdlAvOHpt?= =?utf-8?B?RHBDUDlkTzltUnNY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HQrYHCg9iUaw25mtJ2g2jSo9ej81+h0P1vLItO+shFGRnE=;24:V4CVncPdf+LcQZ+AAjk20XqP2BHLSFU9Yeqo1ladz4dLWHoCC/j29v6lL6NR0sjZMyHrrnhZYFhyGjUNH+jjb2PZIuutwLeBhavzGZvsd78=;7:X6TbzZk1HOgJ6OREzejY2AtH9433NXt29AGXpJJYVIhY/aDGdLeVrOzyk3xY8GIAqfvETel0iRn0XQxjbOp+W5GqALhI4uEn5541pDKX9jJ+KFUH0q1qBswXxmpMkGnu2qljbbozedd1Xi+aztjQ3ccdSg0ND5/Grve7DVn+qmQ8qvO9Waoc3qJcSYtD8dHYkHZg9SLORYhfoEY7hTFlqyYdY7JoyEaBVgp8noa30+aCal4dQGyo6DsBhFU67Vno SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2018 10:04:19.1187 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ecf822b-d11c-4d60-ee28-08d57c372364 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2459 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/2018 03:15 PM, Arnd Bergmann wrote: > Calculating the number of entries now uses 64-bit arithmetic that > causes a link error on 32-bit architectures: > > drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.o: In function `mlxsw_sp_kvdl_init': > spectrum_kvdl.c:(.text+0x51c): undefined reference to `__aeabi_uldivmod' > > We could probably use a 32-bit division here as before, but since this is > not in a performance critical path, div_u64() seems cleaner here. > > Fixes: 887839e6960d ("mlxsw: spectrum_kvdl: Add support for dynamic partition set") > Signed-off-by: Arnd Bergmann > --- > drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c > index d27fa57ad3c3..6fd701db90c9 100644 > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c > @@ -278,7 +278,7 @@ static int mlxsw_sp_kvdl_part_init(struct mlxsw_sp *mlxsw_sp, > resource_size = info->end_index - info->start_index + 1; > } > > - nr_entries = resource_size / info->alloc_size; > + nr_entries = div_u64(resource_size, info->alloc_size); > usage_size = BITS_TO_LONGS(nr_entries) * sizeof(unsigned long); > part = kzalloc(sizeof(*part) + usage_size, GFP_KERNEL); > if (!part) > Acked-by: Arkadi Sharshevsky