+ gpiolib-make-names-array-and-its-values-const.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     gpiolib: make names array and its values const
has been added to the -mm tree.  Its filename is
     gpiolib-make-names-array-and-its-values-const.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: gpiolib: make names array and its values const
From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

gpiolib doesn't need to modify the names and I assume most initializers
use string constants that shouldn't be modified anyhow.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Cc: Kevin Wells <kevin.wells@xxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/gpio/gpiolib.c      |    2 +-
 drivers/gpio/pca953x.c      |    2 +-
 include/asm-generic/gpio.h  |    2 +-
 include/linux/i2c/pca953x.h |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff -puN drivers/gpio/gpiolib.c~gpiolib-make-names-array-and-its-values-const drivers/gpio/gpiolib.c
--- a/drivers/gpio/gpiolib.c~gpiolib-make-names-array-and-its-values-const
+++ a/drivers/gpio/gpiolib.c
@@ -721,7 +721,7 @@ int gpio_export(unsigned gpio, bool dire
 	unsigned long		flags;
 	struct gpio_desc	*desc;
 	int			status = -EINVAL;
-	char			*ioname = NULL;
+	const char		*ioname = NULL;
 
 	/* can't export until sysfs is available ... */
 	if (!gpio_class.p) {
diff -puN drivers/gpio/pca953x.c~gpiolib-make-names-array-and-its-values-const drivers/gpio/pca953x.c
--- a/drivers/gpio/pca953x.c~gpiolib-make-names-array-and-its-values-const
+++ a/drivers/gpio/pca953x.c
@@ -72,7 +72,7 @@ struct pca953x_chip {
 	struct i2c_client *client;
 	struct pca953x_platform_data *dyn_pdata;
 	struct gpio_chip gpio_chip;
-	char **names;
+	const char *const *names;
 };
 
 static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val)
diff -puN include/asm-generic/gpio.h~gpiolib-make-names-array-and-its-values-const include/asm-generic/gpio.h
--- a/include/asm-generic/gpio.h~gpiolib-make-names-array-and-its-values-const
+++ a/include/asm-generic/gpio.h
@@ -99,7 +99,7 @@ struct gpio_chip {
 						struct gpio_chip *chip);
 	int			base;
 	u16			ngpio;
-	char			**names;
+	const char		*const *names;
 	unsigned		can_sleep:1;
 	unsigned		exported:1;
 };
diff -puN include/linux/i2c/pca953x.h~gpiolib-make-names-array-and-its-values-const include/linux/i2c/pca953x.h
--- a/include/linux/i2c/pca953x.h~gpiolib-make-names-array-and-its-values-const
+++ a/include/linux/i2c/pca953x.h
@@ -24,7 +24,7 @@ struct pca953x_platform_data {
 	int		(*teardown)(struct i2c_client *client,
 				unsigned gpio, unsigned ngpio,
 				void *context);
-	char		**names;
+	const char	*const *names;
 };
 
 #endif /* _LINUX_PCA953X_H */
_

Patches currently in -mm which might be from u.kleine-koenig@xxxxxxxxxxxxxx are

rtc-mc13783-fix-use-after-free-bug.patch
linux-next.patch
timer-print-function-name-for-timer-callbacks-modifying-preemption-count.patch
gpiolib-make-names-array-and-its-values-const.patch
gpiolib-a-gpio-is-unsigned-so-use-%u-to-print-it.patch
gpiolib-document-that-names-can-contain-printk-format-specifiers.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux