From: Johan Hovold <johan@kernel.org>
To: Jason Yan <yanaijie@huawei.com>
Cc: johan@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: serial: garmin_gps: remove some defined but not used variables
Date: Wed, 22 Apr 2020 09:49:08 +0200 [thread overview]
Message-ID: <20200422074908.GJ18608@localhost> (raw)
In-Reply-To: <20200409085143.46078-1-yanaijie@huawei.com>
On Thu, Apr 09, 2020 at 04:51:43PM +0800, Jason Yan wrote:
> Fix the following gcc warning:
>
> drivers/usb/serial/garmin_gps.c:192:28: warning: ‘PRIVATE_REQ’ defined
> but not used [-Wunused-const-variable=]
> static unsigned char const PRIVATE_REQ[]
> ^~~~~~~~~~~
> drivers/usb/serial/garmin_gps.c:186:28: warning: ‘GARMIN_STOP_PVT_REQ’
> defined but not used [-Wunused-const-variable=]
> static unsigned char const GARMIN_STOP_PVT_REQ[]
> ^~~~~~~~~~~~~~~~~~~
> drivers/usb/serial/garmin_gps.c:184:28: warning: ‘GARMIN_START_PVT_REQ’
> defined but not used [-Wunused-const-variable=]
> static unsigned char const GARMIN_START_PVT_REQ[]
> ^~~~~~~~~~~~~~~~~~~~
> drivers/usb/serial/garmin_gps.c:182:28: warning:
> ‘GARMIN_APP_LAYER_REPLY’ defined but not used [-Wunused-const-variable=]
> static unsigned char const GARMIN_APP_LAYER_REPLY[]
> ^~~~~~~~~~~~~~~~~~~~~~
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
You should mention that this is a W=1 one warning which isn't enabled
by default.
> ---
> drivers/usb/serial/garmin_gps.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
> index ffd984142171..3b39d1e39fbf 100644
> --- a/drivers/usb/serial/garmin_gps.c
> +++ b/drivers/usb/serial/garmin_gps.c
> @@ -179,19 +179,10 @@ static unsigned char const GARMIN_START_SESSION_REPLY[]
> = { 0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0 };
> static unsigned char const GARMIN_BULK_IN_AVAIL_REPLY[]
> = { 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 };
> -static unsigned char const GARMIN_APP_LAYER_REPLY[]
> - = { 0x14, 0, 0, 0 };
> -static unsigned char const GARMIN_START_PVT_REQ[]
> - = { 20, 0, 0, 0, 10, 0, 0, 0, 2, 0, 0, 0, 49, 0 };
> -static unsigned char const GARMIN_STOP_PVT_REQ[]
> - = { 20, 0, 0, 0, 10, 0, 0, 0, 2, 0, 0, 0, 50, 0 };
> static unsigned char const GARMIN_STOP_TRANSFER_REQ[]
> = { 20, 0, 0, 0, 10, 0, 0, 0, 2, 0, 0, 0, 0, 0 };
> static unsigned char const GARMIN_STOP_TRANSFER_REQ_V2[]
> = { 20, 0, 0, 0, 10, 0, 0, 0, 1, 0, 0, 0, 0 };
> -static unsigned char const PRIVATE_REQ[]
> - = { 0x4B, 0x6E, 0x10, 0x01, 0xFF, 0, 0, 0, 0xFF, 0, 0, 0 };
> -
I'm reluctant to simply remove these as they document the protocol
without any real downsides besides the W=1 warning.
Johan
prev parent reply other threads:[~2020-04-22 7:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 8:51 [PATCH] USB: serial: garmin_gps: remove some defined but not used variables Jason Yan
2020-04-22 7:49 ` Johan Hovold [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200422074908.GJ18608@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.