summaryrefslogtreecommitdiff
path: root/drivers/parisc/dino.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-01-29 21:13:08 +0300
committerHelge Deller <deller@gmx.de>2019-02-21 22:37:12 +0300
commite2fcabe0ebe0b343b9de53ed0a7a7f2f86eb9863 (patch)
tree170d43175586f07d89d536724e35f176566b8fc0 /drivers/parisc/dino.c
parentcb0f7ab4a41f966ed20810f9578355fe973f262e (diff)
downloadlinux-e2fcabe0ebe0b343b9de53ed0a7a7f2f86eb9863.tar.xz
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>
Diffstat (limited to 'drivers/parisc/dino.c')
-rw-r--r--drivers/parisc/dino.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 6f348c75687c..846b59d15999 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -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