Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5150824imw; Tue, 19 Jul 2022 23:01:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tB1iGqDE2ivJFk6LLFTQF5yeSN9Ch97EfbB9r2oa7adgJ9lSzWyOwHYvoA3XgPFPuo3oZ0 X-Received: by 2002:a05:6402:1f87:b0:43b:b88d:1d93 with SMTP id c7-20020a0564021f8700b0043bb88d1d93mr1501449edc.314.1658296907730; Tue, 19 Jul 2022 23:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658296907; cv=none; d=google.com; s=arc-20160816; b=OfWvBHCovht4qsRqYFVV7FFJg9w7JYUjnAhvWsmaZrmhKJ08iQJICRvKOiOJ31DViT 7uI2PqCbAWrkc15O2IVObAScfqN07kpBf92FFSk/iD2xxFww6j/U7gDTprl/U8xeJwoN chim4JGrzJ1SAN/UXZ7Up1BtLZYuuWgqirTue3IPZGVuBXXmhM3Ojza4Vkg2iKkurKw6 3yMqrWBMEIxafCxru8rGShwlvSsx798jYfgzkgRmVtIUiYIy8cYoWdlOfEMWyp/uNwFk DzKmfsLtZLhlkcIbVlqjOFuZX0Mm5akB2tHLyDcp/bZImB8DGymP67SZ1H3n3hChXrZV rnVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=cjGzXKu/st/bF6b6ISAjY+s0vz3froHk5QhAxeX2XPI=; b=hPsn/mfa49ftt/GGFyH6WQIg/LTa/8fOG0rnABJUEfb1UgE+NnYvRunfSrF5co8HWS mT5f+fsmL5wM60XOzuXE2UR/Gg3F1FAuRMww7D1/8c0vR9U+YoigMwnUW871Qx54YIxW NUI9cU9b18NcE9y66wBtDuIMWV3H12JEBR11cqFq3rOvmI4kUdx15Y3Z2esIqD2ZvoRT ve56KQsnLhkx0QoEf0kYKm+BlCfQiORO3XRsOjLMbsBNYVk8TqRoqbU1Ff6ICJ3ZCTw2 u9N4IJUjomEaNtPgcu5eM7GVwv1Ig91K1Ob/T3nhwyb0+nBzGMEaX6rfhW7iq+L9lULx A1Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QfOW8x98; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg5-20020a1709072cc500b0072f1c8d0ea8si12357353ejc.30.2022.07.19.23.01.21; Tue, 19 Jul 2022 23:01:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QfOW8x98; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbiGTFnC (ORCPT + 99 others); Wed, 20 Jul 2022 01:43:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiGTFnB (ORCPT ); Wed, 20 Jul 2022 01:43:01 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD31148CA2 for ; Tue, 19 Jul 2022 22:43:00 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id f85-20020a253858000000b00670a44473e2so83590yba.9 for ; Tue, 19 Jul 2022 22:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=cjGzXKu/st/bF6b6ISAjY+s0vz3froHk5QhAxeX2XPI=; b=QfOW8x98cL7o5h/Jnu53QDF7I8O5KqdTpA+EOcAaiUYmvO50VECLLwyM630PMxW4zt XxL3Pqwu3Qr8CiGFjxs2KJB+sgM+bePz3ZypCQjy/KixeL+b5cVBwRZG3X2rMf7XHYPI eYfhlB9y+VHV4A/sVfvYV+lWv+NOGn3PDmnrNXtlNkJ0J12PTx2ssczvi6YkNfqxpU7o KASwQ+GLWeAXAVzQymKCcBhAEWAbSTbjD6s3HSgJ54h9luaqGZKDXr7p62OG4Uu2k91A aQFhDbd4ozqVgFpLnDtTfS02DGiOVsDnMjP0W1pzpndAh49lQ5iw0imxgJuWFbAiYf65 WnDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=cjGzXKu/st/bF6b6ISAjY+s0vz3froHk5QhAxeX2XPI=; b=TUhjkIQ2KHeFCBhITlPJTL8mj+ruBFGXsA+p2XHOnT8zpzMUrKwwSLrCa8Ziv5VBoL VNsVo2BWpWBEoexqwLFbilYN2QgzctMM9BItKBP1bjx0rvDsg4Cejb0EzdmjE837URfa ryU21XjSiQHemlzrsz87HEVEEx0mljYgFPoUSOflqbq7WycxsvvhwvN0oAgV4GrhCJ34 wNplBjTu8Y8ypEPw3tXhIRA3LvueOpOw045frzMNXgrolK+v5j4yBZbujJaRLUae6crZ YvEOj7Xq/97gUQNgDPXY0Rce4gGufPZfY9bLwLHQodPgybKSu0IjNY4unz2BNPNIHejC mvjw== X-Gm-Message-State: AJIora/sqTzy51YlhL1BoPPWxHOeZSQZM7D/C/T522NOEI4du3u7711m tliwbwSACv3GMN0vnkjdfRbgp6MKLa1f X-Received: from ezekiel.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:108e]) (user=shraash job=sendgmr) by 2002:a05:6902:10c:b0:66e:445a:ae8b with SMTP id o12-20020a056902010c00b0066e445aae8bmr34793456ybh.282.1658295780164; Tue, 19 Jul 2022 22:43:00 -0700 (PDT) Date: Wed, 20 Jul 2022 11:12:25 +0530 Message-Id: <20220720054225.1623875-1-shraash@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.0.170.g444d1eabd0-goog Subject: [PATCH] HID: nintendo: Fix unused-const-variable compiler warning From: Aashish Sharma To: "Daniel J . Ogorchock " , Jiri Kosina , Benjamin Tissoires , Guenter Roeck Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Aashish Sharma Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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