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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2255C433E0 for ; Wed, 15 Jul 2020 11:44:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD998206E9 for ; Wed, 15 Jul 2020 11:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594813455; bh=BaBDIw1z/eEqdf0QQ4ZUt0oW4z4lCjYpMBZZDcbuR0c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=UV/sZQ9jo8IWePcB8Yte+JIFJBqfJqabr7owlNwUJ2Mpa2k9yiaq2jlg5uSWFpzuH /+C/nJ0n9Nqd8buVqfZT3zs+247wY0iwUZ4T63Q3RNb1+Owu+Yz5+etOoSSeya9Zpg Jqi1tblEu66BekF4VQy420BbiK40K0MPT2zQYGOk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729421AbgGOLoP (ORCPT ); Wed, 15 Jul 2020 07:44:15 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:36055 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729402AbgGOLoO (ORCPT ); Wed, 15 Jul 2020 07:44:14 -0400 Received: by mail-ot1-f68.google.com with SMTP id 72so1215033otc.3; Wed, 15 Jul 2020 04:44:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BaBDIw1z/eEqdf0QQ4ZUt0oW4z4lCjYpMBZZDcbuR0c=; b=RrtCkGNRfH3fAsP1WY6uPp7osIGCxNk8Tm6aqLZWdMTXfwTpMFhnluX/Nq/gJghiSK 5Lblc8Zn0QOqpxvlA/Qq3ZORXjUicOyxJSgF9ffio5/frR8QNEOfNc0pBv3Z8Ffldj+w oAHFROAcRvC25+JAu4OJkdHwAlZYvSLSxQFpL4uwincr/N/5ZjV27iuuZWIJ6XiF/Mup 4hkfP8R3xVppNM94d9TGftX0tDOx7G2pOdZH2sV6laQL3RrvBP4kpE/18y5bGCPKxsk3 kRtDVTl/AVKVRIrsxv354n3fvL0F3g8v7VlqxyX2gGcLEs1S4iRNPrvl3rcyBcWjpRAh 9xUQ== X-Gm-Message-State: AOAM533VDzvw7e1pe2BF8txx1kJAxV6MubGCHYyMLnkE0yVJnDzgF3xm Q+ouXuogLQDbxt/+kxoITWapWe5AnnDuAvj6S1w= X-Google-Smtp-Source: ABdhPJxEcoP6okwQqNr/RlRkCB0Aw3hNucn3W2acw4J2SJUqB280r/rPKtFMA2T/K62rr7Bm4/+fKhqo/8OcKnWTGb0= X-Received: by 2002:a9d:1c82:: with SMTP id l2mr8192356ota.167.1594813453344; Wed, 15 Jul 2020 04:44:13 -0700 (PDT) MIME-Version: 1.0 References: <20200714145049.2496163-1-lee.jones@linaro.org> <20200714145049.2496163-10-lee.jones@linaro.org> <20200714210340.GJ1398296@dell> <20200715032442.gh2cliiddhv35fdj@vireshk-i7> <20200715032718.2zlo2eurhkpoayya@vireshk-i7> <20200715113433.GB3165313@dell> In-Reply-To: <20200715113433.GB3165313@dell> From: "Rafael J. Wysocki" Date: Wed, 15 Jul 2020 13:44:01 +0200 Message-ID: Subject: Re: [PATCH 09/13] cpufreq: acpi-cpufreq: Remove unused ID structs To: Lee Jones Cc: "Rafael J. Wysocki" , Viresh Kumar , "Rafael J. Wysocki" , Linux ARM , Linux Kernel Mailing List , Linux PM , Andy Grover , Paul Diefenbaugh , Dominik Brodowski , Denis Sadykov Content-Type: text/plain; charset="UTF-8" Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Wed, Jul 15, 2020 at 1:34 PM Lee Jones wrote: > > On Wed, 15 Jul 2020, Rafael J. Wysocki wrote: > > > On Wed, Jul 15, 2020 at 5:27 AM Viresh Kumar wrote: > > > > > > On 15-07-20, 08:54, Viresh Kumar wrote: > > > > On 14-07-20, 22:03, Lee Jones wrote: > > > > > On Tue, 14 Jul 2020, Rafael J. Wysocki wrote: > > > > > > > > > > > On Tue, Jul 14, 2020 at 4:51 PM Lee Jones wrote: > > > > > > > > > > > > > > Can't see them being used anywhere and the compiler doesn't complain > > > > > > > that they're missing, so ... > > > > > > > > > > > > Aren't they needed for automatic module loading in certain configurations? > > > > > > > > > > Any idea how that works, or where the code is for that? > > > > > > > > The MODULE_DEVICE_TABLE() thingy creates a map of vendor-id, > > > > product-id that the kernel keeps after boot (and so there is no static > > > > reference of it for the compiler), later when a device is hotplugged > > > > into the kernel it refers to the map to find the related driver for it > > > > and loads it if it isn't already loaded. > > > > > > > > This has some of it, search for MODULE_DEVICE_TABLE() in it. > > > > Documentation/driver-api/usb/hotplug.rst > > > > > > And you just need to add __maybe_unused to them to suppress the > > > warning. > > > > Wouldn't that cause the compiler to optimize them away if it doesn't > > see any users? > > It looks like they're only unused when !MODULE, OK > in which case optimising them away would be the correct thing to do, no?