mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Cinege <dcinege@psychosis.com>
To: Sandy Harris <sandy@storm.ca>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: md= broken. Found problem. Can't fix it.  : (
Date: Sat, 20 Jan 2001 17:39:46 -0500	[thread overview]
Message-ID: <3A6A13B2.1F4737E2@psychosis.com> (raw)
In-Reply-To: <3A6A044F.7974AF67@psychosis.com> <3A6A0A20.18362B90@storm.ca>

Sandy Harris wrote:
> Looks to me like this parsing code unnecessarily and rather clumsily 
> re-invents strtok

The original parsing code is this:
		if ((str = strchr(str, ',')) != NULL)
			str++;
Which effectivly steps through
		/dev/sda1,/dev/sdab1,/dev/sdc1
like this
		str == /dev/sda1,/dev/sdab1,/dev/sdc1
		str == /dev/sdab1,/dev/sdc1
		str == /dev/sdc1

My code:	char *ndevstr;
		ndevstr = strchr(str, ',');
		if (ndevstr != NULL)	*ndevstr++ = 0;	
		...
		str = ndevstr

Works perfectly. I don't find it 'clumsy' or more complex at all. (I don't care
for strtok, nor did I even know the kernel had it)


However I don't see this critique of coding style helping the problem I'm
seeing:

	name_to_kdev_t(str);
Returns a bad value. Yet
	name_to_kdev_t("/dev/sdd5");
does not. The strange thing is
	printk("Checking: '%s'\n", str);
shows str does infact contain a proper string.

It appears str does not get passed to name_to_kdev_t() properly,
and I have no idea why. Both my testing code and the original code
exhibit the same problem.


-- 
"Nobody will ever be safe until the last cop is dead."
		NH Rep. Tom Alciere - (My new Hero)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-20 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-20 21:34 Dave Cinege
2001-01-20 21:58 ` Sandy Harris
2001-01-20 22:28   ` Andi Kleen
2001-01-22 14:09     ` Ingo Oeser
2001-01-20 22:39   ` Dave Cinege [this message]
     [not found] <3A6A1512.C2684CCC@interlog.com>
2001-01-20 23:21 ` Dave Cinege

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=3A6A13B2.1F4737E2@psychosis.com \
    --to=dcinege@psychosis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandy@storm.ca \
    /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®