Skip to content

Commit e2fcabe

Browse files
Christoph Hellwighdeller
authored andcommitted
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>
1 parent cb0f7ab commit e2fcabe

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/parisc/dino.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,10 @@ struct dino_device
154154
#endif
155155
};
156156

157-
/* Looks nice and keeps the compiler happy */
158-
#define DINO_DEV(d) ({ \
159-
void *__pdata = d; \
160-
BUG_ON(!__pdata); \
161-
(struct dino_device *)__pdata; })
162-
157+
static inline struct dino_device *DINO_DEV(struct pci_hba_data *hba)
158+
{
159+
return container_of(hba, struct dino_device, hba);
160+
}
163161

164162
/*
165163
* Dino Configuration Space Accessor Functions

0 commit comments

Comments
 (0)