From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dennis Dalessandro Subject: Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints Date: Tue, 10 Oct 2017 15:27:11 -0400 Message-ID: <849d304a-fa89-0d6a-6edb-cf34780e41a8@intel.com> References: <20171006213333.6721-1-bart.vanassche@wdc.com> <20171006213333.6721-3-bart.vanassche@wdc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20171006213333.6721-3-bart.vanassche-Sjgp3cTcYWE@public.gmane.org> Content-Language: en-US Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Bart Van Assche , Doug Ledford Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sean Hefty List-Id: linux-rdma@vger.kernel.org On 10/6/2017 5:32 PM, Bart Van Assche wrote: > Avoid that gcc 7 reports the following warning when building with W=1: > > warning: this statement may fall through [-Wimplicit-fallthrough=] > > Signed-off-by: Bart Van Assche > Cc: Sean Hefty > --- > drivers/infiniband/core/cm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c > index d80911d4abb7..5927ee4e57ca 100644 > --- a/drivers/infiniband/core/cm.c > +++ b/drivers/infiniband/core/cm.c > @@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, > msg_response = CM_MSG_RESPONSE_OTHER; > break; > } > + /* fall through */ > default: > ret = -EINVAL; > goto error1; > So adding the comment is enough to make gcc shut up? Or are you just annotating the code so it's obvious it was intentional? -Dennis -- 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