linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: staging: lustre: lustre: include: add "__attribute__((packed))" for the related union
@ 2014-01-18  9:50 Chen Gang
  2014-01-18 10:05 ` Dan Carpenter
  0 siblings, 1 reply; 25+ messages in thread
From: Chen Gang @ 2014-01-18  9:50 UTC (permalink / raw)
  To: Greg KH, andreas.dilger, bergwolf, jinshan.xiong, oleg.drokin,
	jacques-charles.lafoucriere
  Cc: devel, linux-metag, linux-kernel, James Hogan

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'.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 6b6c0240..0828b31 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -345,7 +345,7 @@ struct lov_user_md_v3 {	   /* LOV EA user data (host-endian) */
 					   * lmm_objects, use when writing */
 		__u16 lmm_layout_gen;     /* layout generation number
 					   * used when reading */
-	};
+	} __attribute__((packed));
 	char  lmm_pool_name[LOV_MAXPOOLNAME]; /* pool name */
 	struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */
 } __attribute__((packed));
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-02-03 11:55 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-18  9:50 [PATCH] drivers: staging: lustre: lustre: include: add "__attribute__((packed))" for the related union Chen Gang
2014-01-18 10:05 ` Dan Carpenter
2014-01-18 10:26   ` Chen Gang
2014-01-18 14:24     ` Dan Carpenter
2014-01-19 10:07       ` Chen Gang
2014-01-20 11:56         ` James Hogan
2014-01-20 12:30           ` Dan Carpenter
2014-01-20 12:37             ` James Hogan
2014-01-20 12:56               ` Dan Carpenter
2014-01-20 13:01                 ` Dan Carpenter
2014-01-20 13:38                   ` James Hogan
2014-01-20 21:13                 ` Dan Carpenter
2014-01-21 10:36                   ` James Hogan
2014-01-25 11:55                     ` Chen Gang
2014-02-01 13:57                       ` Chen Gang
2014-02-03  8:58                         ` Dan Carpenter
2014-02-03 10:03                           ` Chen Gang
2014-02-03 11:35                             ` Chen Gang
2014-02-03 10:05                           ` David Laight
2014-02-03 10:22                             ` James Hogan
2014-02-03 10:30                               ` Chen Gang
2014-02-03 10:35                               ` David Laight
2014-02-03 11:02                                 ` James Hogan
2014-02-03 11:54                                   ` David Laight
2014-02-03 10:25                             ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).