From: Aashish Sharma <shraash@google.com>
To: "Daniel J . Ogorchock " <djogorchock@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Guenter Roeck <groeck@chromium.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Aashish Sharma <shraash@google.com>
Subject: [PATCH] HID: nintendo: Fix unused-const-variable compiler warning
Date: Wed, 20 Jul 2022 11:12:25 +0530 [thread overview]
Message-ID: <20220720054225.1623875-1-shraash@google.com> (raw)
The following compiler warning is produced when CONFIG_NINTENDO_FF
is not set:
>> drivers/hid/hid-nintendo.c:405:29: warning: 'JC_RUMBLE_ZERO_AMP_PKT_CNT'
defined but not used [-Wunused-const-variable=]
To fix this, move the variable 'JC_RUMBLE_ZERO_AMP_PKT_CNT' under the
CONFIG_NINTENDO_FF's conditional compilation block.
Signed-off-by: Aashish Sharma <shraash@google.com>
---
drivers/hid/hid-nintendo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 2204de889739..69de7504bdbc 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -402,8 +402,6 @@ struct joycon_input_report {
#define JC_RUMBLE_DATA_SIZE 8
#define JC_RUMBLE_QUEUE_SIZE 8
-static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
-
static const char * const joycon_player_led_names[] = {
LED_FUNCTION_PLAYER1,
LED_FUNCTION_PLAYER2,
@@ -1512,6 +1510,8 @@ static void joycon_clamp_rumble_freqs(struct joycon_ctlr *ctlr)
spin_unlock_irqrestore(&ctlr->lock, flags);
}
+static const unsigned short JC_RUMBLE_ZERO_AMP_PKT_CNT = 5;
+
static int joycon_set_rumble(struct joycon_ctlr *ctlr, u16 amp_r, u16 amp_l,
bool schedule_now)
{
--
2.37.0.170.g444d1eabd0-goog
next reply other threads:[~2022-07-20 5:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 5:42 Aashish Sharma [this message]
2022-07-20 15:27 ` [PATCH] HID: nintendo: Fix unused-const-variable compiler warning Guenter Roeck
2022-07-22 13:04 ` Jiri Kosina
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=20220720054225.1623875-1-shraash@google.com \
--to=shraash@google.com \
--cc=benjamin.tissoires@redhat.com \
--cc=djogorchock@gmail.com \
--cc=groeck@chromium.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).