Author: delphij Date: Fri May 31 17:27:44 2013 New Revision: 251187 URL: http://svnweb.freebsd.org/changeset/base/251187
Log: Explicitly use a pair of parentheses to ensure correct evaluation ordering for bitwise operation. Submitted by: swildner (DragonFly) MFC after: 2 weeks Modified: head/sys/dev/mpt/mpt_raid.c head/sys/dev/mpt/mpt_user.c Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Fri May 31 17:23:38 2013 (r251186) +++ head/sys/dev/mpt/mpt_raid.c Fri May 31 17:27:44 2013 (r251187) @@ -605,7 +605,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST)); + (write ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST))); se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | raid_handler_id); Modified: head/sys/dev/mpt/mpt_user.c ============================================================================== --- head/sys/dev/mpt/mpt_user.c Fri May 31 17:23:38 2013 (r251186) +++ head/sys/dev/mpt/mpt_user.c Fri May 31 17:27:44 2013 (r251187) @@ -548,8 +548,8 @@ mpt_user_raid_action(struct mpt_softc *m MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_END_OF_LIST | - raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : - MPI_SGE_FLAGS_IOC_TO_HOST)); + (raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC : + MPI_SGE_FLAGS_IOC_TO_HOST))); } se->FlagsLength = htole32(se->FlagsLength); rap->MsgContext = htole32(req->index | user_handler_id); _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"