All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Hawkins <a.hawkins@cabletime.com>
To: linux-mtd@lists.infradead.org
Subject: Bug in mtd_blkdevs-24.c for devfs
Date: 17 Jun 2004 15:41:51 +0100	[thread overview]
Message-ID: <1087483311.2602.11.camel@adh> (raw)

Hi,

I guess people don't generally use a large number of flash devices, but
if there are more than 10, then the devfs entries will be wrong because
of the following lines in add_mtd_blktrans_dev:

                char name[2];

                name[0] = '0' + new->devnum;
                name[1] = 0;

		new->blkcore_priv = 
			devfs_register(tr->blkcore_priv->devfs_dir_handle,
				       name, DEVFS_FL_DEFAULT, 				       tr->major,
				       new->devnum,         				       S_IFBLK|S_IRUGO|S_IWUGO,
				       &mtd_blktrans_ops, NULL);

For any devnum > 9, this will generate a punctuation character. The
following code is more correct (and is the same as in mtdchar.c)

		char name[10];

		sprintf(name,"%d",new->devnum);

		new->blkcore_priv = 
			devfs_register(tr->blkcore_priv->devfs_dir_handle,
				       name, DEVFS_FL_DEFAULT, 				       tr->major,
				       new->devnum,         				       S_IFBLK|S_IRUGO|S_IWUGO,
				       &mtd_blktrans_ops, NULL);

Apologies for the formatting, I can generate a patch if required...

Andy

                 reply	other threads:[~2004-06-17 14:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1087483311.2602.11.camel@adh \
    --to=a.hawkins@cabletime.com \
    --cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.