Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5601383imw; Wed, 20 Jul 2022 08:43:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uPQHwA0LUaFohotITvO5+1j+V3Ja1fvVb/Mhj5svbeJycGWSL1hf0he63G5moCcCEuh8I4 X-Received: by 2002:a63:2dc6:0:b0:419:f2d0:4777 with SMTP id t189-20020a632dc6000000b00419f2d04777mr22276637pgt.203.1658331813268; Wed, 20 Jul 2022 08:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658331813; cv=none; d=google.com; s=arc-20160816; b=EcyM7913L+M1i6TS5wAxUWY38Tzak6M2QA2yml8XPzNmb2WN+xWZK9LOfDn+wjePBM brvMXhPo5iVyAwli6FDz3ZlkF+GpaPNq1Ooo9/SaGSoF7dJ2IcnennqgOTxO6Utic3KX bgLhJ/FvCapTC3EL9g/pdZu9uY8eMtcoo7F1gh5AmYBHPmtblYILGp7N2EpbOwkzT61k XyqrNkMRNxO6WAbyQr3FPKdO4j/R27Yk3SvTzQxvgEQM6elwhaqRRex+ITTMwAwXUGtr YYkJL8ZGte64BOTc2i3OYWyKP8NZmmVoAiRU0DEd6nGnf9KwxdD79LbYN8ozqB1SB6NW PURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=egHHWRfHLuooJteJL4UiMdp23DTR6GCs9T7w8M7ONxk=; b=Qo3HCitmZZXs57tkD/g/QyXbDtkMBXEsej1shOJzgaTkQE/WO9qIXFVQTsIaBqjw1i IP+A7rsJgBmAoJMgcjzCEiNgu78p1BxShhlev/3cNFfaI3oLfBC5AjlQud5sfXGctB8M QfMlraUp6B0r2igImBGBj+uIu/Ea8/nifZf95/mvh09S0RTcL4UIaIvJ5E1Ij3Va7bbc GbZ+Rtx3I0X5QtOwRDru94Q4MIGpZdwaX4SrY3DSpwTZ66m7tPnRB58uCi64AZGV5493 biRzOjsgO8ChKpS7JQhDN4T8xgzNEpOlCCwkzgQ+GzD1d4jzAt4QuJ3Rr4ktZ4274iPs VfCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=a5gM9FUX; 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 l9-20020a170902f68900b0016cc0e4c7cesi5903482plg.427.2022.07.20.08.43.17; Wed, 20 Jul 2022 08:43:33 -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=a5gM9FUX; 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 S230055AbiGTP1q (ORCPT + 99 others); Wed, 20 Jul 2022 11:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiGTP1o (ORCPT ); Wed, 20 Jul 2022 11:27:44 -0400 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 234EE564F3 for ; Wed, 20 Jul 2022 08:27:43 -0700 (PDT) Received: by mail-ua1-x930.google.com with SMTP id f3so1578017uaq.2 for ; Wed, 20 Jul 2022 08:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=egHHWRfHLuooJteJL4UiMdp23DTR6GCs9T7w8M7ONxk=; b=a5gM9FUXPFg1YIYEYkdVjOlOfrMB5V9IQM51MmXsv7qTxyIQN4epyZwS+814Z+LNFD MBf0zlLzCNbFW++F76USeIzhCSD711UtDJwtUSRMzaZh4kOz7X14lxDcyLMtmD50eDwZ TmJPv9zHlCDIFDvALblgmiGMAv+KDOQkDn+kF9Br4QQXILbJmGV0hfEuB5G9kCmzF0Fd Q6vwIyr1A6MtCaJ0HsP9kPV3dNpWXLBnw00bwnhPb6NG+DpjdHfu45+YTEzBBv9ekKwT mQ5OBILlM50gbNuB2pUoSmdhXJGOjCcBFfvAb5hak3FJFWhVo6jWPtWBGRtG5Zxe8uCI HzoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=egHHWRfHLuooJteJL4UiMdp23DTR6GCs9T7w8M7ONxk=; b=C6QOVSzJpFxjmmP3zHAKckNGsw6PqOKDXpy+V0SCj5kItDsYYuMw/tB4dUsYdtlo+2 kY6oyuJ+Sg83I1OB8WshRKDRgplcB8S+8DiU0gM6JUna9XtfmdCAcAvVDwdCGrvZKAIT GKQGULEcw//U/WjiqduyAmqGIUBtE74Ju6XK5oT+pgxY/zk7OYqOBmSkapuOjA+yGXjl YpGa7rv/Vu41JmJmD+omIxkyOIFtYwkBKtDyji5jYsWpyyRoHddXUeOla8VVNjVEGXVQ rqKig1rQu0WEZFQVOcp0MXQNRnL7oJpmwj1+4u2MLcEwsejw0UxuzHNyVHYz7ZxqG8X3 Wd+Q== X-Gm-Message-State: AJIora/6pHs1yZnq2AEo76cYJA2esXPua6DkltODAGoWt0tJSDxPvuHe W1bxUi3NvXhzpgxlGpjpNftkNw8X1Y8vW2p0PBouVg== X-Received: by 2002:ab0:6512:0:b0:383:4aa:b452 with SMTP id w18-20020ab06512000000b0038304aab452mr13957811uam.55.1658330862179; Wed, 20 Jul 2022 08:27:42 -0700 (PDT) MIME-Version: 1.0 References: <20220720054225.1623875-1-shraash@google.com> In-Reply-To: <20220720054225.1623875-1-shraash@google.com> From: Guenter Roeck Date: Wed, 20 Jul 2022 08:27:31 -0700 Message-ID: Subject: Re: [PATCH] HID: nintendo: Fix unused-const-variable compiler warning To: Aashish Sharma Cc: "Daniel J . Ogorchock" , Jiri Kosina , Benjamin Tissoires , Guenter Roeck , "open list:HID CORE LAYER" , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_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 On Tue, Jul 19, 2022 at 10:43 PM Aashish Sharma wrote: > > 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 Reviewed-by: Guenter Roeck > --- > 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 >