From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Mon, 13 Feb 2012 22:26:33 -0800 Subject: [QUESTION] staging/easycap fix In-Reply-To: References: <20120214050633.GA30972@kroah.com> Message-ID: <20120214062633.GA1707@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, Feb 14, 2012 at 11:29:54AM +0530, Manavendra Nath Manav wrote: > 2012/2/14 Ezequiel Garc?a : > > El d?a 14 de febrero de 2012 02:06, Greg KH escribi?: > >> On Tue, Feb 14, 2012 at 01:47:52AM -0300, Ezequiel Garc?a wrote: > >>> 2. second, I am fixing some style issues (besides checkpatch), for > >>> instance "if" syntax: > >>> > >>> - ? if (0 == bInterfaceNumber) { > >>> + ? if (bInterfaceNumber == 0) { > >> > >> You do know why the first style was chosen, right? > > > > This driver code has this "if" style on every if clause. Perhaps > > author's taste? Don't know. > > Searching at kernel code I haven't seen this kind of "if" style. > > > > This particular "if" style is recommended because it prevents the > accidental "always true if condition" in case when the coder > accidentally types "=" instead of "==". "if (0 = x)" can always save > you instead of "if (x = 0)" from nasty typo bugs. Though compiler > warns about it with -Wall flag. It's only "recommended" if you have a compiler that doesn't check for such foolish things. Luckily we do, so you don't have to write kernel code like this at all, so while cleaning it up would be "nice to have", it's not essencial to get it out of the staging tree at all. thanks, greg k-h