File: 52_remove-pragma.diff

package info (click to toggle)
smartmontools 7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,080 kB
  • sloc: cpp: 53,631; ansic: 9,924; sh: 6,493; makefile: 1,017
file content (265 lines) | stat: -rw-r--r-- 8,430 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
From: Giuseppe Iuculano <iuculano@debian.org>
Date: Thu, 27 Sep 2018 19:03:07 +0800
Subject: _remove-pragma

---
 atacmds.h | 15 ---------------
 1 file changed, 15 deletions(-)

--- a/atacmds.h
+++ b/atacmds.h
@@ -110,9 +110,8 @@
 #define NUMBER_ATA_SMART_ATTRIBUTES     30
 
 // Needed parts of the ATA DRIVE IDENTIFY Structure. Those labeled
 // word* are NOT used.
-#pragma pack(1)
 struct ata_identify_device {
   unsigned short words000_009[10];
   unsigned char  serial_no[20];
   unsigned short words020_022[3];
@@ -132,9 +131,8 @@
 #pragma pack()
 STATIC_ASSERT(sizeof(ata_identify_device) == 512);
 
 /* ata_smart_attribute is the vendor specific in SFF-8035 spec */ 
-#pragma pack(1)
 struct ata_smart_attribute {
   unsigned char id;
   // meaning of flag bits: see MACROS just below
   // WARNING: MISALIGNED!
@@ -193,9 +191,8 @@
 
 
 // Format of data returned by SMART READ DATA
 // Table 62 of T13/1699-D (ATA8-ACS) Revision 6a, September 2008
-#pragma pack(1)
 struct ata_smart_values {
   unsigned short int revnumber;
   struct ata_smart_attribute vendor_attributes [NUMBER_ATA_SMART_ATTRIBUTES];
   unsigned char offline_data_collection_status;
@@ -226,9 +223,8 @@
  05 - Read scan
 */
 
 /* Vendor attribute of SMART Threshold (compare to ata_smart_attribute above) */
-#pragma pack(1)
 struct ata_smart_threshold_entry {
   unsigned char id;
   unsigned char threshold;
   unsigned char reserved[10];
@@ -237,9 +233,8 @@
 STATIC_ASSERT(sizeof(ata_smart_threshold_entry) == 12);
 
 /* Format of Read SMART THreshold Command */
 /* Compare to ata_smart_values above */
-#pragma pack(1)
 struct ata_smart_thresholds_pvt {
   unsigned short int revnumber;
   struct ata_smart_threshold_entry thres_entries[NUMBER_ATA_SMART_ATTRIBUTES];
   unsigned char reserved[149];
@@ -249,9 +244,8 @@
 STATIC_ASSERT(sizeof(ata_smart_thresholds_pvt) == 512);
 
 
 // Table 42 of T13/1321D Rev 1 spec (Error Data Structure)
-#pragma pack(1)
 struct ata_smart_errorlog_error_struct {
   unsigned char reserved;
   unsigned char error_register;
   unsigned char sector_count;
@@ -268,9 +262,8 @@
 STATIC_ASSERT(sizeof(ata_smart_errorlog_error_struct) == 30);
 
 
 // Table 41 of T13/1321D Rev 1 spec (Command Data Structure)
-#pragma pack(1)
 struct ata_smart_errorlog_command_struct {
   unsigned char devicecontrolreg;
   unsigned char featuresreg;
   unsigned char sector_count;
@@ -284,18 +277,16 @@
 #pragma pack()
 STATIC_ASSERT(sizeof(ata_smart_errorlog_command_struct) == 12);
 
 // Table 40 of T13/1321D Rev 1 spec (Error log data structure)
-#pragma pack(1)
 struct ata_smart_errorlog_struct {
   struct ata_smart_errorlog_command_struct commands[5];
   struct ata_smart_errorlog_error_struct error_struct;
 } ATTR_PACKED;
 #pragma pack()
 STATIC_ASSERT(sizeof(ata_smart_errorlog_struct) == 90);
 
 // Table 39 of T13/1321D Rev 1 spec (SMART error log sector)
-#pragma pack(1)
 struct ata_smart_errorlog {
   unsigned char revnumber;
   unsigned char error_log_pointer;
   struct ata_smart_errorlog_struct errorlog_struct[5];
@@ -313,9 +304,8 @@
 //   T13/1699-D Revision 6a (Working Draft), September 6, 2008.
 
 // Command data structure
 // Table A.9 of T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_smart_exterrlog_command
 {
   unsigned char device_control_register;
   unsigned char features_register;
@@ -338,9 +328,8 @@
 STATIC_ASSERT(sizeof(ata_smart_exterrlog_command) == 18);
 
 // Error data structure
 // Table A.10 T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_smart_exterrlog_error
 {
   unsigned char device_control_register;
   unsigned char error_register;
@@ -363,9 +352,8 @@
 STATIC_ASSERT(sizeof(ata_smart_exterrlog_error) == 34);
 
 // Error log data structure
 // Table A.8 of T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_smart_exterrlog_error_log
 {
   ata_smart_exterrlog_command commands[5];
   ata_smart_exterrlog_error error;
@@ -374,9 +362,8 @@
 STATIC_ASSERT(sizeof(ata_smart_exterrlog_error_log) == 124);
 
 // Ext. Comprehensive SMART error log
 // Table A.7 of T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_smart_exterrlog
 {
   unsigned char version;
   unsigned char reserved1;
@@ -390,9 +377,8 @@
 STATIC_ASSERT(sizeof(ata_smart_exterrlog) == 512);
 
 
 // Table 45 of T13/1321D Rev 1 spec (Self-test log descriptor entry)
-#pragma pack(1)
 struct ata_smart_selftestlog_struct {
   unsigned char selftestnumber; // Sector number register
   unsigned char selfteststatus;
   unsigned short int timestamp;
@@ -403,9 +389,8 @@
 #pragma pack()
 STATIC_ASSERT(sizeof(ata_smart_selftestlog_struct) == 24);
 
 // Table 44 of T13/1321D Rev 1 spec (Self-test log data structure)
-#pragma pack(1)
 struct ata_smart_selftestlog {
   unsigned short int revnumber;
   struct ata_smart_selftestlog_struct selftest_struct[21];
   unsigned char vendorspecific[2];
@@ -422,9 +407,8 @@
 //   T13/1699-D Revision 6a (Working Draft), September 6, 2008.
 
 // Extended Self-test log descriptor entry
 // Table A.13 of T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_smart_extselftestlog_desc
 {
   unsigned char self_test_type;
   unsigned char self_test_status;
@@ -437,9 +421,8 @@
 STATIC_ASSERT(sizeof(ata_smart_extselftestlog_desc) == 26);
 
 // Extended Self-test log data structure
 // Table A.12 of T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_smart_extselftestlog
 {
   unsigned char version;
   unsigned char reserved1;
@@ -452,17 +435,15 @@
 #pragma pack()
 STATIC_ASSERT(sizeof(ata_smart_extselftestlog) == 512);
 
 // SMART LOG DIRECTORY Table 52 of T13/1532D Vol 1 Rev 1a
-#pragma pack(1)
 struct ata_smart_log_entry {
   unsigned char numsectors;
   unsigned char reserved;
 } ATTR_PACKED;
 #pragma pack()
 STATIC_ASSERT(sizeof(ata_smart_log_entry) == 2);
 
-#pragma pack(1)
 struct ata_smart_log_directory {
   unsigned short int logversion;
   struct ata_smart_log_entry entry[255];
 } ATTR_PACKED;
@@ -470,17 +451,15 @@
 STATIC_ASSERT(sizeof(ata_smart_log_directory) == 512);
 
 // SMART SELECTIVE SELF-TEST LOG Table 61 of T13/1532D Volume 1
 // Revision 3
-#pragma pack(1)
 struct test_span {
   uint64_t start;
   uint64_t end;
 } ATTR_PACKED;
 #pragma pack()
 STATIC_ASSERT(sizeof(test_span) == 16);
 
-#pragma pack(1)
 struct ata_selective_self_test_log {
   unsigned short     logversion;
   struct test_span   span[5];
   unsigned char      reserved1[337-82+1];
@@ -507,9 +486,8 @@
 //   T13/1699-D Revision 3f (Working Draft), December 11, 2006.
 
 // SCT Status response (read with SMART_READ_LOG page 0xe0)
 // Table 194 of T13/BSR INCITS 529 (ACS-4) Revision 20, October 26, 2017
-#pragma pack(1)
 struct ata_sct_status_response
 {
   unsigned short format_version;    // 0-1: Status response format version number (2, 3)
   unsigned short sct_version;       // 2-3: Vendor specific version number
@@ -540,9 +518,8 @@
 STATIC_ASSERT(sizeof(ata_sct_status_response) == 512);
 
 // SCT Error Recovery Control command (send with SMART_WRITE_LOG page 0xe0)
 // Table 88 of T13/1699-D Revision 6a
-#pragma pack(1)
 struct ata_sct_error_recovery_control_command
 {
   unsigned short action_code;       // 3 = Error Recovery Control
   unsigned short function_code;     // 1 = Set Current, 2 = Return Current, 3 = Set Power-on, 4 = Return Power-on, 5 = Restore Default
@@ -554,9 +531,8 @@
 STATIC_ASSERT(sizeof(ata_sct_error_recovery_control_command) == 512);
 
 // SCT Feature Control command (send with SMART_WRITE_LOG page 0xe0)
 // Table 72 of T13/1699-D Revision 3f
-#pragma pack(1)
 struct ata_sct_feature_control_command
 {
   unsigned short action_code;       // 4 = Feature Control
   unsigned short function_code;     // 1 = Set, 2 = Return, 3 = Return options
@@ -569,9 +545,8 @@
 STATIC_ASSERT(sizeof(ata_sct_feature_control_command) == 512);
 
 // SCT Data Table command (send with SMART_WRITE_LOG page 0xe0)
 // Table 73 of T13/1699-D Revision 3f 
-#pragma pack(1)
 struct ata_sct_data_table_command
 {
   unsigned short action_code;       // 5 = Data Table
   unsigned short function_code;     // 1 = Read Table
@@ -582,9 +557,8 @@
 STATIC_ASSERT(sizeof(ata_sct_data_table_command) == 512);
 
 // SCT Temperature History Table (read with SMART_READ_LOG page 0xe1)
 // Table 75 of T13/1699-D Revision 3f 
-#pragma pack(1)
 struct ata_sct_temperature_history_table
 {
   unsigned short format_version;    // 0-1: Data table format version number (2)
   unsigned short sampling_period;   // 2-3: Temperature sampling period in minutes