diff mbox series

[v9,1/3] usb: gadget: function: move u_f.h to include/linux/usb/func_utils.h

Message ID 20240116-ml-topic-u9p-v9-1-93d73f47b76b@pengutronix.de (mailing list archive)
State New
Headers show
Series usb: gadget: 9pfs transport | expand

Commit Message

Michael Grzeschik Aug. 23, 2024, 7:36 a.m. UTC
We move the func_utils.h header to include/linux/usb to be
able to compile function drivers outside of the
drivers/usb/gadget/function directory.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

---
v8 -> v9: -
v7 -> v8: -
v6 -> v7: -
v5 -> v6: -
v4 -> v5:
  - renamed to func_utils.h
v3 -> v4: -
v2 -> v3: -
v1 -> v2:
  - new introduced patch
---
 drivers/usb/gadget/configfs.c                              | 2 +-
 drivers/usb/gadget/function/f_fs.c                         | 2 +-
 drivers/usb/gadget/function/f_hid.c                        | 2 +-
 drivers/usb/gadget/function/f_loopback.c                   | 2 +-
 drivers/usb/gadget/function/f_midi.c                       | 2 +-
 drivers/usb/gadget/function/f_midi2.c                      | 2 +-
 drivers/usb/gadget/function/f_sourcesink.c                 | 2 +-
 drivers/usb/gadget/u_f.c                                   | 2 +-
 drivers/usb/gadget/u_f.h => include/linux/usb/func_utils.h | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

Comments

Christophe JAILLET Aug. 23, 2024, 8:30 a.m. UTC | #1
Le 23/08/2024 à 09:36, Michael Grzeschik a écrit :
> We move the func_utils.h header to include/linux/usb to be
> able to compile function drivers outside of the
> drivers/usb/gadget/function directory.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> 
> ---
> v8 -> v9: -
> v7 -> v8: -
> v6 -> v7: -
> v5 -> v6: -
> v4 -> v5:
>    - renamed to func_utils.h
> v3 -> v4: -
> v2 -> v3: -
> v1 -> v2:
>    - new introduced patch
> ---
>   drivers/usb/gadget/configfs.c                              | 2 +-
>   drivers/usb/gadget/function/f_fs.c                         | 2 +-
>   drivers/usb/gadget/function/f_hid.c                        | 2 +-
>   drivers/usb/gadget/function/f_loopback.c                   | 2 +-
>   drivers/usb/gadget/function/f_midi.c                       | 2 +-
>   drivers/usb/gadget/function/f_midi2.c                      | 2 +-
>   drivers/usb/gadget/function/f_sourcesink.c                 | 2 +-
>   drivers/usb/gadget/u_f.c                                   | 2 +-
>   drivers/usb/gadget/u_f.h => include/linux/usb/func_utils.h | 2 +-
>   9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
> index 0e7c1e947c0a0..0f8553795a8ed 100644
> --- a/drivers/usb/gadget/configfs.c
> +++ b/drivers/usb/gadget/configfs.c
> @@ -8,8 +8,8 @@
>   #include <linux/usb/composite.h>
>   #include <linux/usb/gadget_configfs.h>
>   #include <linux/usb/webusb.h>
> +#include <linux/usb/func_utils.h>

Hi,

Here and in the other files, maybe, keep alphabetic order?
(even if it is not already completely sorted)

