Skip to content

Commit

Permalink
parisc/lba_pci: use container_of in LBA_DEV
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
  • Loading branch information
Christoph Hellwig authored and hdeller committed Feb 21, 2019
1 parent e2fcabe commit 5007526
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/parisc/lba_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5007526

Please sign in to comment.