[PATCH 5/5] USB: Add format_template attribute to struct usb_class_driver

2017-11-12 Thread Rasmus Villemoes
This serves as human-readable documentation as well as allowing the
format_template plugin to complain about any static initializers of this
struct member that do not have the same set of printf specifiers.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 include/linux/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/usb.h b/include/linux/usb.h
index 9c63792a8134..8d48c0cd1c01 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1236,7 +1236,7 @@ extern struct bus_type usb_bus_type;
  * parameters used for them.
  */
 struct usb_class_driver {
-   char *name;
+   char *name __format_template("foobar_%d");
char *(*devnode)(struct device *dev, umode_t *mode);
const struct file_operations *fops;
int minor_base;
-- 
2.11.0

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


[PATCH 1/5] plugins: implement format_template attribute

2017-11-12 Thread Rasmus Villemoes
Most format strings in the kernel are string literals, so the compiler
and other static analyzers can do type checking. This plugin covers a
few of the remaining cases, by introducing a format_template
attribute.

Consider struct usb_class_driver. Its member 'name' is used as a
format string in usb_register_dev(), and that use obviously expects
that the format string contains a single "%d" (or maybe %u). So the
idea is that we simply attach __format_template("%d") to the
declaration of the name member of struct usb_class_driver. We can then
check that any static initialization of that member is with a string
literal with the same set of specifiers. This is what the plugin
currently does. There are a number of things it also could/should do:

- Check run-time assignments of literals to a __format_template
annotated struct member.

- Use this at call sites of *printf functions, where the format string
argument is a __format_template annotated struct member - that is, use
the template in lieu of a string literal. For now, this is not
implemented - mostly because I'm lazy and don't want to write my own
format checking code (again), and I suppose there should be an internal
gcc function I could (ab)use to say "check this variadic function call,
but use _this_ as format string".

- It should also be possible to attach it to function parameters -
e.g. the namefmt parameter to kthread_create_on_cpu should have
__format_template("%u"); its only caller is __smpboot_create_thread
which passes struct smp_hotplug_thread->thread_comm, which in turn
should also have that attribute. Combined with the above, this would
check the entire chain from initializer to sprintf().

While strictly speaking "%*s" and "%d %s" both expect (int, const
char*), they're morally distinct, so I don't want to treat them as
equivalent. If this is ever a problem, I think one should let the
attribute take an optional flag argument, which could then control how
strict or lax the checking should be.

I'm not sure how much this affects compilation time, but there's not
really any point in building with this all the time - it should
suffice that the various build bots do it once in a while. Even
without the plugin, the __format_template(...) in headers serve
as concise documentation.

Applying this attribute to smp_hotplug_thread::thread_comm and modifying
kernel/watchdog.c slightly, an example of the error message produced for
violations is:

kernel/watchdog.c:528:1: error: initializer string 'watchdog/%u %d' contains 
extra format specifier '%d' compared to format template 'foobar/%u'

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 arch/Kconfig |  18 ++
 include/linux/compiler.h |   6 +
 scripts/Makefile.gcc-plugins |   2 +
 scripts/gcc-plugins/format_template_plugin.c | 331 +++
 4 files changed, 357 insertions(+)
 create mode 100644 scripts/gcc-plugins/format_template_plugin.c

diff --git a/arch/Kconfig b/arch/Kconfig
index 057370a0ac4e..71c582eaeb69 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -517,6 +517,24 @@ config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
  in structures.  This reduces the performance hit of RANDSTRUCT
  at the cost of weakened randomization.
 
+config GCC_PLUGIN_FORMAT_TEMPLATE
+   bool "Enable format_template attribute"
+   depends on GCC_PLUGINS
+   help
+ This plugin implements a format_template attribute which can
+ be attached to struct members which are supposed to hold a
+ (printf) format string. This allows the compiler to check
+ that (a) any string statically assigned to such a struct
+ member has format specifiers compatible with those in the
+ template and (b) when such a struct member is used as the
+ format argument to a printf function, use the template in
+ lieu of a string literal to do type checking of the variadic
+ arguments.
+
+ Even without using the plugin, attaching the format_template
+ attribute can be beneficial, since it serves as
+ documentation.
+
 config HAVE_CC_STACKPROTECTOR
bool
help
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 202710420d6d..478914ad280b 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -625,4 +625,10 @@ static __always_inline void __write_once_size(volatile 
void *p, void *res, int s
(_p1); \
 })
 
