All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: emxx_udc: Use min_t instead of min
@ 2015-02-20 12:46 Yeliz Taneroglu
  2015-02-20 14:53 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Yeliz Taneroglu @ 2015-02-20 12:46 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Yeliz Taneroglu

This patch focuses on fixing the following warning generated by
checkpatch.pl for the file emxx_udc.c

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 341b652..0351728 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -971,7 +971,7 @@ static int _nbu2ss_epn_out_data(
 		&& (iBufSize  >= sizeof(u32))) {
 		nret = _nbu2ss_out_dma(udc, req, num, iBufSize);
 	} else {
-		iBufSize = min(iBufSize, (u32)ep->ep.maxpacket);
+		iBufSize = min_t(u32, iBufSize, ep->ep.maxpacket);
 		nret = _nbu2ss_epn_out_pio(udc, ep, req, iBufSize);
 	}
 
@@ -1185,7 +1185,7 @@ static int _nbu2ss_epn_in_data(
 		&& (data_size >= sizeof(u32))) {
 		nret = _nbu2ss_in_dma(udc, ep, req, num, data_size);
 	} else {
-		data_size = min(data_size, (u32)ep->ep.maxpacket);
+		data_size = min_t(u32, data_size, ep->ep.maxpacket);
 		nret = _nbu2ss_epn_in_pio(udc, ep, req, data_size);
 	}
 
@@ -1604,7 +1604,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
 		return result;
 	}
 
-	length = min(udc->ctrl.wLength, (u16)sizeof(status_data));
+	length = min_t(u16, udc->ctrl.wLength, sizeof(status_data));
 
 	switch (recipient) {
 	case USB_RECIP_DEVICE:
-- 
1.8.3.2



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

* Re: [Outreachy kernel] [PATCH] Staging: emxx_udc: Use min_t instead of min
  2015-02-20 12:46 [PATCH] Staging: emxx_udc: Use min_t instead of min Yeliz Taneroglu
@ 2015-02-20 14:53 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2015-02-20 14:53 UTC (permalink / raw)
  To: Yeliz Taneroglu; +Cc: outreachy-kernel

On Fri, 20 Feb 2015, Yeliz Taneroglu wrote:

> This patch focuses on fixing the following warning generated by
> checkpatch.pl for the file emxx_udc.c

No warning is given.  The message is also very verbose.
kernelnewbies.org/PatchPhilosophy says:

In patch descriptions and in the subject, it is common and preferable to
use present-tense, imperative language. Write as if you are telling git
what to do with your patch.

And it is not necessary to give the file name.

So you could say "Replace min with min_t", and ideally explain why.

julia

> Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
> ---
>  drivers/staging/emxx_udc/emxx_udc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
> index 341b652..0351728 100644
> --- a/drivers/staging/emxx_udc/emxx_udc.c
> +++ b/drivers/staging/emxx_udc/emxx_udc.c
> @@ -971,7 +971,7 @@ static int _nbu2ss_epn_out_data(
>  		&& (iBufSize  >= sizeof(u32))) {
>  		nret = _nbu2ss_out_dma(udc, req, num, iBufSize);
>  	} else {
> -		iBufSize = min(iBufSize, (u32)ep->ep.maxpacket);
> +		iBufSize = min_t(u32, iBufSize, ep->ep.maxpacket);
>  		nret = _nbu2ss_epn_out_pio(udc, ep, req, iBufSize);
>  	}
>
> @@ -1185,7 +1185,7 @@ static int _nbu2ss_epn_in_data(
>  		&& (data_size >= sizeof(u32))) {
>  		nret = _nbu2ss_in_dma(udc, ep, req, num, data_size);
>  	} else {
> -		data_size = min(data_size, (u32)ep->ep.maxpacket);
> +		data_size = min_t(u32, data_size, ep->ep.maxpacket);
>  		nret = _nbu2ss_epn_in_pio(udc, ep, req, data_size);
>  	}
>
> @@ -1604,7 +1604,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
>  		return result;
>  	}
>
> -	length = min(udc->ctrl.wLength, (u16)sizeof(status_data));
> +	length = min_t(u16, udc->ctrl.wLength, sizeof(status_data));
>
>  	switch (recipient) {
>  	case USB_RECIP_DEVICE:
> --
> 1.8.3.2
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424436366-10134-1-git-send-email-yeliztaneroglu%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2015-02-20 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 12:46 [PATCH] Staging: emxx_udc: Use min_t instead of min Yeliz Taneroglu
2015-02-20 14:53 ` [Outreachy kernel] " Julia Lawall

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.