mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 20:32:22 +00:00
parisc/dino: use container_of in DINO_DEV
Use the type safe container_of macros instead of a blind cast in DINO_DEV, and turn the macro into an inline function. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
cb0f7ab4a4
commit
e2fcabe0eb
@ -154,12 +154,10 @@ struct dino_device
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Looks nice and keeps the compiler happy */
|
||||
#define DINO_DEV(d) ({ \
|
||||
void *__pdata = d; \
|
||||
BUG_ON(!__pdata); \
|
||||
(struct dino_device *)__pdata; })
|
||||
|
||||
static inline struct dino_device *DINO_DEV(struct pci_hba_data *hba)
|
||||
{
|
||||
return container_of(hba, struct dino_device, hba);
|
||||
}
|
||||
|
||||
/*
|
||||
* Dino Configuration Space Accessor Functions
|
||||
|
Loading…
Reference in New Issue
Block a user