Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755571AbbKCQtK (ORCPT ); Tue, 3 Nov 2015 11:49:10 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34510 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770AbbKCQtG (ORCPT ); Tue, 3 Nov 2015 11:49:06 -0500 Subject: Re: [PATCH] lightnvm: work around 32-bit built error To: Jens Axboe , Arnd Bergmann References: <4925999.tpkPGVQaeU@wuerfel> <5638D1F0.7060406@fb.com> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <5638E57F.9090905@lightnvm.io> Date: Tue, 3 Nov 2015 17:49:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <5638D1F0.7060406@fb.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1556 Lines: 35 On 11/03/2015 04:25 PM, Jens Axboe wrote: > On 11/03/2015 06:53 AM, Arnd Bergmann wrote: >> The newly added lightnvm incorrectly uses a sector_t variable to >> represent a data structure with fixed length bit fields, which breaks >> when sector_t is configured to be 32-bit: >> >> In file included from ../drivers/lightnvm/core.c:29:0: >> /include/linux/lightnvm.h:143:4: error: width of 'resved' exceeds its >> type >> sector_t resved : 36; >> include/linux/lightnvm.h: In function 'ppa_set_empty': >> /include/linux/lightnvm.h:120:20: warning: large integer implicitly >> truncated to unsigned type [-Woverflow] >> #define ADDR_EMPTY (~0ULL) > > Thanks Arnd, Matias sent another variant yesterday that changes this to > u64 as well. > >> This patch resolves the build error, but does not address the fact that >> bit fields are not reliable in data structures that are interpreted >> by firmware on another architecture. If the layout is meant to be >> stable, the bit fields should be replaced with explicit calculations. > > Matias? Are these every stored and read back, potentially on a different > machine? > They are only used for translation from the generic ppa to the device specific ppa in the host. They will not be stored in the device (if, it would be in done with another structure) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/