X-GM-THRID: 1283379429376 X-Google-Groups: outreachy-kernel X-Google-Thread: 9ca63f596c,145b1b526fdbd4a1 X-Google-Attributes: gid9ca63f596c,domainid0,private,googlegroup X-Google-NewGroupId: yes X-Received: by 10.42.53.80 with SMTP id m16mr10071241icg.26.1424444007327; Fri, 20 Feb 2015 06:53:27 -0800 (PST) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.182.42.202 with SMTP id q10ls335011obl.21.gmail; Fri, 20 Feb 2015 06:53:27 -0800 (PST) X-Received: by 10.182.112.167 with SMTP id ir7mr10192584obb.29.1424444007032; Fri, 20 Feb 2015 06:53:27 -0800 (PST) Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id ki8si3298761pdb.1.2015.02.20.06.53.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Feb 2015 06:53:26 -0800 (PST) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mail=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.09,615,1418079600"; d="scan'208";a="122695992" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Feb 2015 15:53:25 +0100 Date: Fri, 20 Feb 2015 15:53:20 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Yeliz Taneroglu cc: outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH] Staging: emxx_udc: Use min_t instead of min In-Reply-To: <1424436366-10134-1-git-send-email-yeliztaneroglu@gmail.com> Message-ID: References: <1424436366-10134-1-git-send-email-yeliztaneroglu@gmail.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 > --- > 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. >