From patchwork Mon Dec 19 19:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077079 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B5F8C4332F for ; Mon, 19 Dec 2022 19:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232558AbiLSTTJ (ORCPT ); Mon, 19 Dec 2022 14:19:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbiLSTTB (ORCPT ); Mon, 19 Dec 2022 14:19:01 -0500 Received: from mail-il1-x149.google.com (mail-il1-x149.google.com [IPv6:2607:f8b0:4864:20::149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7896120B6 for ; Mon, 19 Dec 2022 11:19:00 -0800 (PST) Received: by mail-il1-x149.google.com with SMTP id o10-20020a056e02102a00b003006328df7bso7082617ilj.17 for ; Mon, 19 Dec 2022 11:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=JPHDmjOz4kw82vudyh2gpNSeY/P1g0Ll1cHkuMKd04M=; b=Hl9NxWeWRbBMNIcYbJvo9h4lOhGhAZEsdPi5MbDF9oJxtlLgXY3/mwkDZQWTaIwfkQ uRsDLcZ4I/U1gY4gCmXSISAxWk/Q+4bC9AjBLvXBDAGpdcTe6ZvPzE244kYMz+eA42M7 wUWTlTn5N9Ycs5PdWjiOwiuS4D24OyLvoF1F0RZuvYaBBxdnihvlB8yySBabO1K/gMER IlHNuvhH7i1NM5Zkqc62EZrJphOMVnPQVdcgqbAIpZbhRekeIOeieN7xMd/0cZm4sCYW wHN2yrmAvyiCOSq4m09u35HFC2IdBGxzUUkasE0xaZ33SnBQTRz5fBVfqCSpGlQ3qR0I 8geg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JPHDmjOz4kw82vudyh2gpNSeY/P1g0Ll1cHkuMKd04M=; b=Ae9TrYrDvpDF31LXlSZj5Q4GBBnpPo7/sk4ipnZM42wW0SpqJRJuiemTgLigdPKzKx zyKkl1b/JVrmg8kUQ0IoXEL0nTjh3SVpYSS4HoRj5VRtmu4WNZu23YXGPkHbvjLxzmvt 9mMPjh/e4KbmPd6b7zVziahki1hhnj5Kh9penh2Y3UOtKe7l4E4ZFPTm69FM3FwVWjcw 1fLPAei/tLtpZtPOm6If3i09Rv/4M4sY2O/gsxvQ2e4jKzXqk3ggPSIQ0rVPI1dYLry1 mzEzHZyzUFbyyTDwXSOmGflznEBxwoa/tBKDObbCwGIZ5Fv2BCjPdYvFvRr5GsummkBS cDRg== X-Gm-Message-State: ANoB5pmMz8RWVLMeVtPVwaTZ0zOJQxCaVoUuZfJJw5HcAjAEYZXflWZp O+ARLnrF98L4LUAXtQGTvdmYPmZKY4TLOqI= X-Google-Smtp-Source: AA0mqf7amPioeMnlA+AUyAIaYb0aW6unNmd1qq3ubnJMOsmcaI05zjSC6BLtBwo3k1pZCRKGf3aTO/JDpU7ONFw= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a02:a117:0:b0:38a:7675:fd26 with SMTP id f23-20020a02a117000000b0038a7675fd26mr5696278jag.300.1671477540032; Mon, 19 Dec 2022 11:19:00 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:47 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-2-allenwebb@google.com> Subject: [PATCH v8 1/9] imx: Fix typo From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb , kernel test robot Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org A one character difference in the name supplied to MODULE_DEVICE_TABLE breaks a future patch set, so fix the typo. Reported-by: kernel test robot Signed-off-by: Allen Webb --- drivers/soc/imx/imx8mp-blk-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/imx/imx8mp-blk-ctrl.c b/drivers/soc/imx/imx8mp-blk-ctrl.c index 0e3b6ba22f943..344a0a71df14a 100644 --- a/drivers/soc/imx/imx8mp-blk-ctrl.c +++ b/drivers/soc/imx/imx8mp-blk-ctrl.c @@ -743,7 +743,7 @@ static const struct of_device_id imx8mp_blk_ctrl_of_match[] = { /* Sentinel */ } }; -MODULE_DEVICE_TABLE(of, imx8m_blk_ctrl_of_match); +MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match); static struct platform_driver imx8mp_blk_ctrl_driver = { .probe = imx8mp_blk_ctrl_probe, From patchwork Mon Dec 19 19:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077081 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 410FBC10F1B for ; Mon, 19 Dec 2022 19:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbiLSTTP (ORCPT ); Mon, 19 Dec 2022 14:19:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbiLSTTC (ORCPT ); Mon, 19 Dec 2022 14:19:02 -0500 Received: from mail-io1-xd4a.google.com (mail-io1-xd4a.google.com [IPv6:2607:f8b0:4864:20::d4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C202512AA3 for ; Mon, 19 Dec 2022 11:19:01 -0800 (PST) Received: by mail-io1-xd4a.google.com with SMTP id n8-20020a6b4108000000b006de520dc5c9so4487246ioa.19 for ; Mon, 19 Dec 2022 11:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=SrckFgIzMRVl6+GO1T3v4CruUzPwCuVcCKFsHg7YtbI=; b=UUg8L5dKlwXq1e+434Szr7yJM4I3XvLE2Kj3IAUcBAJhzycVgHnpnDWZJixg41Bzu0 Bglv5AuYNxO4yUAs5anz/yyS/SJZIxhFBGSp1o1H+JBbVbP4ZQPdtshdi2G7b6zQ2TRm a1ckZr585Q1ZQDCPi/esiX5NCl5hcCwsaHGRTgZLQPCmDpFuA8dGAPqVCPGDdTrSCyjc L9498BQ4QGUn0ANdxFu/Q6/wpthwE6O/mvrppdfsZIGK22MLbQE9BxASuBhA7zsI0xP3 3oTjQw/sT5gVvSgvGlauwxYSrZBsMdrkBbJuPXF6dAxhgtkTuK7ZS3butDgZzyABglCb n70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SrckFgIzMRVl6+GO1T3v4CruUzPwCuVcCKFsHg7YtbI=; b=3NHSt/CX3qLhJNm3rhXK5fj2pUlhvpdi8EhCKoB68/ixevWcmRaOyAMj/V9p8KO5PR Lzt4SdX9o+AMKeB7vKt1puztxk+4Y3+WiRlMa3+eaqO0ZEw6q14A+dlh5fnlAr7nHZL2 O7JgRiM4zbZYszkRBM9J3rrA2G2Z4qHplsEpPO3Jf6exvIBHMN4BWGVw/CjRURm2uBtO dXMaGDjElcmQFiNo7MdoQkUH8QwIHIU1QX4DXyj1cp4JPzWxMYwVhcMbaQvAVzmthHT0 9nMgls7xdLKmPLSRwx2HKMQHPSCyXbwmy64CX42OkIcAhLbqJaJ0ZEm88N//EoDFxuoB K8WQ== X-Gm-Message-State: ANoB5plrlKHCnCuf9TxPYfWjZvdypP10ksUz+240wZQQhq4fZ6ldHkxs JM6VD69hO1BTqvawDuXoC6l1URjznXor/bY= X-Google-Smtp-Source: AA0mqf6JCC52SozjS5ylrKtkpi02QdTsujBz6LZgGENwtkn6N6otc3tBkW107xbibsd3ona8Ic+arlAKgL/LDgo= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a92:d750:0:b0:302:4bf3:237d with SMTP id e16-20020a92d750000000b003024bf3237dmr35832752ilq.312.1671477541236; Mon, 19 Dec 2022 11:19:01 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:48 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-3-allenwebb@google.com> Subject: [PATCH v8 2/9] rockchip-mailbox: Fix typo From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb , kernel test robot Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org A one character difference in the name supplied to MODULE_DEVICE_TABLE breaks a future patch set, so fix the typo. Reported-by: kernel test robot Signed-off-by: Allen Webb --- drivers/mailbox/rockchip-mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/rockchip-mailbox.c b/drivers/mailbox/rockchip-mailbox.c index 979acc810f307..ca50f7f176f6a 100644 --- a/drivers/mailbox/rockchip-mailbox.c +++ b/drivers/mailbox/rockchip-mailbox.c @@ -159,7 +159,7 @@ static const struct of_device_id rockchip_mbox_of_match[] = { { .compatible = "rockchip,rk3368-mailbox", .data = &rk3368_drv_data}, { }, }; -MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match); +MODULE_DEVICE_TABLE(of, rockchip_mbox_of_match); static int rockchip_mbox_probe(struct platform_device *pdev) { From patchwork Mon Dec 19 19:18:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077080 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8521EC3DA71 for ; Mon, 19 Dec 2022 19:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbiLSTTN (ORCPT ); Mon, 19 Dec 2022 14:19:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbiLSTTD (ORCPT ); Mon, 19 Dec 2022 14:19:03 -0500 Received: from mail-il1-x149.google.com (mail-il1-x149.google.com [IPv6:2607:f8b0:4864:20::149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E80512D04 for ; Mon, 19 Dec 2022 11:19:02 -0800 (PST) Received: by mail-il1-x149.google.com with SMTP id h9-20020a92c269000000b00303494c4f3eso7077620ild.15 for ; Mon, 19 Dec 2022 11:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=OWNuZYCaMdD0VqCL395Kor3n/H1hGaRkxYaUC/R9e30=; b=RevcIhrqWVnTCyAyG1KYmPiklVQWXA6oi8x63005w1ZE4ju2L/vacA4mHJ3tzsUG9w tm5E52DZ1yKiQv8pr++SD+Rs/mldhfd1d6nlHjOudWQnSdRCzhgib95wcTln9tJ3kCOV nGeUsUR+5Jpjs+vcGTPCLqGeHyTnuYy6ssOnebtfbiqypMz1LCoi/zuDJNTwvpDetH7v hiZapLh9uGgpwQz708WoD8g3H+Bd3jbX2yfQIs2qyjU2B9q8K63mGE5vwX/1b1TWKFAD ggRTtY0Rvl9k6GEbhiURa3jZBTCeNq4aOO+ob4U7EhG7P4rK1sOpl9qhG2jmBzOoGN0R /ZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OWNuZYCaMdD0VqCL395Kor3n/H1hGaRkxYaUC/R9e30=; b=mQPK/ZEN1Z+4S/emc6FCO+SwTFr+saMB06aIHy1ZNjlVFD57xCjo6mx1FSuEdMfMWV 0sprNYzcbePfnrd9c5zno76/ETYcbsEjoOF69JHlN0GPoqw5uwdP1P/6p+xqPXqSnLYh GPaEx2BbP5ebrXFpqXW1oKZ8A1jmoUz7YCEf5C+LUWHNsCJM4iaMh+ABiw8snWn1mDVI mS/PoG9ENxZaQ/DtoEj8PEwfTr45L9pnW1vW9P2cHdq6jUvU9VPbwgdsX4Y8iHIb81q6 YA+8u1ytmgQT3x+xxnup3b60m1FFTiam1TeinmHTV7QZqhwJLPDS+d9BRyNG5BsR0b3Z k0oQ== X-Gm-Message-State: ANoB5pnHlxZg8aonoj5AYkh14kLhWP5tqm08gg+/ux11eeyUg/g+LhaU B6B21PDx8ETREWS6RV+hooxesjdrHpeUfns= X-Google-Smtp-Source: AA0mqf6anYld01mlT0bgsEUW2E614uK1xY0nfYX11Z7gH5gt8Lz/huRlMVEEPaCK3ttoKX4XoKeMyd/3padWXCE= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a5d:9158:0:b0:6df:b406:273c with SMTP id y24-20020a5d9158000000b006dfb406273cmr21977487ioq.110.1671477542105; Mon, 19 Dec 2022 11:19:02 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:49 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-4-allenwebb@google.com> Subject: [PATCH v8 3/9] scsi/BusLogic: Always include device id table From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb , kernel test robot Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org A future patch makes use of the device table for built-in modules, so do not ifdef out the match id table. Reported-by: kernel test robot Signed-off-by: Allen Webb --- drivers/scsi/BusLogic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index f2abffce26599..0c60867c9e7c0 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -3715,7 +3715,6 @@ static void __exit blogic_exit(void) __setup("BusLogic=", blogic_setup); -#ifdef MODULE /*static struct pci_device_id blogic_pci_tbl[] = { { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, @@ -3731,7 +3730,6 @@ static const struct pci_device_id blogic_pci_tbl[] = { {PCI_DEVICE(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT)}, {0, }, }; -#endif MODULE_DEVICE_TABLE(pci, blogic_pci_tbl); module_init(blogic_init); From patchwork Mon Dec 19 19:18:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077083 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76105C4167B for ; Mon, 19 Dec 2022 19:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbiLSTTV (ORCPT ); Mon, 19 Dec 2022 14:19:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232506AbiLSTTE (ORCPT ); Mon, 19 Dec 2022 14:19:04 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB50F12D0C for ; Mon, 19 Dec 2022 11:19:03 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-3cf0762f741so118755847b3.16 for ; Mon, 19 Dec 2022 11:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=j2p26kH68+WgnYwnXdelBfFnvRqAaD40WaeHNedYNHU=; b=QurtRDMPyKpTVAoluohEB6g89BkGj8nHIYN7x9twKCAjVVb7Z46MJGnl+S3vvpr5+j 6yQN6KoZRmWqvR+PQICSzwW0SIBq3vnWF1bdtSxg0ys/WHdrLRqBWqz3I6gskka/ncN7 ScbBIuOIZKjYiKW7knbqHoPeksu80g8Y+4f1ucjpYcoYrWkEpD2pDXM/JSeg+IOGBRMO RldP9MyuMDt10ZAp4YzpM0wjcHF2Z2jCGkHh0o38Xi3o6kxazRqNxbhrGscrszWsCaQh TgaXJR6YHRbmbYjmKo/3iT5ZpLG3wTcyfvBmqcWd5P5SbAC4Aw76h4FgbU9zdffjfhR4 3A8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j2p26kH68+WgnYwnXdelBfFnvRqAaD40WaeHNedYNHU=; b=UuQsd08hUTN192YjizBNaN+bgHah4HCSdwLc8oJol7wv+6RFiqCJk7mId4R1Llrhdz g5hdogUmScGErde0s8hphCnhoXbGi5Yqe82bJlbcEhbqhzCS9vkpKhCuTR5Y83qpmxNP KvSEJKZXdSGZcvYPPadGGIFQSUjpbZwsFqsK+wpnOHqx+UUTE6/tZEMkv/HDXbRpO3BW QZiz122m/UCzx5U7AN6G/CMVpeuNaS/8Q2OIEDzNbK6sPvfJcbH819LVcnxaK4aqlpc9 io8FhfqNCW74adv8kX/Ybd9VZMMfHuTFgOyfmufrU8y3toeiGLIQbGRpcoTjfF9UsoUH Ymbg== X-Gm-Message-State: ANoB5pnwAcx+4XCKu+iy+TCKjPWgy0PX1UT1+DuCeD7fMSdH0PnJgCny qOLr3dagIl4d6nMSkrt93FS4A76ea78Ddv4= X-Google-Smtp-Source: AA0mqf6dX4h6UF+praOlBe6Ty1rhwe854U2JXGDWpDmBDTz0mT+rdaatesm+Zwdhvx8UPT5OVavHDrHoykap2zU= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a05:690c:f8a:b0:3b4:8af5:48e with SMTP id df10-20020a05690c0f8a00b003b48af5048emr3893210ywb.383.1671477542998; Mon, 19 Dec 2022 11:19:02 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:50 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-5-allenwebb@google.com> Subject: [PATCH v8 4/9] stmpe-spi: Fix typo From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb , kernel test robot Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org A small difference in the name supplied to MODULE_DEVICE_TABLE breaks a future patch set, so fix the typo. Reported-by: kernel test robot Signed-off-by: Allen Webb --- drivers/mfd/stmpe-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c index ad8055a0e2869..6791a53689777 100644 --- a/drivers/mfd/stmpe-spi.c +++ b/drivers/mfd/stmpe-spi.c @@ -129,7 +129,7 @@ static const struct spi_device_id stmpe_spi_id[] = { { "stmpe2403", STMPE2403 }, { } }; -MODULE_DEVICE_TABLE(spi, stmpe_id); +MODULE_DEVICE_TABLE(spi, stmpe_spi_id); static struct spi_driver stmpe_spi_driver = { .driver = { From patchwork Mon Dec 19 19:18:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077082 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51811C4167B for ; Mon, 19 Dec 2022 19:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232633AbiLSTTT (ORCPT ); Mon, 19 Dec 2022 14:19:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232518AbiLSTTF (ORCPT ); Mon, 19 Dec 2022 14:19:05 -0500 Received: from mail-il1-x149.google.com (mail-il1-x149.google.com [IPv6:2607:f8b0:4864:20::149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B13C12D09 for ; Mon, 19 Dec 2022 11:19:04 -0800 (PST) Received: by mail-il1-x149.google.com with SMTP id i14-20020a056e020d8e00b003034b93bd07so7116836ilj.14 for ; Mon, 19 Dec 2022 11:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eqmNATfXsr4DizCCpcth0y0vfLVrabd2UB2TT6EQhwI=; b=nRXB21sdSHLfWpo7N4XIXagu8tN6MLNzEf/XK5MEcty8CuPQL5YMnsqfai5Q+IbdIF 14DWDkSr96sCp8k/zeJi6r+/dxB35qGUcm/v4Imy4LtNfr1hENCjQfCdPqCCXcw1NOpf X5brWGCUwXzedJ4uBBYdErJSmBmo9bZ+VhN4ropseS0jooJkefrkjJCxLUyqEg4yrqwA 2JbTOWGNMctd6cY471HxpoKlkDPq/qR70l7yRpzMa443BWcv5Z/L3CP/YeVU+uugx6+O 8OYloy1b30G4FeiksfDhGmD3kXgh7vcE1sRJe4lOtLajRMKuDx9f2PisIfIiQAmzA7uY UjYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eqmNATfXsr4DizCCpcth0y0vfLVrabd2UB2TT6EQhwI=; b=hf0bmYoUWfCTBh4X5PM/7LXDXZGSFcfA26PbNTOY183yFA1di6WA0niANWmaMpefew Ww4XzPGtGW6F/VrwiK37obSLHFbQyCnUCYNoR5PQeBedFDsp1PJWREeObaablnBhBWca OAXTD+QizObjaPHCA5w9o/CR0sIbe9FS6aH9AFFHEUuLmbl4l1CxQLG4wVWEpz0djJxo bE6g5eaNSPibiCau7rT/IhIJcnsD4ZqYHm5gI2KsmVhQM73FpxWdgGdqKBzDFO3kqQyB pwwIO6RdO7w5pJoU7ViKQPkFaZWF4kdlLNvcviyt3OA+vQsc+akwuYSie//HGDktU3QX WRrw== X-Gm-Message-State: ANoB5pn9/GtQWHEY26XKxoKgZ1WNASKVlBFOX39WhbCwm1EuPp5sQyZP JVA4dLgZJwoQbwJPOVwHb+WJJgCuTooxHxk= X-Google-Smtp-Source: AA0mqf6/69oC+XVcb8sc3AmTmcabYuhNR/zI/qvKBjqLFxGT52ZtwxDb0ia9EL4d7otrnLTHTSp8eFpx2JtnIhc= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a05:6e02:1d84:b0:302:ce48:40ee with SMTP id h4-20020a056e021d8400b00302ce4840eemr35088599ila.157.1671477543996; Mon, 19 Dec 2022 11:19:03 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:51 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-6-allenwebb@google.com> Subject: [PATCH v8 5/9] module.h: MODULE_DEVICE_TABLE for built-in modules From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Implement MODULE_DEVICE_TABLE for build-in modules to make it possible to generate a builtin.alias file to complement modules.alias. Signed-off-by: Allen Webb --- include/linux/module.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/linux/module.h b/include/linux/module.h index ec61fb53979a9..3d1b04ca63505 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -243,7 +243,20 @@ extern void cleanup_module(void); extern typeof(name) __mod_##type##__##name##_device_table \ __attribute__ ((unused, alias(__stringify(name)))) #else /* !MODULE */ -#define MODULE_DEVICE_TABLE(type, name) +/* + * The names may not be unique for built-in modules, so include the module name + * to guarantee uniqueness. + * + * Note that extern is needed because modpost reads these symbols to generate + * modalias entries for each match id in each device table. They are not used + * at runtime. + */ +#define MODULE_DEVICE_TABLE(type, name) \ +extern void *CONCATENATE( \ + CONCATENATE(__mod_##type##__##name##__, \ + __KBUILD_MODNAME), \ + _device_table) \ + __attribute__ ((unused, alias(__stringify(name)))) #endif /* Version of form [:][-]. From patchwork Mon Dec 19 19:18:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077084 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68403C4167B for ; Mon, 19 Dec 2022 19:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbiLSTTX (ORCPT ); Mon, 19 Dec 2022 14:19:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbiLSTTG (ORCPT ); Mon, 19 Dec 2022 14:19:06 -0500 Received: from mail-il1-x149.google.com (mail-il1-x149.google.com [IPv6:2607:f8b0:4864:20::149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F5B12AEF for ; Mon, 19 Dec 2022 11:19:05 -0800 (PST) Received: by mail-il1-x149.google.com with SMTP id l13-20020a056e0212ed00b00304c6338d79so7146216iln.21 for ; Mon, 19 Dec 2022 11:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=QPz4DVz3tZDZwOVeqeTus3Hhdj8ABoJzZwaMAiF7Nxg=; b=HmQ2kiymwOL9kUhLxZJM5G/ssb7viDDO+nKpbR8v8lfSPSJVTzx9nWNNUPPmk32ot4 AYAQGLqdfd2uQnxuJeTBLLzf9JIUunUmXYjXMZVs5D4iEcx0gZ3qiZuPD68M8OmMfX1D P25V4wPBj0wABkx5DUwHuZHIeo8TuT+lW/YpcHxZa2FbT4yAra6jb7zi784dg0mGYxxz dZzJRLxKZAVI9t9aVegiOumN+hBaZLIEEn0DtpTYJVec+5fYEaRFt1C0qlB4Ere3GNiO T4FDM93EieTv4NNVjwjxXEfgriNZTNAPXWacGUOFzKucVaFUUv2EgcDK8276jLq9SkjG Mjjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QPz4DVz3tZDZwOVeqeTus3Hhdj8ABoJzZwaMAiF7Nxg=; b=t6KTmFTjg87CWt0A9X7xD5oKOi1OJ5u5aJXqfY8P6ASzrH2hu6Z4GHpmKKwasS/CBS GfIeltQuclvNK759X29u41gN89/5YeHv2iIyRBoCLPhy5PwyKNqhc3pU2YIGMj3g1xVx cUM1whC8lfIuiSZBcxWUATD7YQnACYAdx9axBbSFbeu10mqNM0ZKjdpmcskl7lBzjHtd 25eCbkTcWkTX2lPuMHCnzHEV2bp069lvq7yoklJrTmWrDew811hZDny017iBmi6N9WGs PaoVj5IJj0XkraM8npQDWrvSwMbZCspSxHLynsbAf0uFYDcC3J2rjBTV6xxB/KezfHX3 OyiA== X-Gm-Message-State: ANoB5pnWivAGmaVLxTjUesQj5STlp/ZQa+FVE7sxgtXzGrDrL6TmaYQ2 +MmiaX66XHEgNObszfTFGhWJMABnPDD1IOk= X-Google-Smtp-Source: AA0mqf6t5nkMBwgRaVv39PyR4Pntw8jUtKj60DAOxmDGxiaFq1PK1JoSJo+d+K7MDtRnJa5HBj0/t3YUMlD6fbY= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a6b:fb06:0:b0:6e0:c4d:65e2 with SMTP id h6-20020a6bfb06000000b006e00c4d65e2mr10765676iog.30.1671477545287; Mon, 19 Dec 2022 11:19:05 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:52 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-7-allenwebb@google.com> Subject: [PATCH v8 6/9] modpost: Track module name for built-in modules From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Keep track of the module name when processing match table symbols. Signed-off-by: Allen Webb --- scripts/mod/file2alias.c | 39 +++++++++++++++++++++++++++++++++++---- scripts/mod/modpost.h | 1 + 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 80d973144fded..e41ff8de7a876 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -28,6 +28,7 @@ typedef Elf64_Addr kernel_ulong_t; #include #endif +#include #include #include @@ -1540,9 +1541,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, Elf_Sym *sym, const char *symname) { void *symval; - char *zeros = NULL; - const char *name, *identifier; - unsigned int namelen; + char *zeros = NULL, *modname_str = NULL; + const char *name, *identifier, *modname; + unsigned int namelen, modnamelen; /* We're looking for a section relative symbol */ if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) @@ -1552,7 +1553,12 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) return; - /* All our symbols are of form __mod____device_table. */ + /* + * All our symbols are either of form + * __mod____device_table + * or + * __mod_____kmod__device_table + */ if (strncmp(symname, "__mod_", strlen("__mod_"))) return; name = symname + strlen("__mod_"); @@ -1564,8 +1570,30 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, identifier = strstr(name, "__"); if (!identifier) return; + modnamelen = namelen; namelen = identifier - name; + /* + * In the vmlinuz.o case we want to handle __kmod_ so aliases from + * builtin modules are attributed correctly. + */ + modname = strstr(identifier + 2, "__kmod_"); + if (modname) { + modname += strlen("__kmod_"); + modnamelen -= (modname - name) + strlen("_device_table"); + modname_str = malloc(modnamelen + 1); + /* We don't want to continue if the allocation fails. */ + assert(modname_str); + memcpy(modname_str, modname, modnamelen); + modname_str[modnamelen] = '\0'; + } + + if (modname_str) + modname = modname_str; + else + modname = mod->name; + mod->builtin_name = modname; + /* Handle all-NULL symbols allocated into .bss */ if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { zeros = calloc(1, sym->st_size); @@ -1597,6 +1625,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, } } free(zeros); + mod->builtin_name = NULL; + if (modname_str) + free(modname_str); } /* Now add out buffered information to the generated C source */ diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 1178f40a73f3d..34fe5fc0b02cb 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -128,6 +128,7 @@ struct module { struct list_head missing_namespaces; // Actual imported namespaces struct list_head imported_namespaces; + const char *builtin_name; char name[]; }; From patchwork Mon Dec 19 19:18:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077085 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F492C3DA71 for ; Mon, 19 Dec 2022 19:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232688AbiLSTTZ (ORCPT ); Mon, 19 Dec 2022 14:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbiLSTTH (ORCPT ); Mon, 19 Dec 2022 14:19:07 -0500 Received: from mail-il1-x14a.google.com (mail-il1-x14a.google.com [IPv6:2607:f8b0:4864:20::14a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3FFB11804 for ; Mon, 19 Dec 2022 11:19:06 -0800 (PST) Received: by mail-il1-x14a.google.com with SMTP id k6-20020a92c246000000b003035797fa8cso7048392ilo.8 for ; Mon, 19 Dec 2022 11:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=s1QcpBS4B8OCRMlI6Nk9ugzJN1lhkA3oxgxR2mhdmU8=; b=aZSbLaOZ+GBeKFR5sV7mPGP78KGpvjTZ3MVNmDTTr3vK2vxqlTxaSwFQJjSYRriUaB hBXx8NVlBOEdWV0XBakPDChmJfeYXq/KDIQtSrKNqPloEIfLgX2nHAG7k6X+lB1tnjYM 0mFrrmAZ7Mmm3N+9dFxfanyG1qvWdmzDesSLvdrE11LszZWtyNsUREiJyWszo93d8/8s HkCNzmvjGCBnKWb9Mx+udAyuhWBHsxVW94Qy+oRRLOnen7JvimnimXhXLv1EQ45OwmKM bKoLNuibpikmWKZ2I7QHTSn0jSdnhlhqur/sdZeXpjlm3604hHGT//rcrgKdKoByq94H dY9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s1QcpBS4B8OCRMlI6Nk9ugzJN1lhkA3oxgxR2mhdmU8=; b=jmO55Bg39M7Y9Oa7u9uCPhpjtgwcxfFYccGzTcX4n5Dd9OE9kkxaOkw+2NDnOOjOil BgXItPEXraLrwnfN+mt7N7+Ct9sh8BRE1BHVBTLSqq3EDNiwwaVdmzWYmM8T3RgYBDWb Hjy8+mQrg+0MlmuB/t42v/cyn5uh6bSA2QysGRO4bknDNn+eX9UBr5AG8ECcYo2AnXeB FvNFtTrc+W299o27j2lkP12sGgAexD6yWvzBa6H5A9JFCxL1phPHfJ4yPL2ilC2pnPwi q0/y6iGLtl3qCDh/cHBOgNq07JfCvsZvoqPuPGp2fwf+/OvYcUjVs++Xk0rc/n/CFdsT yx+g== X-Gm-Message-State: ANoB5ploB8OXyCpMMrBKd41lTkmA//fK9QDEMKms54oNhVJO4dsK7sLk NbiKFFPdNHYSXlU+hf7lwfi993PLKXuzncE= X-Google-Smtp-Source: AA0mqf76MaacOi4aEpvJ1Isi5klDCra6Jw1gbQxSu25hAbLCWIci9uOG76PMh89gkoiPFeNvKRhu/nk8686ayas= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a02:c6a5:0:b0:38a:7bae:6a60 with SMTP id o5-20020a02c6a5000000b0038a7bae6a60mr5324846jan.37.1671477546412; Mon, 19 Dec 2022 11:19:06 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:53 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-8-allenwebb@google.com> Subject: [PATCH v8 7/9] modpost: Add -b option for emitting built-in aliases From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This adds an unimplemented command line flag for writing the built-in aliases to a file. Signed-off-by: Allen Webb --- scripts/mod/modpost.c | 23 +++++++++++++++++++++-- scripts/mod/modpost.h | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2c80da0220c32..e38d6b2ceea40 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2165,6 +2165,19 @@ static void write_if_changed(struct buffer *b, const char *fname) write_buf(b, fname); } +/* Write the builtin aliases to the specified file. */ +static void write_builtin(const char *fname) +{ + struct buffer buf = { }; + struct module *mod; + + list_for_each_entry(mod, &modules, list) + buf_write(&buf, mod->modalias_buf.p, mod->modalias_buf.pos); + + write_if_changed(&buf, fname); + free(buf.p); +} + static void write_vmlinux_export_c_file(struct module *mod) { struct buffer buf = { }; @@ -2321,13 +2334,16 @@ int main(int argc, char **argv) { struct module *mod; char *missing_namespace_deps = NULL; - char *dump_write = NULL, *files_source = NULL; + char *builtin_write = NULL, *dump_write = NULL, *files_source = NULL; int opt; LIST_HEAD(dump_lists); struct dump_list *dl, *dl2; - while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) { + while ((opt = getopt(argc, argv, "b:ei:mnT:o:awENd:")) != -1) { switch (opt) { + case 'b': + builtin_write = optarg; + break; case 'e': external_module = true; break; @@ -2390,6 +2406,9 @@ int main(int argc, char **argv) write_mod_c_file(mod); } + if (builtin_write) + write_builtin(builtin_write); + if (missing_namespace_deps) write_namespace_deps_files(missing_namespace_deps); diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 34fe5fc0b02cb..c55a6aeb46bfd 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -123,6 +123,7 @@ struct module { bool has_init; bool has_cleanup; struct buffer dev_table_buf; + struct buffer modalias_buf; char srcversion[25]; // Missing namespace dependencies struct list_head missing_namespaces; From patchwork Mon Dec 19 19:18:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077086 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56874C4332F for ; Mon, 19 Dec 2022 19:19:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232701AbiLSTT0 (ORCPT ); Mon, 19 Dec 2022 14:19:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232410AbiLSTTJ (ORCPT ); Mon, 19 Dec 2022 14:19:09 -0500 Received: from mail-io1-xd49.google.com (mail-io1-xd49.google.com [IPv6:2607:f8b0:4864:20::d49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277DD120B6 for ; Mon, 19 Dec 2022 11:19:08 -0800 (PST) Received: by mail-io1-xd49.google.com with SMTP id n23-20020a056602341700b00689fc6dbfd6so4454125ioz.8 for ; Mon, 19 Dec 2022 11:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=cjGe6fxSS7cTt3mra7vAbJD0wH3tbfNYD/FCvl4NRMk=; b=FwO+EN0GRH6yMNy3i+aRaQi4k6ltrzQBDq0j2HgKcM4M/i0+GG/Tmh4ilo2ihykEDy Z3DOBVb7Hmq/tEN1Fv7roWQ+ePXHhHxxxbUSha5Tue3vGD0YSCIw5CdxZJ10vUa7j4sz /DDGenrw2NvJi/Pse/FoKztr5v6NXg/S7iy9zlEKswHs50EeHpMw/wCmWIvNVAAl/sJQ nVcs8jSLbqOYsGA7sZaPExqgzl0/OLlwn7nJM5YDweKk2lSBKB2VNh6AdN/9jDCPPRDt k8HINHwwMp2JVSAhC7XTE1zZqkTsd+OcFG5w7tdcU20hhKaWWMZrWhIcKMp2nvsSChQ9 4WzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cjGe6fxSS7cTt3mra7vAbJD0wH3tbfNYD/FCvl4NRMk=; b=raKgnVvyLJ3kBl1zl9+nEuuCKZLMxSft2tN0W/Bkpz757pMfDajmuyaFzrdFQX1O2l ffzGNV9XKJmB9DRELLLxekTph22qWmek9YA6h1PeiyEK5f6k7Bd3MweAoiZv+kYi/m9b 5xGXakfBiZJ8su/RYHiEWgjHAfXW8RxEpsIEd9+yNbb/8sdkDCgNJeZHfCn/7uPcDhq8 eyj8IkaqA26WYRVo2RHbb8CmddtSXfSG9NovBQpScvIAtiNxzuy+akATryien6kis0T4 Y+HWbsEL23fTeCMFOf5YhY5gHYqGeTjZ8HJeavMyP8YlNqCtsF0Z9wNrhkcuvP5boadj qodw== X-Gm-Message-State: AFqh2kpiBlsDdXpVuTBGhMeLzKp9ma+vsZjAu5sFeoYIb63RgsY529Oy DQB3jq9I0ftbR6wEftfLb6fTeEY1kde9vms= X-Google-Smtp-Source: AMrXdXtEWFR5m+TguTy7DMteh2YUscW21cjm7GoJQqd4O805GlSojiqfl7ZGAJOibTR3VFOZRn9mfAPK7+rMVYU= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a05:6e02:2207:b0:30b:c336:8a83 with SMTP id j7-20020a056e02220700b0030bc3368a83mr61889ilf.92.1671477547452; Mon, 19 Dec 2022 11:19:07 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:54 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-9-allenwebb@google.com> Subject: [PATCH v8 8/9] file2alias.c: Implement builtin.alias generation From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This populates the mod->modalias_buf with aliases for built-in modules when modpost is run against vmlinuz.o. Signed-off-by: Allen Webb --- scripts/mod/file2alias.c | 55 +++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index e41ff8de7a876..e840cb51281a4 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -232,6 +232,8 @@ static void do_usb_entry(void *symval, add_wildcard(alias); buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"%s\");\n", alias); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias %s %s\n", alias, mod->builtin_name); } /* Handles increment/decrement of BCD formatted integers */ @@ -376,9 +378,13 @@ static void do_of_entry_multi(void *symval, struct module *mod) *tmp = '_'; buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"%s\");\n", alias); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias %s %s\n", alias, mod->builtin_name); strcat(alias, "C"); add_wildcard(alias); buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"%s\");\n", alias); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias %s %s\n", alias, mod->builtin_name); } static void do_of_table(void *symval, unsigned long size, @@ -610,12 +616,18 @@ static void do_pnp_device_entry(void *symval, unsigned long size, buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"pnp:d%s*\");\n", *id); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias pnp:d%s* %s\n", + *id, mod->builtin_name); /* fix broken pnp bus lowercasing */ for (j = 0; j < sizeof(acpi_id); j++) acpi_id[j] = toupper((*id)[j]); buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias acpi*:%s:* %s\n", + acpi_id, mod->builtin_name); } } @@ -637,6 +649,8 @@ static void do_pnp_card_entries(void *symval, unsigned long size, const char *id = (char *)(*devs)[j].id; int i2, j2; int dup = 0; + char acpi_id[PNP_ID_LEN]; + int k; if (!id[0]) break; @@ -662,19 +676,23 @@ static void do_pnp_card_entries(void *symval, unsigned long size, } /* add an individual alias for every device entry */ - if (!dup) { - char acpi_id[PNP_ID_LEN]; - int k; - - buf_printf(&mod->dev_table_buf, - "MODULE_ALIAS(\"pnp:d%s*\");\n", id); - - /* fix broken pnp bus lowercasing */ - for (k = 0; k < sizeof(acpi_id); k++) - acpi_id[k] = toupper(id[k]); - buf_printf(&mod->dev_table_buf, - "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id); - } + if (dup) + continue; + + buf_printf(&mod->dev_table_buf, + "MODULE_ALIAS(\"pnp:d%s*\");\n", id); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias pnp:d%s* %s\n", + id, mod->builtin_name); + + /* fix broken pnp bus lowercasing */ + for (k = 0; k < sizeof(acpi_id); k++) + acpi_id[k] = toupper(id[k]); + buf_printf(&mod->dev_table_buf, + "MODULE_ALIAS(\"acpi*:%s:*\");\n", acpi_id); + if (mod->builtin_name) + buf_printf(&mod->modalias_buf, "alias acpi*:%s:* %s\n", + acpi_id, mod->builtin_name); } } } @@ -1476,10 +1494,13 @@ static void do_table(void *symval, unsigned long size, size -= id_size; for (i = 0; i < size; i += id_size) { - if (do_entry(mod->name, symval+i, alias)) { - buf_printf(&mod->dev_table_buf, - "MODULE_ALIAS(\"%s\");\n", alias); - } + if (!do_entry(mod->name, symval + i, alias)) + continue; + buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"%s\");\n", alias); + if (!mod->builtin_name) + continue; + buf_printf(&mod->modalias_buf, "alias %s %s\n", alias, + mod->builtin_name); } } From patchwork Mon Dec 19 19:18:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Webb X-Patchwork-Id: 13077087 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEAD8C4332F for ; Mon, 19 Dec 2022 19:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232743AbiLSTT4 (ORCPT ); Mon, 19 Dec 2022 14:19:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232570AbiLSTTK (ORCPT ); Mon, 19 Dec 2022 14:19:10 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58ECD11C3E for ; Mon, 19 Dec 2022 11:19:09 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id y66-20020a25c845000000b00733b5049b6fso11752730ybf.3 for ; Mon, 19 Dec 2022 11:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=iIc91OoDv/mBPCGHIucL2csPnIlsRLcBZ/NTNtcT38Q=; b=r8vPBYkfeyPzl0oDj/LTaQo+BZJ7LAkSF5428uTADVbbx4PH0krjcafDDu6HZWVLF/ 6PK65zYCRLx/WopxRxp3Uxjzj32xc++LBtmmCjcK2Lyfa7QDmG2wr1AIhBOfBpd0y3F7 rF2zLFeT9NcKM2MJOlwDxsbVXrKJh0y5EPJTqXSFHIG6d7wT5rmbIPq0ZDA/lSNQWRc5 KvvsyX7kLtAAyaI7OeQ02ycGiFds8HatG+Vilc1GVYOq7oIhPCaeyM5NLsyGFMozcp/1 bonJrRbgxss5V5/ewRa+AQlechuVqx9l2/cIaFE8w2rGn+vMfAefFzxcNb/DmiWg4tVI 5RLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iIc91OoDv/mBPCGHIucL2csPnIlsRLcBZ/NTNtcT38Q=; b=L1QA7kpmpDb1zZitRvbDY2e6mpu2norcvJwJXL4R427heRmY/wb2yYoFfQlirHgldx YZqPicuK6RMgrfByXfXMMy6str56LyQp/BJJQQ7PfZ2HxyzMgNFP8lpAA2TR666tTzn8 vQI3a+QDZqYqeg0BrXhhAgnDJRQ/33wxeVRNN3iKcuOV8l7QJ5uI3CWHAHgTIQFKt19k nRDipRoQ5Z/Xk9a1oWwUcIBTUJtIsPJ+GPSa3/MExI8luqHOEnaFnKTkkK+SBfHDdMIC 9qH3oabcmwsnANKaZV9oYDjLky1yI0hnpj3ifrWRfNyeSGkLn/4IqARBfLfiogdD1SKj SxVg== X-Gm-Message-State: AFqh2kqI4sw3Cd2rtfLZfVbCLhVU6jVSoZzGpt+2N0kHOTfmXgPFNZ8C RzDjcNZYPkXLrODOQNCmCJsbYMhGTIOZ32s= X-Google-Smtp-Source: AMrXdXu1UOgFHyAN6NsQ+1XaAW4P5yWDQtrcqIFXvJe7O6WezqPpzlP5r7QSr5cq4wj/GeiMHPgpVcqbt1X8myM= X-Received: from allenwebb.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:12e8]) (user=allenwebb job=sendgmr) by 2002:a0d:c901:0:b0:349:a017:8dcc with SMTP id l1-20020a0dc901000000b00349a0178dccmr858068ywd.258.1671477548552; Mon, 19 Dec 2022 11:19:08 -0800 (PST) Date: Mon, 19 Dec 2022 13:18:55 -0600 In-Reply-To: <20221219191855.2010466-1-allenwebb@google.com> Mime-Version: 1.0 References: <20221216221703.294683-1-allenwebb@google.com> <20221219191855.2010466-1-allenwebb@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221219191855.2010466-10-allenwebb@google.com> Subject: [PATCH v8 9/9] build: Add modules.builtin.alias From: Allen Webb To: "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Luis Chamberlain , Greg Kroah-Hartman , "Rafael J. Wysocki" , Allen Webb Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Generate modules.builtin.alias using modpost and install it with the modules. Signed-off-by: Allen Webb --- .gitignore | 1 + Makefile | 1 + scripts/Makefile.modpost | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 47229f98b327b..40a90bca89641 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ modules.order /System.map /Module.markers /modules.builtin +/modules.builtin.alias /modules.builtin.modinfo /modules.nsdeps diff --git a/Makefile b/Makefile index 78525ebea8762..572f364f40538 100644 --- a/Makefile +++ b/Makefile @@ -1558,6 +1558,7 @@ __modinst_pre: fi @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order @cp -f modules.builtin $(MODLIB)/ + @cp -f modules.builtin.alias $(MODLIB)/ @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ endif # CONFIG_MODULES diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index e41dee64d429c..94c1d66c7769a 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -15,6 +15,7 @@ # 2) modpost is then used to # 3) create one .mod.c file per module # 4) create one Module.symvers file with CRC for all exported symbols +# 5) create modules.builtin.alias the aliases for built-in modules # Step 3 is used to place certain information in the module's ELF # section, including information such as: @@ -51,6 +52,21 @@ ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),) modpost-args += -n endif +vmlinux.o-if-present := $(wildcard vmlinux.o) +ifneq ($(vmlinux.o-if-present),) +output-builtin.alias := modules.builtin.alias +modpost-args += -b .modules.builtin.alias.in +.modules.builtin.alias.in: $(output-symdump) + @# Building $(output-symdump) generates .modules.builtin.alias.in as a + @# side effect. + @[ -e $@ ] || $(MODPOST) -b .modules.builtin.alias.in $(vmlinux.o-if-present) + +$(output-builtin.alias): .modules.builtin.alias.in + sort -o $@ $^ + +__modpost: $(output-builtin.alias) +endif + ifeq ($(KBUILD_EXTMOD),) # Generate the list of in-tree objects in vmlinux @@ -78,7 +94,6 @@ targets += .vmlinux.objs .vmlinux.objs: vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE $(call if_changed,vmlinux_objs) -vmlinux.o-if-present := $(wildcard vmlinux.o) output-symdump := vmlinux.symvers ifdef KBUILD_MODULES