[warnings] remove some extraneous __PACKED attributes

Also remove a few extra data structures that were marked packed but not
otherwise used anywhere.
This commit is contained in:
Travis Geiselbrecht
2024-04-18 23:51:38 -07:00
parent 6ed6f36fa0
commit 9a4fae0714
5 changed files with 12 additions and 25 deletions

View File

@@ -36,27 +36,6 @@ typedef struct {
bool valid; bool valid;
} pci_bar_t; } pci_bar_t;
typedef struct {
uint8_t id;
uint8_t next;
} __PACKED pci_capability_t;
typedef struct {
uint8_t bus;
uint8_t device;
uint8_t link_int_a;
uint16_t irq_int_a;
uint8_t link_int_b;
uint16_t irq_int_b;
uint8_t link_int_c;
uint16_t irq_int_c;
uint8_t link_int_d;
uint16_t irq_int_d;
uint8_t slot;
uint8_t reserved;
} __PACKED irq_routing_entry;
// only use one of these two: // only use one of these two:
// try to detect PCI based on legacy PC PCI accessor methods // try to detect PCI based on legacy PC PCI accessor methods
status_t pci_init_legacy(void); status_t pci_init_legacy(void);

View File

@@ -141,7 +141,7 @@ typedef struct {
uint16_t bridge_control; uint16_t bridge_control;
} type1; // configuration for bridge devices } type1; // configuration for bridge devices
}; };
} __PACKED pci_config_t; } pci_config_t;
static_assert(sizeof(pci_config_t) == 0x40, ""); static_assert(sizeof(pci_config_t) == 0x40, "");
/* Class/subclass codes (incomplete) */ /* Class/subclass codes (incomplete) */

View File

@@ -7,11 +7,15 @@
*/ */
#pragma once #pragma once
#include <lk/compiler.h>
#include <sys/types.h> #include <sys/types.h>
__BEGIN_CDECLS
/* examine and try to publish partitions on a particular device at a particular offset */ /* examine and try to publish partitions on a particular device at a particular offset */
int partition_publish(const char *device, off_t offset); int partition_publish(const char *device, off_t offset);
/* remove any published subdevices on this device */ /* remove any published subdevices on this device */
int partition_unpublish(const char *device); int partition_unpublish(const char *device);
__END_CDECLS

View File

@@ -5,6 +5,8 @@
* license that can be found in the LICENSE file or at * license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT * https://opensource.org/licenses/MIT
*/ */
#include "lib/partition.h"
#include <lk/debug.h> #include <lk/debug.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -12,13 +14,13 @@
#include <stdlib.h> #include <stdlib.h>
#include <arch.h> #include <arch.h>
#include <lib/bio.h> #include <lib/bio.h>
#include <lib/partition.h> #include <assert.h>
struct chs { struct chs {
uint8_t c; uint8_t c;
uint8_t h; uint8_t h;
uint8_t s; uint8_t s;
} __PACKED; };
struct mbr_part { struct mbr_part {
uint8_t status; uint8_t status;
@@ -27,7 +29,8 @@ struct mbr_part {
struct chs end; struct chs end;
uint32_t lba_start; uint32_t lba_start;
uint32_t lba_length; uint32_t lba_length;
} __PACKED; };
static_assert(sizeof(struct mbr_part) == 16, "");
static status_t validate_mbr_partition(bdev_t *dev, const struct mbr_part *part) { static status_t validate_mbr_partition(bdev_t *dev, const struct mbr_part *part) {
/* check for invalid types */ /* check for invalid types */

View File

@@ -35,6 +35,7 @@ struct tga_header {
uint8_t bitsperpixel; uint8_t bitsperpixel;
uint8_t imagedescriptor; uint8_t imagedescriptor;
} __PACKED; } __PACKED;
static_assert(sizeof(struct tga_header) == 18, "");
static void print_tga_info(const struct tga_header *header) { static void print_tga_info(const struct tga_header *header) {
LTRACEF("idlength %hhd\n", header->idlength); LTRACEF("idlength %hhd\n", header->idlength);