+#ifdef HAVE_ATTRIBUTE_FORMAT_TEMPLATE
+#define __format_template(x) __attribute__((__format_template__(x)))
+#else
+#define __format_template(x)
+#endif
+
 #endif /* __LINUX_COMPILER_H */
diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins
index b2a95af7df18..2f9bc96aab90 100644
--- a/scripts/Makefile.gcc-plugins
+++ b/scripts/Makefile.gcc-plugins
@@ -35,6 +35,8 

[PATCH] usb: musb: remove redundant stack buffers

2016-08-04 Thread Rasmus Villemoes
aDate is always the empty string, so entirely pointless. The aRevision
formatting might as well be done as part of the pr_debug() call - that
also avoids it altogether if pr_debug is compiled out.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 drivers/usb/musb/musb_core.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 74fc3069cb42..1724f1889c99 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1448,7 +1448,7 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 {
u8 reg;
char *type;
-   char aInfo[90], aRevision[32], aDate[12];
+   char aInfo[90];
void __iomem*mbase = musb->mregs;
int status = 0;
int i;
@@ -1482,7 +1482,6 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 
pr_debug("%s: ConfigData=0x%02x (%s)\n", musb_driver_name, reg, aInfo);
 
-   aDate[0] = 0;
if (MUSB_CONTROLLER_MHDRC == musb_type) {
musb->is_multipoint = 1;
type = "M";
@@ -1497,11 +1496,10 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 
/* log release info */
musb->hwvers = musb_read_hwvers(mbase);
-   snprintf(aRevision, 32, "%d.%d%s", MUSB_HWVERS_MAJOR(musb->hwvers),
-   MUSB_HWVERS_MINOR(musb->hwvers),
-   (musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
-   pr_debug("%s: %sHDRC RTL version %s %s\n",
-musb_driver_name, type, aRevision, aDate);
+   pr_debug("%s: %sHDRC RTL version %d.%d%s\n",
+musb_driver_name, type, MUSB_HWVERS_MAJOR(musb->hwvers),
+MUSB_HWVERS_MINOR(musb->hwvers),
+(musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
 
/* configure ep0 */
musb_configure_ep0(musb);
-- 
2.1.4

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


[RFC 7/7] USB: usbatm: avoid fragile and inefficient snprintf use

2016-03-08 Thread Rasmus Villemoes
Passing overlapping source and destination is fragile, and in this
case we can even simplify the code and avoid the huge stack buffer by
using the %p extension for printing a small hex dump.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 drivers/usb/atm/usbatm.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index db322d9ccb6e..fb47f9883056 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -1331,15 +1331,12 @@ MODULE_VERSION(DRIVER_VERSION);
 static int usbatm_print_packet(struct usbatm_data *instance,
   const unsigned char *data, int len)
 {
-   unsigned char buffer[256];
-   int i = 0, j = 0;
+   int i, j;
 
for (i = 0; i < len;) {
-   buffer[0] = '\0';
-   sprintf(buffer, "%.3d :", i);
-   for (j = 0; (j < 16) && (i < len); j++, i++)
-   sprintf(buffer, "%s %2.2x", buffer, data[i]);
-   dev_dbg(>usb_intf->dev, "%s", buffer);
+   j = min(16, len-i);
+   dev_dbg(>usb_intf->dev, "%.3d : %*ph", i, j, data + 
i);
+   i += j;
}
return i;
 }
-- 
2.1.4

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


Re: [PATCH 3/3] usb: musb: remove redundant stack buffer

2015-12-03 Thread Rasmus Villemoes
On Tue, Dec 01 2015, Felipe Balbi <ba...@ti.com> wrote:

> Hi,
>
> Rasmus Villemoes <li...@rasmusvillemoes.dk> writes:
>> aRevision is only used once, so we might as well do the formatting as
>> part of the pr_debug. This eliminates the stack buffer, and avoids
>> doing the formatting at all when pr_debug is compiled out.
>>
>> Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
>
> this needs to be rebased on top of my testing/next:

git url, please.

> checking file drivers/usb/musb/musb_core.c
> Hunk #1 FAILED at 1458.
> Hunk #2 FAILED at 1506.
> 2 out of 2 hunks FAILED

Did 1/3 and 2/3 apply? They touch some of the same lines, so clearly 3/3
wouldn't apply by itself.

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


Re: [PATCH 1/3] usb: musb: convert printk to pr_*

2015-11-30 Thread Rasmus Villemoes
On Sat, Nov 28 2015, Sergei Shtylyov  wrote:

> On 11/28/2015 3:04 AM, Greg Kroah-Hartman wrote:
>
 This file already uses pr_debug in a few places; this converts the
 remaining printks.
>>>
>>> Are you aware that printk(KERN_DEBUG, ...) and pr_debug() are not 
>>> equivalent?
>>
>> Yes, and that is a good thing, you should be using pr_debug() instead of
>> printk(KERN_DEBUG...).
>>
>> Why object to something like this?
>
>I'm not objecting, just asking. There have been many cases in my
> practice where a patch author wasn't aware of that...

I was aware, but I can see how the commit message could indicate
otherwise. I don't feel strongly for the conversion, so I could redo 2/3
and 3/3 (which should be uncontroversial cleanups).

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


[PATCH 2/3] usb: musb: remove always-empty string from debug output

2015-11-27 Thread Rasmus Villemoes
aDate is always empty, hence pointless.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 drivers/usb/musb/musb_core.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 1ac976332060..86dce9635b14 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1458,7 +1458,7 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 {
u8 reg;
char *type;
-   char aInfo[90], aRevision[32], aDate[12];
+   char aInfo[90], aRevision[32];
void __iomem*mbase = musb->mregs;
int status = 0;
int i;
@@ -1492,7 +1492,6 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 
pr_debug("%s: ConfigData=0x%02x (%s)\n", musb_driver_name, reg, aInfo);
 
-   aDate[0] = 0;
if (MUSB_CONTROLLER_MHDRC == musb_type) {
musb->is_multipoint = 1;
type = "M";
@@ -1510,8 +1509,8 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
snprintf(aRevision, 32, "%d.%d%s", MUSB_HWVERS_MAJOR(musb->hwvers),
MUSB_HWVERS_MINOR(musb->hwvers),
(musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
-   pr_debug("%s: %sHDRC RTL version %s %s\n",
-musb_driver_name, type, aRevision, aDate);
+   pr_debug("%s: %sHDRC RTL version %s\n",
+musb_driver_name, type, aRevision);
 
/* configure ep0 */
musb_configure_ep0(musb);
-- 
2.6.1

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


[PATCH 3/3] usb: musb: remove redundant stack buffer

2015-11-27 Thread Rasmus Villemoes
aRevision is only used once, so we might as well do the formatting as
part of the pr_debug. This eliminates the stack buffer, and avoids
doing the formatting at all when pr_debug is compiled out.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 drivers/usb/musb/musb_core.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 86dce9635b14..3e8d1bcfc1b5 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1458,7 +1458,7 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 {
u8 reg;
char *type;
-   char aInfo[90], aRevision[32];
+   char aInfo[90];
void __iomem*mbase = musb->mregs;
int status = 0;
int i;
@@ -1506,11 +1506,11 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
 
/* log release info */
musb->hwvers = musb_read_hwvers(mbase);
-   snprintf(aRevision, 32, "%d.%d%s", MUSB_HWVERS_MAJOR(musb->hwvers),
-   MUSB_HWVERS_MINOR(musb->hwvers),
-   (musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
-   pr_debug("%s: %sHDRC RTL version %s\n",
-musb_driver_name, type, aRevision);
+   pr_debug("%s: %sHDRC RTL version %d.%d%s\n",
+musb_driver_name, type,
+MUSB_HWVERS_MAJOR(musb->hwvers),
+MUSB_HWVERS_MINOR(musb->hwvers),
+(musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
 
/* configure ep0 */
musb_configure_ep0(musb);
-- 
2.6.1

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


[PATCH 1/3] usb: musb: convert printk to pr_*

2015-11-27 Thread Rasmus Villemoes
This file already uses pr_debug in a few places; this converts the
remaining printks.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
 drivers/usb/musb/musb_core.c | 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 18cfc0a361cb..1ac976332060 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1360,8 +1360,7 @@ static int ep_config_from_table(struct musb *musb)
break;
}
 
-   printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
-   musb_driver_name, fifo_mode);
+   pr_debug("%s: setup fifo_mode %d\n", musb_driver_name, fifo_mode);
 
 
 done:
@@ -1390,7 +1389,7 @@ done:
musb->nr_endpoints = max(epn, musb->nr_endpoints);
}
 
-   printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n",
+   pr_debug("%s: %d/%d max ep, %d/%d memory\n",
musb_driver_name,
n + 1, musb->config->num_eps * 2 - 1,
offset, (1 << (musb->config->ram_bits + 2)));
@@ -1491,8 +1490,7 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
if (reg & MUSB_CONFIGDATA_SOFTCONE)
strcat(aInfo, ", SoftConn");
 
-   printk(KERN_DEBUG "%s: ConfigData=0x%02x (%s)\n",
-   musb_driver_name, reg, aInfo);
+   pr_debug("%s: ConfigData=0x%02x (%s)\n", musb_driver_name, reg, aInfo);
 
aDate[0] = 0;
if (MUSB_CONTROLLER_MHDRC == musb_type) {
@@ -1502,9 +1500,8 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
musb->is_multipoint = 0;
type = "";
 #ifndefCONFIG_USB_OTG_BLACKLIST_HUB
-   printk(KERN_ERR
-   "%s: kernel must blacklist external hubs\n",
-   musb_driver_name);
+   pr_err("%s: kernel must blacklist external hubs\n",
+  musb_driver_name);
 #endif
}
 
@@ -1513,8 +1510,8 @@ static int musb_core_init(u16 musb_type, struct musb 
*musb)
snprintf(aRevision, 32, "%d.%d%s", MUSB_HWVERS_MAJOR(musb->hwvers),
MUSB_HWVERS_MINOR(musb->hwvers),
(musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
-   printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n",
-   musb_driver_name, type, aRevision, aDate);
+   pr_debug("%s: %sHDRC RTL version %s %s\n",
+musb_driver_name, type, aRevision, aDate);
 
/* configure ep0 */
musb_configure_ep0(musb);
-- 
2.6.1

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


[PATCH] usb: gadget: dummy-hcd: Remove utf8 from format string

2015-02-05 Thread Rasmus Villemoes
Not everybody uses a utf8 locale (unfortunately), so let's avoid
non-ascii characters in the kernel log. Replace the 3-byte utf8
sequence with a 3-byte ascii equivalent.

Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
 drivers/usb/gadget/udc/dummy_hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/dummy_hcd.c 
b/drivers/usb/gadget/udc/dummy_hcd.c
index 9c598801404c..3a30b6583613 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -2626,7 +2626,7 @@ static int __init init(void)
return -EINVAL;
 
if (mod_data.num  1 || mod_data.num  MAX_NUM_UDC) {
-   pr_err(Number of emulated UDC must be in range of 1…%d\n,
+   pr_err(Number of emulated UDC must be in range of 1...%d\n,
MAX_NUM_UDC);
return -EINVAL;
}
-- 
2.1.3

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


[PATCH] usb: musb: Fix a few off-by-one lengths

2014-11-27 Thread Rasmus Villemoes
!strncmp(buf, force host, 9) is true if and only if buf starts with
force hos. This was obviously not what was intended. The same error
exists for force full-speed, force high-speed and test
packet. Using strstarts avoids the error-prone hardcoding of the
prefix length.

For consistency, also change the other occurences of the !strncmp
idiom.

Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
Strictly speaking this is a user-visible change since buf came from
userspace. I can't believe anybody cares, though.

 drivers/usb/musb/musb_cppi41.c  |  4 ++--
 drivers/usb/musb/musb_debugfs.c | 16 
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index 5a9b977..560d54f 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -620,9 +620,9 @@ static int cppi41_dma_controller_start(struct 
cppi41_dma_controller *controller)
ret = of_property_read_string_index(np, dma-names, i, str);
if (ret)
goto err;
-   if (!strncmp(str, tx, 2))
+   if (strstarts(str, tx))
is_tx = 1;
-   else if (!strncmp(str, rx, 2))
+   else if (strstarts(str, rx))
is_tx = 0;
else {
dev_err(dev, Wrong dmatype %s\n, str);
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 4c21679..05d1b20 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -194,30 +194,30 @@ static ssize_t musb_test_mode_write(struct file *file,
if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
return -EFAULT;
 
-   if (!strncmp(buf, force host, 9))
+   if (strstarts(buf, force host))
test = MUSB_TEST_FORCE_HOST;
 
-   if (!strncmp(buf, fifo access, 11))
+   if (strstarts(buf, fifo access))
test = MUSB_TEST_FIFO_ACCESS;
 
-   if (!strncmp(buf, force full-speed, 15))
+   if (strstarts(buf, force full-speed))
test = MUSB_TEST_FORCE_FS;
 
-   if (!strncmp(buf, force high-speed, 15))
+   if (strstarts(buf, force high-speed))
test = MUSB_TEST_FORCE_HS;
 
-   if (!strncmp(buf, test packet, 10)) {
+   if (strstarts(buf, test packet)) {
test = MUSB_TEST_PACKET;
musb_load_testpacket(musb);
}
 
-   if (!strncmp(buf, test K, 6))
+   if (strstarts(buf, test K))
test = MUSB_TEST_K;
 
-   if (!strncmp(buf, test J, 6))
+   if (strstarts(buf, test J))
test = MUSB_TEST_J;
 
-   if (!strncmp(buf, test SE0 NAK, 12))
+   if (strstarts(buf, test SE0 NAK))
test = MUSB_TEST_SE0_NAK;
 
musb_writeb(musb-mregs, MUSB_TESTMODE, test);
-- 
2.0.4

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


[PATCH v3] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-25 Thread Rasmus Villemoes
Clearly this was meant to be an include guard, but a trailing
underscore was missing. It has been this way since the file was
introduced in 0fe6f1d1 (usb: udc: add Faraday fusb300 driver).

Fixes: 0fe6f1d1 (usb: udc: add Faraday fusb300 driver)
Cc: sta...@vger.kernel.org
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---

Notes:
v2: Add proper commit message.

v3: Add Fixes: and Cc: stable tags as requested by Felipe Balbi.

 drivers/usb/gadget/udc/fusb300_udc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fusb300_udc.h 
b/drivers/usb/gadget/udc/fusb300_udc.h
index ae811d8..ad39f89 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.h
+++ b/drivers/usb/gadget/udc/fusb300_udc.h
@@ -12,7 +12,7 @@
 
 
 #ifndef __FUSB300_UDC_H__
-#define __FUSB300_UDC_H_
+#define __FUSB300_UDC_H__
 
 #include linux/kernel.h
 
-- 
2.0.4

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


[PATCH] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
 drivers/usb/gadget/udc/fusb300_udc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fusb300_udc.h 
b/drivers/usb/gadget/udc/fusb300_udc.h
index ae811d8..ad39f89 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.h
+++ b/drivers/usb/gadget/udc/fusb300_udc.h
@@ -12,7 +12,7 @@
 
 
 #ifndef __FUSB300_UDC_H__
-#define __FUSB300_UDC_H_
+#define __FUSB300_UDC_H__
 
 #include linux/kernel.h
 
-- 
1.9.2

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


[PATCH v2] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Clearly this was meant to be an include guard, but a trailing
underscore was missing. It has been this way since the file was
introduced in 0fe6f1d1 (usb: udc: add Faraday fusb300 driver).

Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
 drivers/usb/gadget/udc/fusb300_udc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fusb300_udc.h 
b/drivers/usb/gadget/udc/fusb300_udc.h
index ae811d8..ad39f89 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.h
+++ b/drivers/usb/gadget/udc/fusb300_udc.h
@@ -12,7 +12,7 @@
 
 
 #ifndef __FUSB300_UDC_H__
-#define __FUSB300_UDC_H_
+#define __FUSB300_UDC_H__
 
 #include linux/kernel.h
 
-- 
2.0.4

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


Re: [PATCH v2] drivers: usb: gadget: fusb300_udc.h: Fix typo in include guard

2014-08-22 Thread Rasmus Villemoes
Felipe Balbi ba...@ti.com writes:

 On Fri, Aug 22, 2014 at 04:44:33PM +0200, Rasmus Villemoes wrote:
 Clearly this was meant to be an include guard, but a trailing
 underscore was missing. It has been this way since the file was
 introduced in 0fe6f1d1 (usb: udc: add Faraday fusb300 driver).
 

 right here you need to have:

 Fixes: 0fe6f1d1 (usb: udc: add Faraday fusb300 driver)
 Cc: sta...@vger.kernel.org

Really? I can't see that it satisfies the
Documentation/stable_kernel_rules.txt. There's no chance of build error, since 
the
file is only included directly from a single .c file. As you can see on
LKML I've sent a few handfuls of similar patches all over the tree; IMHO
none of them qualify for stable.

If you insist, I'll add the Fixes and Cc tags.

Thanks,
Rasmus
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html