From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EED931CD05 for ; Tue, 16 Jan 2024 17:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705426860; cv=none; b=diaarzoocLLq3XvV1gDT5xNNLEJEbA+cQat9EkB+soSTyPTnuiRhHgaAEvVKT+7yDSwyXB1VneqWTm1Q0P+3SFZcOxUg/Xu5xnKXNCb8P2efqmPV2K18IidKLFfgeVDnTxZfsbZiiL3cGWYFRmIk0sgtVy4FubaO5htQQ7QZIQw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705426860; c=relaxed/simple; bh=XvvcYoCr4zpjWC2RHZe0h/ouCH5Zo/Y79WhWx6k5mnY=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:Date: From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=Ze0pth3s+aU9Sid/usSVkVzb3WEcCXMn0RjD/GJfm+7lpVhrlv7W5PNah2TQ7kLBWOVndIQKlwESXXOK841AAhAEsKh+AHUxdFlVZm4mtcjxB4jc63zR/baOyW8XSYoXJ57CTZaDuNB3cCnAIkm7D+c018KjV1ZXzi1XRspNymA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=d3TrqOjg; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d3TrqOjg" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6db05618c1fso7378729b3a.1 for ; Tue, 16 Jan 2024 09:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1705426858; x=1706031658; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BOlwdSwaFY4qZZ/MF2sX5IosH4JrIbBPd9daBrZxqLw=; b=d3TrqOjgF6NA9oVF0Za8tNZ0JbqkMO6S3DPibKml07Yv5RsB/p3yD60b9GZvJd88Uv FRx+Xdi4Z4FhK2NgqVlTDwLx8REllOil7oTJrcOQKlJCZZ4vKnfKp0J8iNoYmbNyvR07 ZU47jYRWLYAyAETmXZsBdzA4WTFOhqrjMxdiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705426858; x=1706031658; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BOlwdSwaFY4qZZ/MF2sX5IosH4JrIbBPd9daBrZxqLw=; b=P6N4pM/VA36ixv4eEJ0/qw5oFaRr99dkp/AtRqrYqNxGQcVwevKUZDgTQUZvSUTCOG h262cBPmluhl7Lr5vV2wMLt3TW1Y4XblThXlPpWIFtoq4B3ko+sxX0XsNYyjpeL0tmDF eI4tz9APGF5VKgLGmnOVPufJ4C8r/oSE4ll7zQTroo5oh25b7pQoEa2qBqiilWYnPZnC PMiM2XDLZobS97ewYyY60bkTgjYB1Ri4/a5hssjAcFnSvCJ9/Y3C7BQSI2ISaLA8b1Rq oez/bbQ/a/zF/R+IzKV0fXfCOrNBYCklBexvvArU3khA8B+DCTiQlcfY8nw99c2oEbAp 3YAA== X-Gm-Message-State: AOJu0YxPy2xUAUfP6RlLa+PPcrOUozSaJYCEpmrA+Av3AI0IUTWinHn0 HumzLg1aBPZaiS1uBVHKJo2WLstmddv3 X-Google-Smtp-Source: AGHT+IGSq12YfeBII3I7eyQkB4trJr8EZhJyUqknHpzHjJNorjltxMMcubYS6hhtjlOeab7iuZAREg== X-Received: by 2002:a05:6a00:4604:b0:6db:7038:fc0f with SMTP id ko4-20020a056a00460400b006db7038fc0fmr7290950pfb.63.1705426858263; Tue, 16 Jan 2024 09:40:58 -0800 (PST) Received: from localhost ([2620:15c:9d:2:88f1:3bea:43ea:b8b8]) by smtp.gmail.com with UTF8SMTPSA id x16-20020a056a000bd000b006d9b2694b0csm9640397pfu.200.2024.01.16.09.40.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jan 2024 09:40:57 -0800 (PST) Date: Tue, 16 Jan 2024 09:40:55 -0800 From: Brian Norris To: kernel test robot , =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado Cc: =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado , Tzung-Bi Shih , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, kernel@collabora.com, AngeloGioacchino Del Regno , Julius Werner , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] firmware: google: cbmem: Add to module device table Message-ID: References: <20240111151226.842603-4-nfraprado@collabora.com> <202401151013.Xioj5wZo-lkp@intel.com> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202401151013.Xioj5wZo-lkp@intel.com> Hi Nicolas, On Mon, Jan 15, 2024 at 10:53:48AM +0800, kernel test robot wrote: > All warnings (new ones prefixed by >>): > > >> drivers/firmware/google/cbmem.c:118:40: warning: unused variable 'cbmem_ids' [-Wunused-const-variable] > 118 | static const struct coreboot_device_id cbmem_ids[] = { > | ^~~~~~~~~ > 1 warning generated. > > > vim +/cbmem_ids +118 drivers/firmware/google/cbmem.c > > 117 > > 118 static const struct coreboot_device_id cbmem_ids[] = { > 119 { .tag = LB_TAG_CBMEM_ENTRY }, > 120 { /* sentinel */ } > 121 }; > 122 MODULE_DEVICE_TABLE(coreboot, cbmem_ids); > 123 I was wondering why we have a seemingly unique "unused variable" failure mode in comparison to other similarly-structured device/bus drivers, and I realized that's because we're not relying on the same structure for both MODULE_DEVICE_TABLE (struct coreboot_device_id) and for the driver definition (struct coreboot_driver -> 'u32 tag'). Thus, this structure is only used for #define MODULE builds, and otherwise not used. Rather than wrapping these definitions in "#ifdef MODULE", perhaps we can settle on a single field, and replace `struct coreboot_driver::tag` with an instance of `struct coreboot_device_id`? That would normally be a breaking change that would require changing all drivers at the same time as the bus (or else some kind of intermediate transition state), but considering there are only 4 driver implementations and they all live under the same maintainer tree, that seems like it should still be OK (IMO). If it makes the series more readable/incremental, perhaps the switchover can be the last patch in the series, and there can remain some duplication (and potential -Wunused-const-variable issues) for the middle of the series. Brian