>   #include "configfs.h"
> -#include "u_f.h"
>   #include "u_os_desc.h"
>   
>   int check_user_usb_string(const char *name,

...

> rename from drivers/usb/gadget/u_f.h
> rename to include/linux/usb/func_utils.h
> index e313c3b8dcb19..9f2a32c765260 100644
> --- a/drivers/usb/gadget/u_f.h
> +++ b/include/linux/usb/func_utils.h
> @@ -1,6 +1,6 @@
>   // SPDX-License-Identifier: GPL-2.0
>   /*
> - * u_f.h
> + * usbf_utils.h
>    *
>    * Utility definitions for USB functions
>    *
> 

Maybe the include guard could be updated as-well?

CJ
Michael Grzeschik Aug. 26, 2024, 9:49 p.m. UTC | #2
On Fri, Aug 23, 2024 at 10:30:09AM +0200, Christophe JAILLET wrote:
>Le 23/08/2024 à 09:36, Michael Grzeschik a écrit :
>>We move the func_utils.h header to include/linux/usb to be
>>able to compile function drivers outside of the
>>drivers/usb/gadget/function directory.
>>
>>Signed-off-by: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>>
>>---
>>v8 -> v9: -
>>v7 -> v8: -
>>v6 -> v7: -
>>v5 -> v6: -
>>v4 -> v5:
>>   - renamed to func_utils.h
>>v3 -> v4: -
>>v2 -> v3: -
>>v1 -> v2:
>>   - new introduced patch
>>---
>>  drivers/usb/gadget/configfs.c                              | 2 +-
>>  drivers/usb/gadget/function/f_fs.c                         | 2 +-
>>  drivers/usb/gadget/function/f_hid.c                        | 2 +-
>>  drivers/usb/gadget/function/f_loopback.c                   | 2 +-
>>  drivers/usb/gadget/function/f_midi.c                       | 2 +-
>>  drivers/usb/gadget/function/f_midi2.c                      | 2 +-
>>  drivers/usb/gadget/function/f_sourcesink.c                 | 2 +-
>>  drivers/usb/gadget/u_f.c                                   | 2 +-
>>  drivers/usb/gadget/u_f.h => include/linux/usb/func_utils.h | 2 +-
>>  9 files changed, 9 insertions(+), 9 deletions(-)
>>
>>diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
>>index 0e7c1e947c0a0..0f8553795a8ed 100644
>>--- a/drivers/usb/gadget/configfs.c
>>+++ b/drivers/usb/gadget/configfs.c
>>@@ -8,8 +8,8 @@
>>  #include <linux/usb/composite.h>
>>  #include <linux/usb/gadget_configfs.h>
>>  #include <linux/usb/webusb.h>
>>+#include <linux/usb/func_utils.h>
>
>Hi,
>
>Here and in the other files, maybe, keep alphabetic order?
>(even if it is not already completely sorted)
>
>>  #include "configfs.h"
>>-#include "u_f.h"
>>  #include "u_os_desc.h"
>>  int check_user_usb_string(const char *name,
>
>...
>
>>rename from drivers/usb/gadget/u_f.h
>>rename to include/linux/usb/func_utils.h
>>index e313c3b8dcb19..9f2a32c765260 100644
>>--- a/drivers/usb/gadget/u_f.h
>>+++ b/include/linux/usb/func_utils.h
>>@@ -1,6 +1,6 @@
>>  // SPDX-License-Identifier: GPL-2.0
>>  /*
>>- * u_f.h
>>+ * usbf_utils.h
>>   *
>>   * Utility definitions for USB functions
>>   *
>>
>
>Maybe the include guard could be updated as-well?
>

I reworked it in v10:

https://lore.kernel.org/all/20240116-ml-topic-u9p-v10-0-a85fdeac2c52@pengutronix.de/
diff mbox series

Patch

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 0e7c1e947c0a0..0f8553795a8ed 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -8,8 +8,8 @@ 
 #include <linux/usb/composite.h>
 #include <linux/usb/gadget_configfs.h>
 #include <linux/usb/webusb.h>
+#include <linux/usb/func_utils.h>
 #include "configfs.h"
-#include "u_f.h"
 #include "u_os_desc.h"
 
 int check_user_usb_string(const char *name,
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index e0ceaa7219493..411f0273d8d44 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -33,6 +33,7 @@ 
 #include <linux/usb/ccid.h>
 #include <linux/usb/composite.h>
 #include <linux/usb/functionfs.h>
+#include <linux/usb/func_utils.h>
 
 #include <linux/aio.h>
 #include <linux/kthread.h>
@@ -40,7 +41,6 @@ 
 #include <linux/eventfd.h>
 
 #include "u_fs.h"
-#include "u_f.h"
 #include "u_os_desc.h"
 #include "configfs.h"
 
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index 93dae017ae456..1293d8db07f6c 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -16,8 +16,8 @@ 
 #include <linux/wait.h>
 #include <linux/sched.h>
 #include <linux/usb/g_hid.h>
+#include <linux/usb/func_utils.h>
 
-#include "u_f.h"
 #include "u_hid.h"
 
 #define HIDG_MINORS	4
diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c
index 979b028edb99e..49b009a7d5d79 100644
--- a/drivers/usb/gadget/function/f_loopback.c
+++ b/drivers/usb/gadget/function/f_loopback.c
@@ -14,9 +14,9 @@ 
 #include <linux/module.h>
 #include <linux/err.h>
 #include <linux/usb/composite.h>
+#include <linux/usb/func_utils.h>
 
 #include "g_zero.h"
-#include "u_f.h"
 
 /*
  * LOOPBACK FUNCTION ... a testing vehicle for USB peripherals,
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 67052a664e746..1d7a955e990b4 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -33,8 +33,8 @@ 
 #include <linux/usb/gadget.h>
 #include <linux/usb/audio.h>
 #include <linux/usb/midi.h>
+#include <linux/usb/func_utils.h>
 
-#include "u_f.h"
 #include "u_midi.h"
 
 MODULE_AUTHOR("Ben Williamson");
diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c
index 3f63253ad3e07..3edc32c0e0983 100644
--- a/drivers/usb/gadget/function/f_midi2.c
+++ b/drivers/usb/gadget/function/f_midi2.c
@@ -18,8 +18,8 @@ 
 #include <linux/usb/gadget.h>
 #include <linux/usb/audio.h>
 #include <linux/usb/midi-v2.h>
+#include <linux/usb/func_utils.h>
 
-#include "u_f.h"
 #include "u_midi2.h"
 
 struct f_midi2;
diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c
index 6f3702210450f..ec5fd25020fdb 100644
--- a/drivers/usb/gadget/function/f_sourcesink.c
+++ b/drivers/usb/gadget/function/f_sourcesink.c
@@ -13,10 +13,10 @@ 
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/usb/composite.h>
+#include <linux/usb/func_utils.h>
 #include <linux/err.h>
 
 #include "g_zero.h"
-#include "u_f.h"
 
 /*
  * SOURCE/SINK FUNCTION ... a primary testing vehicle for USB peripheral
diff --git a/drivers/usb/gadget/u_f.c b/drivers/usb/gadget/u_f.c
index 6aea1ecb39999..9f90665827945 100644
--- a/drivers/usb/gadget/u_f.c
+++ b/drivers/usb/gadget/u_f.c
@@ -8,7 +8,7 @@ 
  * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
  */
 
-#include "u_f.h"
+#include <linux/usb/func_utils.h>
 #include <linux/usb/ch9.h>
 
 struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len)
diff --git a/drivers/usb/gadget/u_f.h b/include/linux/usb/func_utils.h
similarity index 99%
rename from drivers/usb/gadget/u_f.h
rename to include/linux/usb/func_utils.h
index e313c3b8dcb19..9f2a32c765260 100644
--- a/drivers/usb/gadget/u_f.h
+++ b/include/linux/usb/func_utils.h
@@ -1,6 +1,6 @@ 
 // SPDX-License-Identifier: GPL-2.0
 /*
- * u_f.h
+ * usbf_utils.h
  *
  * Utility definitions for USB functions
  *