All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: Jesse Barnes <jbarnes@virtuousgeek.org>,
	David Woodhouse <dwmw2@infradead.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-pci@vger.kernel.org, davem@davemloft.net
Subject: [patch 01/04] MTD: handle pci_name() being const
Date: Wed, 2 Jul 2008 13:24:43 -0700	[thread overview]
Message-ID: <20080702202443.GA14024@kroah.com> (raw)
In-Reply-To: <20080702202200.GA14021@kroah.com>

[-- Attachment #1: mtd-handle-pci_name-being-const.patch --]
[-- Type: text/plain, Size: 1700 bytes --]

This changes the MTD core to handle pci_name() now returning a constant
string.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mtd/devices/block2mtd.c |    8 +++++---
 include/linux/mtd/map.h         |    2 +-
 include/linux/mtd/mtd.h         |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -241,6 +241,7 @@ static struct block2mtd_dev *add_device(
 {
 	struct block_device *bdev;
 	struct block2mtd_dev *dev;
+	char *name;
 
 	if (!devname)
 		return NULL;
@@ -279,12 +280,13 @@ static struct block2mtd_dev *add_device(
 
 	/* Setup the MTD structure */
 	/* make the name contain the block device in */
-	dev->mtd.name = kmalloc(sizeof("block2mtd: ") + strlen(devname),
+	name = kmalloc(sizeof("block2mtd: ") + strlen(devname) + 1,
 			GFP_KERNEL);
-	if (!dev->mtd.name)
+	if (!name)
 		goto devinit_err;
 
-	sprintf(dev->mtd.name, "block2mtd: %s", devname);
+	sprintf(name, "block2mtd: %s", devname);
+	dev->mtd.name = name;
 
 	dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
 	dev->mtd.erasesize = erase_size;
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -189,7 +189,7 @@ typedef union {
 */
 
 struct map_info {
-	char *name;
+	const char *name;
 	unsigned long size;
 	resource_size_t phys;
 #define NO_XIP (-1UL)
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -121,7 +121,7 @@ struct mtd_info {
 	u_int32_t oobavail;  // Available OOB bytes per block
 
 	// Kernel-only stuff starts here.
-	char *name;
+	const char *name;
 	int index;
 
 	/* ecc layout structure pointer - read only ! */

-- 

  reply	other threads:[~2008-07-02 20:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 15:35 [PATCH] PCI: make pci_name use dev_name Greg Kroah-Hartman
2008-07-02 15:51 ` Greg Kroah-Hartman
2008-07-02 15:58   ` Jesse Barnes
2008-07-02 16:04     ` Greg KH
2008-07-02 20:22       ` Greg KH
2008-07-02 20:24         ` Greg Kroah-Hartman [this message]
2008-07-02 20:24         ` [patch 02/04] PCI: handle pci_name() being const Greg Kroah-Hartman
2008-07-03 19:33           ` Jesse Barnes
2008-07-02 20:24         ` [patch 03/04] 3c59x: " Greg Kroah-Hartman
2008-07-02 23:28           ` Andrew Morton
2008-07-03 12:17           ` Steffen Klassert
2008-07-03 15:43             ` Greg KH
2008-08-07  6:31             ` Jeff Garzik
2008-08-07 10:18               ` Steffen Klassert
2008-07-02 20:24         ` [patch 04/04] USB: " Greg Kroah-Hartman
2008-07-03 19:37         ` [PATCH] PCI: make pci_name use dev_name Jesse Barnes
2008-07-03 20:24           ` Greg KH
2008-07-03 20:33             ` Jesse Barnes
2008-07-03 20:52               ` Greg KH

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=20080702202443.GA14024@kroah.com \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@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 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.