From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933118AbdBHNOp (ORCPT ); Wed, 8 Feb 2017 08:14:45 -0500 Received: from mga05.intel.com ([192.55.52.43]:54943 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754447AbdBHNOj (ORCPT ); Wed, 8 Feb 2017 08:14:39 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="asc'?scan'208";a="1104644321" From: Felipe Balbi To: Greg KH Cc: "Gustavo A. R. Silva" , bhumirks@gmail.com, mina86@mina86.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] drivers: usb: gadget: udc: add missing break in switch In-Reply-To: <20170208130357.GC28327@kroah.com> References: <20170208072212.GA8209@embeddedgus> <87mvdxxchc.fsf@linux.intel.com> <20170208040243.Horde.88jNxPiVAcL_hzrlS8ZVsGy@gator4166.hostgator.com> <87inokyjjk.fsf@linux.intel.com> <20170208130357.GC28327@kroah.com> Date: Wed, 08 Feb 2017 15:13:25 +0200 Message-ID: <878tpgygei.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Greg KH writes: > On Wed, Feb 08, 2017 at 02:05:35PM +0200, Felipe Balbi wrote: >>=20 >> Hi, >>=20 >> "Gustavo A. R. Silva" writes: >> >> "Gustavo A. R. Silva" writes: >> >>> Add missing break in switch. >> >>> >> >>> Addresses-Coverity-ID: 201385 >> >>> Signed-off-by: Gustavo A. R. Silva >> >>> --- >> >>> drivers/usb/gadget/udc/mv_udc_core.c | 1 + >> >>> 1 file changed, 1 insertion(+) >> >>> >> >>> diff --git a/drivers/usb/gadget/udc/mv_udc_core.c=20=20 >> >>> b/drivers/usb/gadget/udc/mv_udc_core.c >> >>> index 27ebb0d..56b3574 100644 >> >>> --- a/drivers/usb/gadget/udc/mv_udc_core.c >> >>> +++ b/drivers/usb/gadget/udc/mv_udc_core.c >> >>> @@ -489,6 +489,7 @@ static int mv_ep_enable(struct usb_ep *_ep, >> >>> break; >> >>> case USB_ENDPOINT_XFER_CONTROL: >> >>> ios =3D 1; >> >>> + break; >> >> >> >> are you SURE this is supposed to have this break statement? What if we >> >> want to initialize mult to 0 *also* for control endpoints? How did you >> >> test this? Do you have access to Marvel's documentation for this >> >> controller? >> >> >> > >> > Certainly I wasn't sure, but I also think this is kind of obscure=20=20 >> > code. If that is the case that we also want to initialize mult to 0,= =20=20 >> > wouldn't it be clearer (for maintenance purposes) to add mult =3D 0 an= d=20=20 >> > the break statement after ios =3D 1? >> > >> > What do you think if I modify that piece of code as follows: >>=20 >> I think you need to test it, or get someone to test it for you :-) > > For crap code like this where it's "obvious" that something is wrong? > That's really hard. heh :-) > How about a nice comment instead: > /* Code path falls through, is it correct or not, who knows??? */ > which will make the static code checkers stop complaining about it, and > if someone actually has the hardware, then they can test it. works for me =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlibGXUACgkQzL64meEa mQZ96RAAkWMhwvbYhPef1PEIHx8esrEwGaa4sQkEWPdTvSA2/2M6Jxoem8wjBCT4 yAUJVP5fJlN8b7gmMz6AdTCMnInN7jiCLPtz6MVM3wObdtLFF5JOot+oq//Is/M6 vlAd8zOPraNCHbRgjd3qDa4ZqeuMyRM5S6EqkItsjihLCJxqPYBtRt3DZ8ss0tvm 1mEVd7JLkNVPugEEeTvJRqb5VdTb8USD1Jli4JPQU7wqKJP/J+KlojzLh5en8SHt I4NwsFAH578m6+7GjDuSBSht6wX5epWbKe2zMPbcpVJsW2Akuvhm/N3cVsNsp+s3 2QRzmdYbaLOqF06gzolTBpoE7DCGhDQ1gDh1mCWwsc3voC8oSujOON6ou5nwjDQH wuRon2moXIEYLgH6WWf5PpR4idVWCvQfs66JPjVthM2cbrxPEq8Htt7t+VGIUNNv blwPsv9Eq52iCsd/qusyNl7soGgDi8DEwwe9BtqtjGRGg31Dr2Hxr3uhDnT9qFIg PwkI7gGx2ljwOzurXdrA4DQ1pIFU7Jip7FfcnMWSAQo592zdHf0mhd3xRErmWXDN UBTlI7tRMYOFYHaB4W2+GorMATzHn/AAyIpjSb1yr2xWh4AB+CkeHiOQS1opFkB0 nm7qZReGjhkzBwWRpEBMhDMXF0lufEYFuDvg4jziRQ/hxPK5s8U= =8tB4 -----END PGP SIGNATURE----- --=-=-=--