mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: FabF <Fabian.Frederick@skynet.be>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.6.6-rc2-mm1] autofs parser simplified
Date: Wed, 21 Apr 2004 21:00:47 +0200	[thread overview]
Message-ID: <1082574046.1847.2.camel@bluerhyme.real3> (raw)

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

Andrew,

	Here's a patch to avoid int parse redundancy in autofs.
Could you apply ?

Regards,
Fabian

[-- Attachment #2: autofs1.diff --]
[-- Type: text/x-patch, Size: 1375 bytes --]

diff -Naur orig/fs/autofs/inode.c edited/fs/autofs/inode.c
--- orig/fs/autofs/inode.c	2004-04-04 05:37:38.000000000 +0200
+++ edited/fs/autofs/inode.c	2004-04-21 20:29:26.000000000 +0200
@@ -58,7 +58,7 @@
 	{Opt_err, NULL}
 };
 
-static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto)
+static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto) 
 {
 	char *p;
 	substring_t args[MAX_OPT_ARGS];
@@ -79,37 +79,28 @@
 		int token;
 		if (!*p)
 			continue;
-
 		token = match_token(p, autofs_tokens, args);
+
+		/*We only have %u tokens so...*/
+		if (match_int(&args[0], &option))
+			return 1;
 		switch (token) {
 		case Opt_fd:
-			if (match_int(&args[0], &option))
-				return 1;
 			*pipefd = option;
 			break;
 		case Opt_uid:
-			if (match_int(&args[0], &option))
-				return 1;
 			*uid = option;
 			break;
 		case Opt_gid:
-			if (match_int(&args[0], &option))
-				return 1;
 			*gid = option;
 			break;
 		case Opt_pgrp:
-			if (match_int(&args[0], &option))
-				return 1;
 			*pgrp = option;
 			break;
 		case Opt_minproto:
-			if (match_int(&args[0], &option))
-				return 1;
 			*minproto = option;
 			break;
 		case Opt_maxproto:
-			if (match_int(&args[0], &option))
-				return 1;
 			*maxproto = option;
 			break;
 		default:

             reply	other threads:[~2004-04-21 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-21 19:00 FabF [this message]
2004-04-21 19:19 ` Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1082574046.1847.2.camel@bluerhyme.real3 \
    --to=fabian.frederick@skynet.be \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®