Skip to content

Commit 922aa21

Browse files
Joe EykholtJames Bottomley
authored andcommitted
[SCSI] libfc: fix RPORT_TO_PRIV and PRIV_TO_RPORT() macros.
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>
1 parent 795d86f commit 922aa21

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/scsi/libfc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ struct fc_rport_libfc_priv {
223223
};
224224

225225
#define PRIV_TO_RPORT(x) \
226-
(struct fc_rport *)((void *)x - sizeof(struct fc_rport));
226+
((struct fc_rport *)((void *)(x) - sizeof(struct fc_rport)))
227227
#define RPORT_TO_PRIV(x) \
228-
(struct fc_rport_libfc_priv *)((void *)x + sizeof(struct fc_rport));
228+
((struct fc_rport_libfc_priv *)((void *)(x) + sizeof(struct fc_rport)))
229229

230230
static inline void fc_rport_set_name(struct fc_rport *rport, u64 wwpn, u64 wwnn)
231231
{

0 commit comments

Comments
 (0)