From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89BB6C433EF for ; Mon, 1 Nov 2021 14:33:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFE4760ED5 for ; Mon, 1 Nov 2021 14:33:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EFE4760ED5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 81A5E940017; Mon, 1 Nov 2021 10:33:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C9C994000F; Mon, 1 Nov 2021 10:33:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B8C1940017; Mon, 1 Nov 2021 10:33:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 595C594000F for ; Mon, 1 Nov 2021 10:33:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0CEDF1802151E for ; Mon, 1 Nov 2021 14:33:36 +0000 (UTC) X-FDA: 78760604832.13.BF378AF Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf25.hostedemail.com (Postfix) with ESMTP id 511B9B000189 for ; Mon, 1 Nov 2021 14:33:27 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 70EB01FD3C; Mon, 1 Nov 2021 14:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1635777214; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=t1mkfih25zhSyyTPm/3Tw7DroQ5EMxaX28cQd6NqRg4=; b=JatuW6UaqkUJcghnVlZi5sjUEqQLruB9IDboYaYM8XZf/suF6ZIj+i0mFBao7LV31MHmkq vcA6za4jVpPwshXm7k6bflmoxg4LPRGWSeHk0hvxXKmahibKuL9b/etMe9iRZT+U4Yf9bA SJDqRm7mhl8v846Nlpu8aGQCJmtKODs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1635777214; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=t1mkfih25zhSyyTPm/3Tw7DroQ5EMxaX28cQd6NqRg4=; b=LdYWLwIF4jsQ89f2Wvj7gN/fe2RgpwjsaY7jSvy/6kQrcrjaWqZr83RBWoPWG1KYL+FbVB Qqr8mZNLqoHCBJDA== Received: from pobox.suse.cz (pobox.suse.cz [10.100.2.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5F29CA3B84; Mon, 1 Nov 2021 14:33:34 +0000 (UTC) Date: Mon, 1 Nov 2021 15:33:34 +0100 (CET) From: Jiri Kosina To: kernel test robot cc: "Daniel J. Ogorchock" , kbuild-all@lists.01.org, Linux Memory Management List Subject: Re: [linux-next:master 11502/12841] drivers/hid/hid-nintendo.c:85:17: error: 'JC_USB_CMD_CONN_STATUS' defined but not used In-Reply-To: <202110302141.Ea3cwUv0-lkp@intel.com> Message-ID: References: <202110302141.Ea3cwUv0-lkp@intel.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=JatuW6Ua; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=LdYWLwIF; dmarc=none; spf=pass (imf25.hostedemail.com: domain of jkosina@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jkosina@suse.cz X-Stat-Signature: cs1n1kkirkfsforz5r9zgct617o1xkxu X-Rspamd-Queue-Id: 511B9B000189 X-Rspamd-Server: rspam01 X-HE-Tag: 1635777207-755741 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, 30 Oct 2021, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: bdcc9f6a568275aed4cc32fd2312432d2ff1b704 > commit: 2af16c1f846bd60240745bbd3afa13d5f040c61a [11502/12841] HID: nintendo: add nintendo switch controller driver > config: arm-allyesconfig (attached as .config) > compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2af16c1f846bd60240745bbd3afa13d5f040c61a > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 2af16c1f846bd60240745bbd3afa13d5f040c61a > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All errors (new ones prefixed by >>): From: Jiri Kosina Subject: [PATCH] HID: nintendo: fix -Werror build There are a lot of warnings due to unused protocol constants, but I believe it's good to leave them in the sources for documentation purposes for further development. Switch them over from static conts to macros to avoid the warnings. Reported-by: kernel test robot Signed-off-by: Jiri Kosina --- drivers/hid/hid-nintendo.c | 160 ++++++++++++++++++++++----------------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index c4270499fc6f..a1e0f6849875 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -41,106 +41,106 @@ */ /* Output Reports */ -static const u8 JC_OUTPUT_RUMBLE_AND_SUBCMD = 0x01; -static const u8 JC_OUTPUT_FW_UPDATE_PKT = 0x03; -static const u8 JC_OUTPUT_RUMBLE_ONLY = 0x10; -static const u8 JC_OUTPUT_MCU_DATA = 0x11; -static const u8 JC_OUTPUT_USB_CMD = 0x80; +#define JC_OUTPUT_RUMBLE_AND_SUBCMD 0x01 +#define JC_OUTPUT_FW_UPDATE_PKT 0x03 +#define JC_OUTPUT_RUMBLE_ONLY 0x10 +#define JC_OUTPUT_MCU_DATA 0x11 +#define JC_OUTPUT_USB_CMD 0x80 /* Subcommand IDs */ -static const u8 JC_SUBCMD_STATE /*= 0x00*/; -static const u8 JC_SUBCMD_MANUAL_BT_PAIRING = 0x01; -static const u8 JC_SUBCMD_REQ_DEV_INFO = 0x02; -static const u8 JC_SUBCMD_SET_REPORT_MODE = 0x03; -static const u8 JC_SUBCMD_TRIGGERS_ELAPSED = 0x04; -static const u8 JC_SUBCMD_GET_PAGE_LIST_STATE = 0x05; -static const u8 JC_SUBCMD_SET_HCI_STATE = 0x06; -static const u8 JC_SUBCMD_RESET_PAIRING_INFO = 0x07; -static const u8 JC_SUBCMD_LOW_POWER_MODE = 0x08; -static const u8 JC_SUBCMD_SPI_FLASH_READ = 0x10; -static const u8 JC_SUBCMD_SPI_FLASH_WRITE = 0x11; -static const u8 JC_SUBCMD_RESET_MCU = 0x20; -static const u8 JC_SUBCMD_SET_MCU_CONFIG = 0x21; -static const u8 JC_SUBCMD_SET_MCU_STATE = 0x22; -static const u8 JC_SUBCMD_SET_PLAYER_LIGHTS = 0x30; -static const u8 JC_SUBCMD_GET_PLAYER_LIGHTS = 0x31; -static const u8 JC_SUBCMD_SET_HOME_LIGHT = 0x38; -static const u8 JC_SUBCMD_ENABLE_IMU = 0x40; -static const u8 JC_SUBCMD_SET_IMU_SENSITIVITY = 0x41; -static const u8 JC_SUBCMD_WRITE_IMU_REG = 0x42; -static const u8 JC_SUBCMD_READ_IMU_REG = 0x43; -static const u8 JC_SUBCMD_ENABLE_VIBRATION = 0x48; -static const u8 JC_SUBCMD_GET_REGULATED_VOLTAGE = 0x50; +#define JC_SUBCMD_STATE 0x00 +#define JC_SUBCMD_MANUAL_BT_PAIRING 0x01 +#define JC_SUBCMD_REQ_DEV_INFO 0x02 +#define JC_SUBCMD_SET_REPORT_MODE 0x03 +#define JC_SUBCMD_TRIGGERS_ELAPSED 0x04 +#define JC_SUBCMD_GET_PAGE_LIST_STATE 0x05 +#define JC_SUBCMD_SET_HCI_STATE 0x06 +#define JC_SUBCMD_RESET_PAIRING_INFO 0x07 +#define JC_SUBCMD_LOW_POWER_MODE 0x08 +#define JC_SUBCMD_SPI_FLASH_READ 0x10 +#define JC_SUBCMD_SPI_FLASH_WRITE 0x11 +#define JC_SUBCMD_RESET_MCU 0x20 +#define JC_SUBCMD_SET_MCU_CONFIG 0x21 +#define JC_SUBCMD_SET_MCU_STATE 0x22 +#define JC_SUBCMD_SET_PLAYER_LIGHTS 0x30 +#define JC_SUBCMD_GET_PLAYER_LIGHTS 0x31 +#define JC_SUBCMD_SET_HOME_LIGHT 0x38 +#define JC_SUBCMD_ENABLE_IMU 0x40 +#define JC_SUBCMD_SET_IMU_SENSITIVITY 0x41 +#define JC_SUBCMD_WRITE_IMU_REG 0x42 +#define JC_SUBCMD_READ_IMU_REG 0x43 +#define JC_SUBCMD_ENABLE_VIBRATION 0x48 +#define JC_SUBCMD_GET_REGULATED_VOLTAGE 0x50 /* Input Reports */ -static const u8 JC_INPUT_BUTTON_EVENT = 0x3F; -static const u8 JC_INPUT_SUBCMD_REPLY = 0x21; -static const u8 JC_INPUT_IMU_DATA = 0x30; -static const u8 JC_INPUT_MCU_DATA = 0x31; -static const u8 JC_INPUT_USB_RESPONSE = 0x81; +#define JC_INPUT_BUTTON_EVENT 0x3F +#define JC_INPUT_SUBCMD_REPLY 0x21 +#define JC_INPUT_IMU_DATA 0x30 +#define JC_INPUT_MCU_DATA 0x31 +#define JC_INPUT_USB_RESPONSE 0x81 /* Feature Reports */ -static const u8 JC_FEATURE_LAST_SUBCMD = 0x02; -static const u8 JC_FEATURE_OTA_FW_UPGRADE = 0x70; -static const u8 JC_FEATURE_SETUP_MEM_READ = 0x71; -static const u8 JC_FEATURE_MEM_READ = 0x72; -static const u8 JC_FEATURE_ERASE_MEM_SECTOR = 0x73; -static const u8 JC_FEATURE_MEM_WRITE = 0x74; -static const u8 JC_FEATURE_LAUNCH = 0x75; +#define JC_FEATURE_LAST_SUBCMD 0x02 +#define JC_FEATURE_OTA_FW_UPGRADE 0x70 +#define JC_FEATURE_SETUP_MEM_READ 0x71 +#define JC_FEATURE_MEM_READ 0x72 +#define JC_FEATURE_ERASE_MEM_SECTOR 0x73 +#define JC_FEATURE_MEM_WRITE 0x74 +#define JC_FEATURE_LAUNCH 0x75 /* USB Commands */ -static const u8 JC_USB_CMD_CONN_STATUS = 0x01; -static const u8 JC_USB_CMD_HANDSHAKE = 0x02; -static const u8 JC_USB_CMD_BAUDRATE_3M = 0x03; -static const u8 JC_USB_CMD_NO_TIMEOUT = 0x04; -static const u8 JC_USB_CMD_EN_TIMEOUT = 0x05; -static const u8 JC_USB_RESET = 0x06; -static const u8 JC_USB_PRE_HANDSHAKE = 0x91; -static const u8 JC_USB_SEND_UART = 0x92; +#define JC_USB_CMD_CONN_STATUS 0x01 +#define JC_USB_CMD_HANDSHAKE 0x02 +#define JC_USB_CMD_BAUDRATE_3M 0x03 +#define JC_USB_CMD_NO_TIMEOUT 0x04 +#define JC_USB_CMD_EN_TIMEOUT 0x05 +#define JC_USB_RESET 0x06 +#define JC_USB_PRE_HANDSHAKE 0x91 +#define JC_USB_SEND_UART 0x92 /* Magic value denoting presence of user calibration */ -static const u16 JC_CAL_USR_MAGIC_0 = 0xB2; -static const u16 JC_CAL_USR_MAGIC_1 = 0xA1; -static const u8 JC_CAL_USR_MAGIC_SIZE = 2; +#define JC_CAL_USR_MAGIC_0 0xB2 +#define JC_CAL_USR_MAGIC_1 0xA1 +#define JC_CAL_USR_MAGIC_SIZE 2 /* SPI storage addresses of user calibration data */ -static const u16 JC_CAL_USR_LEFT_MAGIC_ADDR = 0x8010; -static const u16 JC_CAL_USR_LEFT_DATA_ADDR = 0x8012; -static const u16 JC_CAL_USR_LEFT_DATA_END = 0x801A; -static const u16 JC_CAL_USR_RIGHT_MAGIC_ADDR = 0x801B; -static const u16 JC_CAL_USR_RIGHT_DATA_ADDR = 0x801D; +#define JC_CAL_USR_LEFT_MAGIC_ADDR 0x8010 +#define JC_CAL_USR_LEFT_DATA_ADDR 0x8012 +#define JC_CAL_USR_LEFT_DATA_END 0x801A +#define JC_CAL_USR_RIGHT_MAGIC_ADDR 0x801B +#define JC_CAL_USR_RIGHT_DATA_ADDR 0x801D #define JC_CAL_STICK_DATA_SIZE \ (JC_CAL_USR_LEFT_DATA_END - JC_CAL_USR_LEFT_DATA_ADDR + 1) /* SPI storage addresses of factory calibration data */ -static const u16 JC_CAL_FCT_DATA_LEFT_ADDR = 0x603d; -static const u16 JC_CAL_FCT_DATA_RIGHT_ADDR = 0x6046; +#define JC_CAL_FCT_DATA_LEFT_ADDR 0x603d +#define JC_CAL_FCT_DATA_RIGHT_ADDR 0x6046 /* SPI storage addresses of IMU factory calibration data */ -static const u16 JC_IMU_CAL_FCT_DATA_ADDR = 0x6020; -static const u16 JC_IMU_CAL_FCT_DATA_END = 0x6037; +#define JC_IMU_CAL_FCT_DATA_ADDR 0x6020 +#define JC_IMU_CAL_FCT_DATA_END 0x6037 #define JC_IMU_CAL_DATA_SIZE \ (JC_IMU_CAL_FCT_DATA_END - JC_IMU_CAL_FCT_DATA_ADDR + 1) /* SPI storage addresses of IMU user calibration data */ -static const u16 JC_IMU_CAL_USR_MAGIC_ADDR = 0x8026; -static const u16 JC_IMU_CAL_USR_DATA_ADDR = 0x8028; +#define JC_IMU_CAL_USR_MAGIC_ADDR 0x8026 +#define JC_IMU_CAL_USR_DATA_ADDR 0x8028 /* The raw analog joystick values will be mapped in terms of this magnitude */ -static const u16 JC_MAX_STICK_MAG = 32767; -static const u16 JC_STICK_FUZZ = 250; -static const u16 JC_STICK_FLAT = 500; +#define JC_MAX_STICK_MAG 32767 +#define JC_STICK_FUZZ 250 +#define JC_STICK_FLAT 500 /* Hat values for pro controller's d-pad */ -static const u16 JC_MAX_DPAD_MAG = 1; -static const u16 JC_DPAD_FUZZ /*= 0*/; -static const u16 JC_DPAD_FLAT /*= 0*/; +#define JC_MAX_DPAD_MAG 1 +#define JC_DPAD_FUZZ 0 +#define JC_DPAD_FLAT 0 /* Under most circumstances IMU reports are pushed every 15ms; use as default */ -static const u16 JC_IMU_DFLT_AVG_DELTA_MS = 15; +#define JC_IMU_DFLT_AVG_DELTA_MS 15 /* How many samples to sum before calculating average IMU report delta */ -static const u16 JC_IMU_SAMPLES_PER_DELTA_AVG = 300; +#define JC_IMU_SAMPLES_PER_DELTA_AVG 300 /* Controls how many dropped IMU packets at once trigger a warning message */ -static const u16 JC_IMU_DROPPED_PKT_WARNING = 3; +#define JC_IMU_DROPPED_PKT_WARNING 3 /* * The controller's accelerometer has a sensor resolution of 16bits and is @@ -149,10 +149,10 @@ static const u16 JC_IMU_DROPPED_PKT_WARNING = 3; * Resolution per G (rather than per millliG): 4.096 * 1000 = 4096 digits per G * Alternatively: 1/4096 = .0002441 Gs per digit */ -static const s32 JC_IMU_MAX_ACCEL_MAG = 32767; -static const u16 JC_IMU_ACCEL_RES_PER_G = 4096; -static const u16 JC_IMU_ACCEL_FUZZ = 10; -static const u16 JC_IMU_ACCEL_FLAT /*= 0*/; +#define JC_IMU_MAX_ACCEL_MAG 32767 +#define JC_IMU_ACCEL_RES_PER_G 4096 +#define JC_IMU_ACCEL_FUZZ 10 +#define JC_IMU_ACCEL_FLAT 0 /* * The controller's gyroscope has a sensor resolution of 16bits and is @@ -169,12 +169,12 @@ static const u16 JC_IMU_ACCEL_FLAT /*= 0*/; * Now, 14.247 truncating to 14 loses a lot of precision, so we rescale the * min/max range by 1000. */ -static const s32 JC_IMU_PREC_RANGE_SCALE = 1000; +#define JC_IMU_PREC_RANGE_SCALE 1000 /* Note: change mag and res_per_dps if prec_range_scale is ever altered */ -static const s32 JC_IMU_MAX_GYRO_MAG = 32767000; /* (2^16-1)*1000 */ -static const u16 JC_IMU_GYRO_RES_PER_DPS = 14247; /* (14.247*1000) */ -static const u16 JC_IMU_GYRO_FUZZ = 10; -static const u16 JC_IMU_GYRO_FLAT /*= 0*/; +#define JC_IMU_MAX_GYRO_MAG 32767000 /* (2^16-1)*1000 */ +#define JC_IMU_GYRO_RES_PER_DPS 14247 /* (14.247*1000) */ +#define JC_IMU_GYRO_FUZZ 10 +#define JC_IMU_GYRO_FLAT 0 /* frequency/amplitude tables for rumble */ struct joycon_rumble_freq_data { -- 2.12.3 -- Jiri Kosina SUSE Labs