All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: integrate macro definitions into include/linux/usb.h
@ 2020-08-25 15:44 yanfei.xu
  2020-08-28  7:48 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: yanfei.xu @ 2020-08-25 15:44 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, linux-kernel

From: Yanfei Xu <yanfei.xu@windriver.com>

include/linux/usb.h also contains 'Hard limit' and 'Arbitrary limit'
macro definitions in it, hence we can integrate these from config.c
into include/linux/usb.h

Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
---
 drivers/usb/core/config.c | 3 ---
 include/linux/usb.h       | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 562a730befda..58c5d946cd86 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -14,9 +14,6 @@
 #include "usb.h"
 
 
-#define USB_MAXALTSETTING		128	/* Hard limit */
-
-#define USB_MAXCONFIG			8	/* Arbitrary limit */
 
 
 static inline const char *plural(int n)
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 20c555db4621..d0a117cfc6bd 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -275,9 +275,12 @@ void usb_put_intf(struct usb_interface *intf);
 
 /* Hard limit */
 #define USB_MAXENDPOINTS	30
+#define USB_MAXALTSETTING	128
+
 /* this maximum is arbitrary */
 #define USB_MAXINTERFACES	32
 #define USB_MAXIADS		(USB_MAXINTERFACES/2)
+#define USB_MAXCONFIG		8
 
 /*
  * USB Resume Timer: Every Host controller driver should drive the resume
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] USB: integrate macro definitions into include/linux/usb.h
  2020-08-25 15:44 [PATCH] USB: integrate macro definitions into include/linux/usb.h yanfei.xu
@ 2020-08-28  7:48 ` Greg KH
  2020-08-30  5:23   ` Xu, Yanfei
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-08-28  7:48 UTC (permalink / raw)
  To: yanfei.xu; +Cc: linux-usb, linux-kernel

On Tue, Aug 25, 2020 at 11:44:21PM +0800, yanfei.xu@windriver.com wrote:
> From: Yanfei Xu <yanfei.xu@windriver.com>
> 
> include/linux/usb.h also contains 'Hard limit' and 'Arbitrary limit'
> macro definitions in it, hence we can integrate these from config.c
> into include/linux/usb.h

Why?  No one uses these values outside of this .c file, so why put a
value in a global .h file?

Who else wants to use these values?  If something else needs it, then
sure, it could be moved, but until then, there's nothing wrong with the
existing code as-is from what I can tell.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] USB: integrate macro definitions into include/linux/usb.h
  2020-08-28  7:48 ` Greg KH
@ 2020-08-30  5:23   ` Xu, Yanfei
  0 siblings, 0 replies; 3+ messages in thread
From: Xu, Yanfei @ 2020-08-30  5:23 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, linux-kernel

I just think it is a clear up to make these macros get togather
which have the samilar attributes. That's why :)

Thanks,
Yanfei

On 8/28/20 3:48 PM, Greg KH wrote:
> On Tue, Aug 25, 2020 at 11:44:21PM +0800, yanfei.xu@windriver.com wrote:
>> From: Yanfei Xu <yanfei.xu@windriver.com>
>>
>> include/linux/usb.h also contains 'Hard limit' and 'Arbitrary limit'
>> macro definitions in it, hence we can integrate these from config.c
>> into include/linux/usb.h
> 
> Why?  No one uses these values outside of this .c file, so why put a
> value in a global .h file?
> 
> Who else wants to use these values?  If something else needs it, then
> sure, it could be moved, but until then, there's nothing wrong with the
> existing code as-is from what I can tell.
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-30  5:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 15:44 [PATCH] USB: integrate macro definitions into include/linux/usb.h yanfei.xu
2020-08-28  7:48 ` Greg KH
2020-08-30  5:23   ` Xu, Yanfei

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.