From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: Re: [PATCH] drivers: staging: lustre: lustre: include: add "__attribute__((packed))" for the related union Date: Sat, 18 Jan 2014 18:26:10 +0800 Message-ID: <52DA56C2.5010802@gmail.com> References: <52DA4E6A.1000308@gmail.com> <20140118100547.GS7444@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=f4wu/aNyRBHZKvL49ebD5hBgfT/BuzvOCM7QSF5t3pk=; b=mjnr7tu4h+zIgVqJLvv0C5aiXBKvRI98oodEYJlNNrMHrsuhg/igCscNFEqMmR7z0g H8HUtmrct5m/banerMLx652ST6n/1afPlPWThO+DR0FWSmzd4IcJ02DCLZeux9OJZAkp xOdQ+NMhzS22AKXQMZnXxiVXNnOIv/ibo+Tz3PoD39SFgp1qPQ+I2W+h5LOL7dsr/hNz WDdzK8URh3ffkBO/SexyDTlY25SuOD0OP4AAiM6P3S5n5MI6/aXYqcypwvpFT245ErtD PUF4ehUKQguNOqsGapVO2fds1cbfqoT9IbtQWLMfI2kYWaBLFSS1P/atoho3S1RG4lzt 7eEA== In-Reply-To: <20140118100547.GS7444@mwanda> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: driverdev-devel-bounces@linuxdriverproject.org To: Dan Carpenter Cc: devel@driverdev.osuosl.org, James Hogan , andreas.dilger@intel.com, Greg KH , bergwolf@gmail.com, "linux-kernel@vger.kernel.org" , oleg.drokin@intel.com, jacques-charles.lafoucriere@cea.fr, jinshan.xiong@intel.com, linux-metag@vger.kernel.org On 01/18/2014 06:05 PM, Dan Carpenter wrote: > On Sat, Jan 18, 2014 at 05:50:34PM +0800, Chen Gang wrote: >> Unfortunately, not all compilers assumes the structures within a pack >> region also need be packed (e.g. metag), so need add a pack explicitly >> to satisfy all compilers. >> >> The related error (under metag with allmodconfig): >> >> CC [M] drivers/staging/lustre/lustre/lov/lov_pack.o >> drivers/staging/lustre/lustre/lov/lov_pack.c: In function 'lov_getstripe': >> drivers/staging/lustre/lustre/lov/lov_pack.c:630: error: duplicate case value >> drivers/staging/lustre/lustre/lov/lov_pack.c:630: error: previously used here >> >> And originally, all related code used "__attribute__((packed))", so >> still use it instead of '__packed'. > > Use __packed. Then at least one line will be correct which is better > than nothing. > Hmm... but that will break the 'consistency' (which is not quite good for readers). For me, it will be better to provide another patch to change all "__attribute__((packed))" to "__packed" within this file. What about your ideas? Thanks. -- Chen Gang Open, share and attitude like air, water and life which God blessed