Re: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Felipe Balbi
Hi,


On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
 Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org

I need a sensible commit log for this. Why do we need to change all
min() to min_t() ?

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Tanya Brokhman
 
 On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
  Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org
 
 I need a sensible commit log for this. Why do we need to change all
 min() to min_t() ?
 

Actually, Alan asked me to make this change in one place in dummy_hcd. I
wasn't aware of the min_t macro before that. So when I searched the code for
other places I found quite a few and just thought that it would be nicer
to use min_t() instead of min() with casting. 
So we don't need to make this change. Everything works as is. This patch
only makes the code look nicer, nothing more.
I can elaborate the above in the commit log if you want.


Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.




___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Felipe Balbi
Hi,

On Mon, Jun 13, 2011 at 02:52:34PM +0300, Tanya Brokhman wrote:
  On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
   Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org
  
  I need a sensible commit log for this. Why do we need to change all
  min() to min_t() ?
  
 
 Actually, Alan asked me to make this change in one place in dummy_hcd. I
 wasn't aware of the min_t macro before that. So when I searched the code for
 other places I found quite a few and just thought that it would be nicer
 to use min_t() instead of min() with casting. 
 So we don't need to make this change. Everything works as is. This patch
 only makes the code look nicer, nothing more.
 I can elaborate the above in the commit log if you want.

Yes, that's what I need. The question was supposed to be answered by the
commit log ;-)

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Alan Stern
On Mon, 13 Jun 2011, Tanya Brokhman wrote:

  
  On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
   Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org
  
  I need a sensible commit log for this. Why do we need to change all
  min() to min_t() ?
  
 
 Actually, Alan asked me to make this change in one place in dummy_hcd. I
 wasn't aware of the min_t macro before that. So when I searched the code for
 other places I found quite a few and just thought that it would be nicer
 to use min_t() instead of min() with casting. 
 So we don't need to make this change. Everything works as is. This patch
 only makes the code look nicer, nothing more.
 I can elaborate the above in the commit log if you want.

The change I suggested involved replacing two typecasts with a single 
min_t.  All (or almost all) the places this patch touches currently 
contain only one typecast, so the motivation for changing them is a lot 
weaker.

Alan Stern

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Tanya Brokhman
 
 The change I suggested involved replacing two typecasts with a single
 min_t.  All (or almost all) the places this patch touches currently
 contain only one typecast, so the motivation for changing them is a lot
 weaker.
 
You're right. So what's the final call on this one? Do you think it can be
merged or you prefer not change anything? I personally think the code looks
nicer using min_t instead of min with casting but that's just my opinion and
of course there are arguments against this patch.


Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.





___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Alan Stern
On Mon, 13 Jun 2011, Tanya Brokhman wrote:

  
  The change I suggested involved replacing two typecasts with a single
  min_t.  All (or almost all) the places this patch touches currently
  contain only one typecast, so the motivation for changing them is a lot
  weaker.
  
 You're right. So what's the final call on this one? Do you think it can be
 merged or you prefer not change anything? I personally think the code looks
 nicer using min_t instead of min with casting but that's just my opinion and
 of course there are arguments against this patch.

I don't care either way.  It's up to you and Felipe.

Alan Stern

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Felipe Balbi
Hi,

On Mon, Jun 13, 2011 at 03:03:44PM -0400, Alan Stern wrote:
   The change I suggested involved replacing two typecasts with a single
   min_t.  All (or almost all) the places this patch touches currently
   contain only one typecast, so the motivation for changing them is a lot
   weaker.
   
  You're right. So what's the final call on this one? Do you think it can be
  merged or you prefer not change anything? I personally think the code looks
  nicer using min_t instead of min with casting but that's just my opinion and
  of course there are arguments against this patch.
 
 I don't care either way.  It's up to you and Felipe.

I guess it's better to have a more critical look at the arguments first.
Looking into dummy_hcd for instance, it doesn't appear like we need to
be int, it could be unsigned int. I just skimmed through the code, but
it looks like we will always hold = 0 values on that variable.

So go through that exercise first, then we look at the others. Blindly
changing to min_t() might not give us any improvements at all ;-)

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev