Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • K kvmtool-ae
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • kvmtool-ae
  • Repository
Switch branch/tag
  • kvmtool-ae
  • virtio
  • blk.c
Find file BlameHistoryPermalink
  • Andre Przywara's avatar
    virtio/blk: Avoid taking pointer to packed struct · eaeaf608
    Andre Przywara authored May 03, 2019
    
    
    clang and GCC9 refuse to compile virtio/blk.c with the following message:
    virtio/blk.c:161:37: error: taking address of packed member 'geometry' of class
          or structure 'virtio_blk_config' may result in an unaligned pointer value
          [-Werror,-Waddress-of-packed-member]
            struct virtio_blk_geometry *geo = &conf->geometry;
    
    Since struct virtio_blk_geometry is in a kernel header, we can't do much
    about the packed attribute, but as Peter pointed out, the solution is
    rather simple: just get rid of the convenience variable and use the
    original struct member directly.
    
    Reviewed-by: Jean-Philippe Brucker's avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
    Suggested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Andre Przywara's avatarAndre Przywara <andre.przywara@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    eaeaf608