Re: packed attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 16 Jan 2012 16:35:27 +0400
Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote:

> I noticed that when I run checkpatch.pl over my smb2 patches it fails on
> 
> struct example {
> ...
> } __attribute__((packed));
> 
> and suggests to use
> 
> struct example {
> ...
> } __packed;
> 
> Also we already have many such "style broken" structures in cifsdpu.h.
> 
> What do you think about it? Should we fix them all?
> 

Hmm interesting...there's some discussion of this a few months ago here:

    https://lkml.org/lkml/2011/6/22/25

...looks like __packed is a shortcut in the kernel's compiler-gcc.h
header. Looks like using __packed is fine in new code as long as the
header will never be used by userspace (which may not have that
shortcut defined).

I don't see any reason to do a global search and replace in our headers
though. That would just increase the "churn" in the code for little
benefit.

-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux