From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A5DA1AD3F6 for ; Thu, 2 Jan 2025 22:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735855770; cv=none; b=Mxekb2PMdmoxAcppu5ZMtYhv+cgzjde9uIiD9ySOthLHCnhXoBRc/jIqrq666x5HBGQ9/OAhfy/VABmW3RXOWZqzdbInYsCNF1kotGgpUPn3MHOJTHi7aGub7GvBBaiDVGsRfljY1oAnN4xwN2M/CdJOdkHOnC5ayMYlcokevMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735855770; c=relaxed/simple; bh=LjeVe7p+Aum9VOt2LVWt2THAoUqbgpaQMPKY9qP06hI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rccQqVmVwIXsF9GCxDyOWjVmD+ix4JG95xoCV8Ktvv6WoO3ot4RwSO4t5TfKcr/cmWB3H7cepJ7nC59s1Z32FlaEuL1fvbgXNX4VKuPdNAPcAmyxHxGs0OtfcnmIAp1s/FHXL4rBH/GaXm+ooXj6sEMaL7WPqicqMvjLEPJ3oRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JCHLAivQ; arc=none smtp.client-ip=209.85.166.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JCHLAivQ" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-844dac0a8f4so863615939f.2 for ; Thu, 02 Jan 2025 14:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1735855768; x=1736460568; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=v8inhkGj25yUPyodyeM2Xw/fibo1Q0W+G8xd1drkkE8=; b=JCHLAivQEW+4DZNmrtmMD+4mFAynw0OuU91TVE4lvqR/sPh7WDpvNox8rcKF2H+NL9 kxCklpQ9SvQ1+YoLEEKuC1ZH+rMpZQJonjRiDtePBlHWsW3VO22aHFUpPImF3RCXgplp vu3gAQ6+469WceqfTqNxZ/9Cjs7qQobhwtxLs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735855768; x=1736460568; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v8inhkGj25yUPyodyeM2Xw/fibo1Q0W+G8xd1drkkE8=; b=hGozojGceE42L7CUU27FMsnEMVNrIt7DJG8u1njtT4NT0xHYcHW8cRjBFQfsFnSe2C pPVrDGQOF262RHNjlRTXlcEtr1TTqlMu3Yo/hXTe78QzAZUQgUDiEY3b60ciC6bAheG9 mhH+17NN1/K+nzn12KAQoGc1c3uv9zzTEHhfeO1m8IQyAtKrarpAk8q7BZikhZuQKL6l k3A7c/FG+UReo+rVdYFqv2Ry4DGYC/6OWvZWsAE8rCFf5X1xext2OAWA0wLdYaIOEBJr iY5fpkvTrncJzE4Xm1v348En+TpvaRvdrth48U3o0xTRaA173VgMHBa0w7yR7xY0mj+U LptA== X-Forwarded-Encrypted: i=1; AJvYcCXQ6vP+AzVwEhw+seE4c8KUIVn4dszUOzQxyPAM0VP54BxY/h95NzQTfR85WUb6rxDNS+YoM1SbqxjFbyE=@vger.kernel.org X-Gm-Message-State: AOJu0YyTe/eUxZbyWVpx862H2kQrl2EKKdCZ8fh34XiAIT908nJleJcw L37jbex4QY9eMbhAvi0/dryVJOrCkxsA3FD6GxKzR+tD1pF6Q1MR/XrDRUmS2js= X-Gm-Gg: ASbGncufH/Lntbyh+VkaR8jhbDEt8bRssRKs3fS3q9M7sQ9G6UVumuw0/uKL9bxU3xT 9z+vCEOszjr/lEUb5d4UZgXC5H/6eFMCOTj+U5NgPtCVmeF18i6H4gDRSAHQPQPJG9ImsDO5O9i x7DtGarqkBTh/r5qsl6KBDXsGm0XMssHCIDNFjihUXx7wQPBks5XXBZXk5C5JPgipnbhHGp4bBz 05FSF1pVHB0BJFgyPCnU2DgK2d/aMTiRbvM/NU2zCO6+79vcivRCFXe1GVy3q13bDPw X-Google-Smtp-Source: AGHT+IEpBPhutBtDX832fBzi0z0kuArKz06fve9d1rbkpO2l1JjgOG1TkdzWraNna74uUmIjZQaNXw== X-Received: by 2002:a05:6602:6c10:b0:841:a9d3:3b39 with SMTP id ca18e2360f4ac-8499e60dc31mr4768249139f.5.1735855768312; Thu, 02 Jan 2025 14:09:28 -0800 (PST) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e68c22176fsm7055056173.153.2025.01.02.14.09.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jan 2025 14:09:28 -0800 (PST) Message-ID: Date: Thu, 2 Jan 2025 15:09:27 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] usbip: Correct format specifier for seqnum from %d to %u To: Xiong Nandi , Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: "open list:USB OVER IP DRIVER" , open list , Shuah Khan References: <20241231161539.20192-1-xndchn@gmail.com> <20241231161539.20192-3-xndchn@gmail.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <20241231161539.20192-3-xndchn@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/31/24 09:15, Xiong Nandi wrote: > The seqnum field in USBIP protocol is an unsigned value. > So we fix the format specifier from %d to %u to correctly > display the value. > How did you find the problem? Include log from the tool or compiler output. > Signed-off-by: Xiong Nandi > --- > drivers/usb/usbip/stub_rx.c | 2 +- > drivers/usb/usbip/stub_tx.c | 2 +- > drivers/usb/usbip/vhci_rx.c | 6 +++--- > drivers/usb/usbip/vudc_tx.c | 2 +- > 4 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c > index 6338d818bc8b..9aa30ef76f3b 100644 > --- a/drivers/usb/usbip/stub_rx.c > +++ b/drivers/usb/usbip/stub_rx.c > @@ -269,7 +269,7 @@ static int stub_recv_cmd_unlink(struct stub_device *sdev, > return 0; > } > > - usbip_dbg_stub_rx("seqnum %d is not pending\n", > + usbip_dbg_stub_rx("seqnum %u is not pending\n", > pdu->u.cmd_unlink.seqnum); seqnum is unsigned long - don't you have to use %ul? > > /* > diff --git a/drivers/usb/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c > index b1c2f6781cb3..7eb2e074012a 100644 > --- a/drivers/usb/usbip/stub_tx.c > +++ b/drivers/usb/usbip/stub_tx.c > @@ -201,7 +201,7 @@ static int stub_send_ret_submit(struct stub_device *sdev) > > /* 1. setup usbip_header */ > setup_ret_submit_pdu(&pdu_header, urb); > - usbip_dbg_stub_tx("setup txdata seqnum: %d\n", > + usbip_dbg_stub_tx("setup txdata seqnum: %u\n", > pdu_header.base.seqnum); > > if (priv->sgl) { > diff --git a/drivers/usb/usbip/vhci_rx.c b/drivers/usb/usbip/vhci_rx.c > index 7f2d1c241559..a75f4a898a41 100644 > --- a/drivers/usb/usbip/vhci_rx.c > +++ b/drivers/usb/usbip/vhci_rx.c > @@ -66,7 +66,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, > spin_unlock_irqrestore(&vdev->priv_lock, flags); > > if (!urb) { > - pr_err("cannot find a urb of seqnum %u max seqnum %d\n", > + pr_err("cannot find a urb of seqnum %u max seqnum %u\n", > pdu->base.seqnum, > atomic_read(&vhci_hcd->seqnum)); > usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); > @@ -162,10 +162,10 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, > * already received the result of its submit result and gave > * back the URB. > */ > - pr_info("the urb (seqnum %d) was already given back\n", > + pr_info("the urb (seqnum %u) was already given back\n", > pdu->base.seqnum); > } else { > - usbip_dbg_vhci_rx("now giveback urb %d\n", pdu->base.seqnum); > + usbip_dbg_vhci_rx("now giveback urb %u\n", pdu->base.seqnum); > > /* If unlink is successful, status is -ECONNRESET */ > urb->status = pdu->u.ret_unlink.status; > diff --git a/drivers/usb/usbip/vudc_tx.c b/drivers/usb/usbip/vudc_tx.c > index 3ccb17c3e840..30c11bf9f4e7 100644 > --- a/drivers/usb/usbip/vudc_tx.c > +++ b/drivers/usb/usbip/vudc_tx.c > @@ -107,7 +107,7 @@ static int v_send_ret_submit(struct vudc *udc, struct urbp *urb_p) > > /* 1. setup usbip_header */ > setup_ret_submit_pdu(&pdu_header, urb_p); > - usbip_dbg_stub_tx("setup txdata seqnum: %d\n", > + usbip_dbg_stub_tx("setup txdata seqnum: %u\n", > pdu_header.base.seqnum); > usbip_header_correct_endian(&pdu_header, 1); > thanks, -- Shuah