All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: cdnsp: Fixes incorrect value in ISOC TRB
@ 2021-03-08  7:31 Pawel Laszczak
  2021-03-08  7:36 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Laszczak @ 2021-03-08  7:31 UTC (permalink / raw)
  To: peter.chen
  Cc: gregkh, linux-usb, linux-kernel, kurahul, sparmar, Pawel Laszczak

From: Pawel Laszczak <pawell@cadence.com>

Fixes issue with priority of operator. Operator "|" priority is
higher then "? :".
To improve the readability the operator "? :" has been replaced with
"if ()" statement.

Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Signed-off-by: Pawel Laszczak <pawell@cadence.com>

---
Changelog:
v2:
- changed the commit log
- added separate "if" statement to improve readability

 drivers/usb/cdns3/cdnsp-ring.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/cdnsp-ring.c b/drivers/usb/cdns3/cdnsp-ring.c
index e15e13ba27dc..b23f09a68427 100644
--- a/drivers/usb/cdns3/cdnsp-ring.c
+++ b/drivers/usb/cdns3/cdnsp-ring.c
@@ -2198,7 +2198,10 @@ static int cdnsp_queue_isoc_tx(struct cdnsp_device *pdev,
 	 * inverted in the first TDs isoc TRB.
 	 */
 	field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) |
-		start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count);
+		TRB_SIA | TRB_TBC(burst_count);
+
+	if (!start_cycle)
+		field |= TRB_CYCLE;
 
 	/* Fill the rest of the TRB fields, and remaining normal TRBs. */
 	for (i = 0; i < trbs_per_td; i++) {
-- 
2.25.1


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

* Re: [PATCH v2] usb: cdnsp: Fixes incorrect value in ISOC TRB
  2021-03-08  7:31 [PATCH v2] usb: cdnsp: Fixes incorrect value in ISOC TRB Pawel Laszczak
@ 2021-03-08  7:36 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-03-08  7:36 UTC (permalink / raw)
  To: Pawel Laszczak; +Cc: peter.chen, linux-usb, linux-kernel, kurahul, sparmar

On Mon, Mar 08, 2021 at 08:31:03AM +0100, Pawel Laszczak wrote:
> From: Pawel Laszczak <pawell@cadence.com>
> 
> Fixes issue with priority of operator. Operator "|" priority is
> higher then "? :".
> To improve the readability the operator "? :" has been replaced with
> "if ()" statement.
> 
> Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> 
> ---
> Changelog:
> v2:
> - changed the commit log
> - added separate "if" statement to improve readability
> 
>  drivers/usb/cdns3/cdnsp-ring.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/cdns3/cdnsp-ring.c b/drivers/usb/cdns3/cdnsp-ring.c
> index e15e13ba27dc..b23f09a68427 100644
> --- a/drivers/usb/cdns3/cdnsp-ring.c
> +++ b/drivers/usb/cdns3/cdnsp-ring.c
> @@ -2198,7 +2198,10 @@ static int cdnsp_queue_isoc_tx(struct cdnsp_device *pdev,
>  	 * inverted in the first TDs isoc TRB.
>  	 */
>  	field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) |
> -		start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count);
> +		TRB_SIA | TRB_TBC(burst_count);
> +
> +	if (!start_cycle)
> +		field |= TRB_CYCLE;

Thank you for the change:

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

end of thread, other threads:[~2021-03-08  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08  7:31 [PATCH v2] usb: cdnsp: Fixes incorrect value in ISOC TRB Pawel Laszczak
2021-03-08  7:36 ` Greg KH

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.