Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp434036ybz; Wed, 22 Apr 2020 00:51:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLz3EifgnSjTURzVZstmUo5zM97L/8o5ZCA2mTR+AFDr8w7Or2Qv5/ekx6RbQmhzq1Zc+b3 X-Received: by 2002:a17:906:b28f:: with SMTP id q15mr23808873ejz.188.1587541906700; Wed, 22 Apr 2020 00:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587541906; cv=none; d=google.com; s=arc-20160816; b=tYXVblk+DliYD4GMnJU+s6IH9gZcOiNZX73x593y62+kvfchtIIHC/4Ih2Du2eSLks Z284GCX9T4N3m/aq3YXANQrHsRhaTz44z4fj+Wxrj00rpZP4Un74hn+0RYCX84IKWng0 uf/uz7MJGSt0gF+ARaSMi4fz6kGcijwRshi8f4BQaK/P/eeTNhIPfoppU/9WbGtE+/FT Ar/RLKDh7VtBnlFUMYUTUeq/ADLjN5ZfYQqHkucEJ6J18MITE17tsb8Avk+h8X4R7WoC mwXlf9MXTOoArFR6lLQ0bUFgN4bx8mMXHBVtt+Y08T5sW2tg1NjXHskW5xCVq9mRcaJO N0Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=epLkk574xfUuwBYwyvkq3l716pcv348uQ4qJKUQHi4U=; b=t3dkE1TnqdWR9VSq+MyrrH2et5g1xNw3LQR0Dk9ysDb7ltLt+CLr4c2nu2X1LnRfi5 O0ljMJr3iBaiiERnuBzQAb082peaag+KED+FjD4vK3jj49KW7CHBnxx5xz66410XqMQR tNLLBeC0TEpFCw8OE3eL3Nf0SonDlAbzdeOUWEkbaETS2ZI5c0wtZ+WmJ2a94u3llrCO 1G5s0xiGM0j0vOugNSCqw2Kl3g1kJjSFSM7BXsbABkpJvTlAMJJPpmoNdVnCmJQFRG/g nl6ml3Hd6EbuRLAAIqAN4ww/C21rDfHNtC4iX2xqN92TCU7OS7u5tZBr9bBKbJqy2Rnm Bf3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si3092752edr.382.2020.04.22.00.51.23; Wed, 22 Apr 2020 00:51:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbgDVHtF (ORCPT + 99 others); Wed, 22 Apr 2020 03:49:05 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43728 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbgDVHtE (ORCPT ); Wed, 22 Apr 2020 03:49:04 -0400 Received: by mail-lj1-f193.google.com with SMTP id l19so1196734lje.10; Wed, 22 Apr 2020 00:49:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=epLkk574xfUuwBYwyvkq3l716pcv348uQ4qJKUQHi4U=; b=QQmRpP8qUwwXXpYQHOlJPCrw9P+RsiQtId6ba1aS5qRY7JJhXBvtwxOiY3/hywH4/n J6dWHLnEGTtgKn4d7N49qpZq0kQYqsO05tcRzFXF2RPfIWvIYL6CwL+hZ9IxnnnnoqIS 5u4LkHiMvy5CZDtoS+qSYrMbCh5B9YIUWhUCcMH4YZX6nd1RscYOgP6Rr8piB58B4UKL ECKt8xAFK38PsgCdcexqCJzIfKCyliD3wYlSa9Lgr01bGxVrO7zIq0CjP4NYzuQOvSHr sFGopWDZGs3VDU3q0NPwla/apvDKDLzvhIdckB+v95CiUfyI2QMG+ZQZsHj0xiBp3VdQ 62rg== X-Gm-Message-State: AGi0PuaMdhVCGB/Et0pBCiTS1qz3OF+GMhAHOFPw5I+ZXpmuXaAZ1zxW VS5dR9czyin5TQza9xFPXrOPghaT X-Received: by 2002:a2e:b53b:: with SMTP id z27mr11767732ljm.114.1587541741978; Wed, 22 Apr 2020 00:49:01 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id u13sm3872384lji.27.2020.04.22.00.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 00:49:01 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1jRA84-0006dZ-5Z; Wed, 22 Apr 2020 09:49:08 +0200 Date: Wed, 22 Apr 2020 09:49:08 +0200 From: Johan Hovold To: Jason Yan 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 Message-ID: <20200422074908.GJ18608@localhost> References: <20200409085143.46078-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200409085143.46078-1-yanaijie@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Jason Yan 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