Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1545052
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/1] kernel: futex: fixed to else and initcall |
| Date | 2016-12-20 12:20 +0100 |
| Message-ID | <sQqCB-4RO-11@gated-at.bofh.it> (permalink) |
| References | <sQdcl-4ko-5@gated-at.bofh.it> <sQoUa-3JN-5@gated-at.bofh.it> <sQp3Q-3Nb-37@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Tue, 20 Dec 2016, Ozgur Karatas wrote:
> 20.12.2016, 11:21, "Thomas Gleixner" <tglx@linutronix.de>:
> > On Mon, 19 Dec 2016, Ozgur Karatas wrote:
> >
> >> else doesn't need to be used, if should be enclosed in parentheses.
> >
> > Really?
> >
> >
> > So you change the code from
> >
> > if (err < 0)
> > return err;
> > else
> > err = 0;
> >
> > to
> >
> > if (err < 0) {
> > return err;
> > err = 0;
> > }
> >
> > How on earth is that equivivalent and how would that 'err = 0;' statement
> > be ever executed?
>
> Oh my god, I missed this point, sorry!
> Thank you so much for correct me.
>
> This "return err;" will give to "err" and err defined to err = "0".
> Then removed to "else" and return = err; and should it be like this?
>
> #define err = 0;
>
> if (err < 0) {
> return err;
> }
I seriously recommend to take a basic C course first before trying to
change code in the kernel.
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/1] kernel: futex: fixed to else and initcall Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-19 22:00 +0100
Re: [PATCH 1/1] kernel: futex: fixed to else and initcall Thomas Gleixner <tglx@linutronix.de> - 2016-12-20 10:30 +0100
Re: [PATCH 1/1] kernel: futex: fixed to else and initcall Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-20 10:40 +0100
Re: [PATCH 1/1] kernel: futex: fixed to else and initcall Thomas Gleixner <tglx@linutronix.de> - 2016-12-20 12:20 +0100
csiph-web