Refine packed annotations in stat.h
authorBart Van Assche <bvanassche@acm.org>
Wed, 14 Aug 2019 20:10:09 +0000 (13:10 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 14 Aug 2019 21:01:29 +0000 (15:01 -0600)
commita5b1c9da0faf31675cf5180c48d29af1870af85d
tree2192b0f3b3ee5559102b6906a07edfee62dccc7c
parent36833fb04b5f9a734e96a571dfb52fc54b5b95e7
Refine packed annotations in stat.h

Instead of declaring the whole structure packed, only declare non-aligned
members packed. This patch is an alternative way to fix the following gcc 9
compiler warnings:

eta.c: In function 'calc_thread_status':
eta.c:510:7: error: taking address of packed member of 'struct jobs_eta' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  510 |     je->rate);
      |     ~~^~~~~~
eta.c:522:66: error: taking address of packed member of 'struct jobs_eta' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  522 |  calc_rate(unified_rw_rep, disp_time, io_bytes, disp_io_bytes, je->rate);
      |                                                                ~~^~~~~~
eta.c:523:64: error: taking address of packed member of 'struct jobs_eta' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  523 |  calc_iops(unified_rw_rep, disp_time, io_iops, disp_io_iops, je->iops);
      |

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat.h