Skip to content

Commit 5007526

Browse files
Christoph Hellwighdeller
authored andcommitted
parisc/lba_pci: use container_of in LBA_DEV
Use the type safe container_of macros instead of a blind cast in LBA_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 e2fcabe commit 5007526

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/parisc/lba_pci.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ static u32 lba_t32;
111111

112112
#define LBA_SKIP_PROBE(d) ((d)->flags & LBA_FLAG_SKIP_PROBE)
113113

114-
115-
/* Looks nice and keeps the compiler happy */
116-
#define LBA_DEV(d) ({ \
117-
void *__pdata = d; \
118-
BUG_ON(!__pdata); \
119-
(struct lba_device *)__pdata; })
114+
static inline struct lba_device *LBA_DEV(struct pci_hba_data *hba)
115+
{
116+
return container_of(hba, struct lba_device, hba);
117+
}
120118

121119
/*
122120
** Only allow 8 subsidiary busses per LBA

0 commit comments

Comments
 (0)