Received: by 10.223.185.116 with SMTP id b49csp685574wrg; Fri, 23 Feb 2018 05:17:59 -0800 (PST) X-Google-Smtp-Source: AH8x227AMBpyAT49Vl57LekQ63NfULwBkMgUe0VLn4gOTcuTB8y0yoM8s3LddchPbrZcPL3V6Va2 X-Received: by 10.98.166.200 with SMTP id r69mr1767692pfl.205.1519391879123; Fri, 23 Feb 2018 05:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519391879; cv=none; d=google.com; s=arc-20160816; b=rr5kSe7fzmystFukTWxxnDkR8KoG2doM4gQRREsdtlKy7Gfe1E4hyWsH2tSC3H3u7E SuDNaIzEWNhHCBx9B2bymuYl2B/HqVa9i8gnh3saMtbMB0VNAyOSz89ip8Of0d0s4Qc4 rVr9UuI0c+CXy4A2FbIANM+LHvCnM0sHAghGnUmeC0BhTkeW1ac4TQkXYnWvelPc7EuN eLU3qneBWu6cisaCgO8HOG//tXRC0RHKCQ2abchgrK3ywNK2PiO1UKagWVH+hE60zocu gn8Buj0NK9Mt05iufARr5DWoOFFXMwlyJEqGKwb5junKM1RRPtv2CH4hHeb5wnH3INmM WmDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dxavHwBB87447awt/2jIUq+OI+lcAZeFn9xzyT8O8Tw=; b=thRJiMmir8RRo9N4Blweb+ggBZp/+/61RhIpETGynUuTqMPobusAqltEA315PuDalR z7bHhr9nVpUqon1tWTUL6RkuDf6u3aeuQqKvG/qyG3GGOaXNY6V0JsU4fu2ixTBA6Aya Y0E02YM4KqXqSkHo+1dlQniGy+ofYORjkEjClCu1U9fjLVjWjKSLx5BNL9jyvJ7lni56 m+dLqKxZ3zET/whAw/M9KaDpXnDK/vBnkf+o/bV0v+NRF9c44Tl9TtQ2RhzUYEi+g7aT iJtOfd+rONv/EIvcBg17JIlM+7ugtqAAa1Wdi2hEgciYfukmkopcZ6LuBDPLUse4EYh3 Oy1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6-v6si1807382plr.460.2018.02.23.05.17.44; Fri, 23 Feb 2018 05:17:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbeBWNQA (ORCPT + 99 others); Fri, 23 Feb 2018 08:16:00 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:35797 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbeBWNP6 (ORCPT ); Fri, 23 Feb 2018 08:15:58 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0LeQDB-1eO9dC3NUr-00q8Zd; Fri, 23 Feb 2018 14:15:43 +0100 From: Arnd Bergmann To: Arkadi Sharshevsky , Jiri Pirko , Ido Schimmel Cc: Arnd Bergmann , "David S. Miller" , Wei Yongjun , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH 1/2] mlxsw: spectrum_kvdl: use div_u64() for 64-bit division Date: Fri, 23 Feb 2018 14:15:31 +0100 Message-Id: <20180223131540.1065413-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:oQgd2ylLPcq/v1LKdIP9kk2CkWxRUpxc0Y2CL9ZKRRNDkcFwZJ7 3bzxmI/3M13FjdJ+yE++nmRZD4lP5LYM2HkW9tFlhEwCe49n8zrDEL9IId9YgdfysHhqwX2 2Xya5WwY+A0gs16h0maZ6U8AftDPQTy/sdD+MNjaNGLitnD2c+5RHIOaeYkTFxQlM9toGAm 6npCfMeHYdpyCFkHI0FXg== X-UI-Out-Filterresults: notjunk:1;V01:K0:lMfKzRS7n5I=:3Ea98XO4r5qotC3VoaSrfg wbncFagmKnK8cmgjMmg4F+LxYe0KsUXh0ycwDqUhRxt9cGxQTw2iv8u5wA424q+jBMveWabca 2/U2zufssuMRP0mma7gDNTGJYb1W7Cmo1NdAMGyKdJIeE9qTo6HqlmM/mUfGBJyxd2LXCL2nu z7iducm79AmFmIW6wRUYRubGhWLDlk+pVIZm/TkzjbfBXcnPny7q4nTZpBH7tdIiaq0Dkle4b kbEU4TtH8fNsrpytsNVZHij/9GbS4rhTRN39KEiXW7vWJJv2uXXkp8mXjpgbVZvYWUUUUWMgb P82JaPT9W/MxJCilyggEXfgH2sQTnEEOcCnLo0rVXATrJd9YRtNjqg6SkDoY+vKJ7Bkn4xhYI PnVPJ5pGSOfJyrAuPNu0/L2uVwZvpeDMeYGU0716hRU7hiqmJQq2NFLoNAp4g6EzUDm1n0DDQ WenxbQER72aNWpRQ8VUHscDMfBJURYAF9AWHxAFlhNhxdYjslQ3wgD2kSHqPuqZvxoXXTF+p8 zG5xM8BRwXyETXiDQpsZ9GJVwsh1q/STZ1taayMjjLv1j3ogja+R0SSJlyuRPoZb1J2tK6LmY /Er6ZBFOng/TvJgBp8zrZDHQMEw08ZHR/0rPtprd2Rl65XwGOQf6FHvMUUEk52k3Y3BJEzLZ+ Mco0s9BvNeM2nYp2aWXQlm+wh7bpl72ZnOZHBRbVmUTY2Sot3WB9iYuo8v8ZQ5BgX0tmu/2Ou rArcInFvHf6fFU9quBGaEjj3/XT4T6hk8EoGKw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.9.0