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: Sun, 19 Jan 2014 18:07:16 +0800 Message-ID: <52DBA3D4.3090308@gmail.com> References: <52DA4E6A.1000308@gmail.com> <20140118100547.GS7444@mwanda> <52DA56C2.5010802@gmail.com> <20140118142404.GT7444@mwanda> Mime-Version: 1.0 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=Et2WoCyysBcecXtQVSQq1WeRWcxP0n+2Spj+hDxCPQs=; b=oZ77t6iXA91cJx7zYy6Jyxg7Gb4y4k2e/LSz0o8dZm/ZLsqdixezzfCa0yRvp8lSos 5FbIq+RMop410KcSip0y0Dhl0QnGnu8LXtBfGvhtz7bn0Skp+EsBJc+tmUAh9tPZ+qN4 Zk89Gitbu2N0JH65X3moBLsVQpzQpGxV0wcy2+j95IuU3agmV8AOL/7dzgdXEF+hPOA2 5dJBn5F4OLw0+G18oNh95pnJ4AN2WI6UjtWmokCF8da9+mGTSXCXJ2n24R0YqiEWyV9k J+pwotrszQss3cOtUZFZJyrFeK1bJKbu3JwhmmfhahCq5JbfVp8OfIjWR4P92TgSUWd1 aJiQ== In-Reply-To: <20140118142404.GT7444@mwanda> Sender: linux-metag-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Dan Carpenter Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org, James Hogan , andreas.dilger-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, Greg KH , bergwolf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , oleg.drokin-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, jacques-charles.lafoucriere-KCE40YydGKI@public.gmane.org, jinshan.xiong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 01/18/2014 10:24 PM, Dan Carpenter wrote: > On Sat, Jan 18, 2014 at 06:26:10PM +0800, Chen Gang wrote: >> 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? >> > > In the end, it's not something we care about enough to ask you to redo > the patch. But what I'm saying is that you should prefer kernel style > over local style. We'll fix the surrounding lines later. > OK, thanks, and also thank James and "./scripts/checkpatch.pl" who/which also mentioned about it to me. BTW: this patch is related with another patch which is discussing (so I have cc that patch to you and Greg too): "if we could sure that it is a compiler's feature issue, we will skip this patch". Thanks -- Chen Gang Open, share and attitude like air, water and life which God blessed -- To unsubscribe from this list: send the line "unsubscribe linux-metag" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html