Page MenuHomeFreeBSD

D29676.id87120.diff
No OneTemporary

D29676.id87120.diff

Index: sys/kern/subr_bus.c
===================================================================
--- sys/kern/subr_bus.c
+++ sys/kern/subr_bus.c
@@ -95,7 +95,7 @@
*/
typedef TAILQ_HEAD(devclass_list, devclass) devclass_list_t;
typedef TAILQ_HEAD(driver_list, driverlink) driver_list_t;
-typedef TAILQ_HEAD(device_list, device) device_list_t;
+typedef TAILQ_HEAD(device_list, _device) device_list_t;
struct devclass {
TAILQ_ENTRY(devclass) link;
@@ -112,9 +112,12 @@
};
/**
- * @brief Implementation of device.
+ * @brief Implementation of _device.
+ *
+ * The structure is named _device instead of device to avoid type confusion
+ * caused by other subsystems defining a struct device.
*/
-struct device {
+struct _device {
/*
* A device is a kernel object. The first field must be the
* current ops table for the object.
@@ -124,8 +127,8 @@
/*
* Device hierarchy.
*/
- TAILQ_ENTRY(device) link; /**< list of devices in parent */
- TAILQ_ENTRY(device) devlink; /**< global device list membership */
+ TAILQ_ENTRY(_device) link; /**< list of devices in parent */
+ TAILQ_ENTRY(_device) devlink; /**< global device list membership */
device_t parent; /**< parent of this device */
device_list_t children; /**< list of child devices */
@@ -853,7 +856,7 @@
/* End of /dev/devctl code */
-static TAILQ_HEAD(,device) bus_data_devices;
+static TAILQ_HEAD(, _device) bus_data_devices;
static int bus_data_generation = 1;
static kobj_method_t null_methods[] = {
Index: sys/powerpc/include/bus_dma.h
===================================================================
--- sys/powerpc/include/bus_dma.h
+++ sys/powerpc/include/bus_dma.h
@@ -33,8 +33,8 @@
#include <sys/bus_dma.h>
#include <sys/bus_dma_internal.h>
-struct device;
+struct _device;
-int bus_dma_tag_set_iommu(bus_dma_tag_t, struct device *iommu, void *cookie);
+int bus_dma_tag_set_iommu(bus_dma_tag_t, struct _device *iommu, void *cookie);
#endif /* _POWERPC_BUS_DMA_H_ */
Index: sys/sys/pcpu.h
===================================================================
--- sys/sys/pcpu.h
+++ sys/sys/pcpu.h
@@ -187,7 +187,7 @@
STAILQ_ENTRY(pcpu) pc_allcpu;
struct lock_list_entry *pc_spinlocks;
long pc_cp_time[CPUSTATES]; /* statclock ticks */
- struct device *pc_device;
+ struct _device *pc_device; /* CPU device handle */
void *pc_netisr; /* netisr SWI cookie */
int pc_unused1; /* unused field */
int pc_domain; /* Memory domain. */
Index: sys/sys/systm.h
===================================================================
--- sys/sys/systm.h
+++ sys/sys/systm.h
@@ -626,9 +626,9 @@
/*
* APIs to manage deprecation and obsolescence.
*/
-struct device;
+struct _device;
void _gone_in(int major, const char *msg);
-void _gone_in_dev(struct device *dev, int major, const char *msg);
+void _gone_in_dev(struct _device *dev, int major, const char *msg);
#ifdef NO_OBSOLETE_CODE
#define __gone_ok(m, msg) \
_Static_assert(m < P_OSREL_MAJOR(__FreeBSD_version)), \
Index: sys/sys/types.h
===================================================================
--- sys/sys/types.h
+++ sys/sys/types.h
@@ -272,7 +272,7 @@
#ifdef _KERNEL
typedef int boolean_t;
-typedef struct device *device_t;
+typedef struct _device *device_t;
typedef __intfptr_t intfptr_t;
/*

File Metadata

Mime Type
text/plain
Expires
Fri, Jul 3, 10:16 PM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34639541
Default Alt Text
D29676.id87120.diff (3 KB)

Event Timeline