summaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-01-29 19:13:09 +0100
committerHelge Deller <deller@gmx.de>2019-02-21 20:37:12 +0100
commit5007526700a0e13b15ef02c7495786f882d0cc0b (patch)
tree4c89c5b330e359ff8850afe69a7debc01186b036 /drivers/parisc
parentparisc/dino: use container_of in DINO_DEV (diff)
downloadlinux-5007526700a0e13b15ef02c7495786f882d0cc0b.tar.xz
linux-5007526700a0e13b15ef02c7495786f882d0cc0b.zip
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>
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/lba_pci.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index dcea15588833..3c4a2e7f8010 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -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