Skip to content

Commit

Permalink
[SCSI] libfc: fix RPORT_TO_PRIV and PRIV_TO_RPORT() macros.
Browse files Browse the repository at this point in the history
These macros introduce extra undesirable semicolons that keep
them from being used in expressions, and they don't protect
against being passed an expression.

Add parens and remove the semicolons.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Sep 10, 2009
1 parent 795d86f commit 922aa21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/scsi/libfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ struct fc_rport_libfc_priv {
};

#define PRIV_TO_RPORT(x) \
(struct fc_rport *)((void *)x - sizeof(struct fc_rport));
((struct fc_rport *)((void *)(x) - sizeof(struct fc_rport)))
#define RPORT_TO_PRIV(x) \
(struct fc_rport_libfc_priv *)((void *)x + sizeof(struct fc_rport));
((struct fc_rport_libfc_priv *)((void *)(x) + sizeof(struct fc_rport)))

static inline void fc_rport_set_name(struct fc_rport *rport, u64 wwpn, u64 wwnn)
{
Expand Down

0 comments on commit 922aa21

Please sign in to comment.