From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagi Grimberg Subject: Re: [PATCH 07/15] IB/srpt: Simplify channel state management Date: Wed, 6 Jan 2016 16:08:50 +0200 Message-ID: <568D1FF2.50806@dev.mellanox.co.il> References: <568BD0FC.70207@sandisk.com> <568BD1F1.5050107@sandisk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <568BD1F1.5050107-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Bart Van Assche , Doug Ledford Cc: Christoph Hellwig , "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-rdma@vger.kernel.org > The only allowed channel state changes are those that change > the channel state into a state with a higher numerical value. > This allows to merge the functions srpt_set_ch_state() and > srpt_test_and_set_ch_state() into a single function. > > Signed-off-by: Bart Van Assche > Cc: Christoph Hellwig The patch looks correct to me, but IMO it would be better to open-code state transitions instead of relying on the assumption of a numerical relationship between states. This can save a potential future bug if someone will add/change a state in the future, and it is also more readable IMO. Just a suggestion though, otherwise Reviewed-by: Sagi Grimberg -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html