Skip to content

Commit

Permalink
HID: roccat: declare meaning of pack pragma usage in driver headers
Browse files Browse the repository at this point in the history
Using pack pragma to prevent padding bytes in binary data structures
used for hardware communication. Explanation of these pragmas was requested.

Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Stefan Achatz authored and Jiri Kosina committed Jan 8, 2011
1 parent 5012aad commit bd3a2b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/hid-roccat-kone.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

#include <linux/types.h>

/*
* Binary data structures used for hardware communication must have no padding.
*/
#pragma pack(push)
#pragma pack(1)

Expand Down
3 changes: 3 additions & 0 deletions drivers/hid/hid-roccat-pyra.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

#include <linux/types.h>

/*
* Binary data structures used for hardware communication must have no padding.
*/
#pragma pack(push)
#pragma pack(1)

Expand Down

0 comments on commit bd3a2b9

Please sign in to comment.