提交 50075267 编写于 作者: C Christoph Hellwig 提交者: Helge Deller

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: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NHelge Deller <deller@gmx.de>
上级 e2fcabe0
......@@ -111,12 +111,10 @@ static u32 lba_t32;
#define LBA_SKIP_PROBE(d) ((d)->flags & LBA_FLAG_SKIP_PROBE)
/* Looks nice and keeps the compiler happy */
#define LBA_DEV(d) ({ \
void *__pdata = d; \
BUG_ON(!__pdata); \
(struct lba_device *)__pdata; })
static inline struct lba_device *LBA_DEV(struct pci_hba_data *hba)
{
return container_of(hba, struct lba_device, hba);
}
/*
** Only allow 8 subsidiary busses per LBA
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册