proc: rename "catch" function argument
diff mbox series

Message ID 20200331210905.GA31680@avx2
State New
Headers show
Series
  • proc: rename "catch" function argument
Related show

Commit Message

Alexey Dobriyan March 31, 2020, 9:09 p.m. UTC
"catch" is reserved keyword in C++, rename it to something
both gcc and g++ accept.

Rename "ign" for symmetry.

Signed-off-by: _Z6Alexeyv <adobriyan@gmail.com>
---

 fs/proc/array.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Andrew Morton April 16, 2020, 4:07 a.m. UTC | #1
On Wed, 1 Apr 2020 00:09:05 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:

> "catch" is reserved keyword in C++, rename it to something
> both gcc and g++ accept.

Why? Is someone compiling the kernel with g++?

> Rename "ign" for symmetry.
> 
> Signed-off-by: _Z6Alexeyv <adobriyan@gmail.com>

Was this intentional?
Alexey Dobriyan April 16, 2020, 5:21 p.m. UTC | #2
On Wed, Apr 15, 2020 at 09:07:27PM -0700, Andrew Morton wrote:
> On Wed, 1 Apr 2020 00:09:05 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> 
> > "catch" is reserved keyword in C++, rename it to something
> > both gcc and g++ accept.
> 
> Why? Is someone compiling the kernel with g++?

I do!
https://marc.info/?l=linux-acpi&m=158343373912366&w=4

> > Rename "ign" for symmetry.
> > 
> > Signed-off-by: _Z6Alexeyv <adobriyan@gmail.com>
> 
> Was this intentional?

In Russia, C++ mangles you! :^)
Andrew Morton April 17, 2020, 3:04 a.m. UTC | #3
On Thu, 16 Apr 2020 20:21:55 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:

> On Wed, Apr 15, 2020 at 09:07:27PM -0700, Andrew Morton wrote:
> > On Wed, 1 Apr 2020 00:09:05 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> > 
> > > "catch" is reserved keyword in C++, rename it to something
> > > both gcc and g++ accept.
> > 
> > Why? Is someone compiling the kernel with g++?
> 
> I do!
> https://marc.info/?l=linux-acpi&m=158343373912366&w=4
> 

Lol.  But why?

Patch
diff mbox series

--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -248,8 +248,8 @@  void render_sigset_t(struct seq_file *m, const char *header,
 	seq_putc(m, '\n');
 }
 
-static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign,
-				    sigset_t *catch)
+static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *sigign,
+				    sigset_t *sigcatch)
 {
 	struct k_sigaction *k;
 	int i;
@@ -257,9 +257,9 @@  static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign,
 	k = p->sighand->action;
 	for (i = 1; i <= _NSIG; ++i, ++k) {
 		if (k->sa.sa_handler == SIG_IGN)
-			sigaddset(ign, i);
+			sigaddset(sigign, i);
 		else if (k->sa.sa_handler != SIG_DFL)
-			sigaddset(catch, i);
+			sigaddset(sigcatch, i);
 	}
 }