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=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 0105AC433E6 for ; Sat, 23 Jan 2021 03:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8D2D23B21 for ; Sat, 23 Jan 2021 03:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbhAWDp7 (ORCPT ); Fri, 22 Jan 2021 22:45:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbhAWDpy (ORCPT ); Fri, 22 Jan 2021 22:45:54 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF12CC061794 for ; Fri, 22 Jan 2021 19:44:32 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id q2so1620164plk.4 for ; Fri, 22 Jan 2021 19:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=T2zUOMuYBsp0xa+C63qhybgwegJ8SB3Z5I9fwiJv468=; b=PRYgioSsxf0GbBLKdvEOl43mw9Aiuqs/hQuhRLx2SFwqy8rX5AeKEZSZpSNxTwoOeJ t2BmPA9Zqcn6T5n9kx1zfbkdtceWlN+cpdMOxV5wUJLEpHw1VLu4hv7dC+xAXYgPzcPc cxfTSvM6ujZjysYfxhvR0FilC+Kxu3p1WY8K4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=T2zUOMuYBsp0xa+C63qhybgwegJ8SB3Z5I9fwiJv468=; b=GPNc5Q5CMod2BUI3aLz3BA6OCECcCkfLnmG+Hh9U4rjYnQt/3A3APtGZomsscQmJxc F3FWDjSf4bXHWKkcruotLT21662ub8bHz0iv9OR83XrKpzy/v94Rw9O4yAtNlJOTKshM KSBQoEqbmjRaNRszBPW6xVzCqkqbGrcoMQ8Ff/BwnGv57cjA9hASPF6fFp4XWY33M8I0 OvmCAlNTcC1eHQj3WDvNFe69tACrgDA/Hv7lWYnTPmlbmD4bjBvv8VUZbUUctipYRPsM IzHjVt8Dm/VJSr04wdS4lvE3i99YK/hcSSwCI7FZ3TR4xghm0zgQdgoS5AJSwuUX1pZp ZFVg== X-Gm-Message-State: AOAM533yuiVuMLOvN3/kB1qnrD7Lk5yQlIgkPlp1hQ58hSyxgtttXySO PX3LlGWH7hwJgrFJOAzsGdf4+Q== X-Google-Smtp-Source: ABdhPJyd7fFDZv6n2P9mHgXUxsP3pGyEOW4hJ+i/rwmCQeMc2Toy8idB/lj4h/4jokogwBeJ/kWUpg== X-Received: by 2002:a17:902:ee11:b029:df:e6ac:c01 with SMTP id z17-20020a170902ee11b02900dfe6ac0c01mr489404plb.65.1611373472221; Fri, 22 Jan 2021 19:44:32 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id gf23sm10480343pjb.42.2021.01.22.19.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 19:44:31 -0800 (PST) From: Stephen Boyd To: Rob Herring Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Torgue , Arnd Bergmann , "David S. Miller" , Frank Rowand , Geert Uytterhoeven , Greg Kroah-Hartman , Grygorii Strashko , Guenter Roeck , Jacopo Mondi , Jean Delvare , Jiri Slaby , linux-hwmon@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, Mauro Carvalho Chehab , Maxime Coquelin , Richard Leitner , Rob Herring Subject: [PATCH v2 0/6] Stop NULLifying match pointer in of_match_device() Date: Fri, 22 Jan 2021 19:44:22 -0800 Message-Id: <20210123034428.2841052-1-swboyd@chromium.org> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (This is a continuation of this series[1] per Rob's request. I've picked up the acks, etc. with b4 and compile tested the patches along with an arm64 allmodconfig build. Presumably Rob will pick these up directly.) of_match_device() uses of_match_ptr() to make the match table argument NULL via the pre-processor when CONFIG_OF=n. This makes life harder for compilers who think that match tables are never used and warn about unused variables when CONFIG_OF=n. This series changes various callers to use of_device_get_match_data() instead, which doesn't have this problem, and removes the of_match_ptr() usage from of_match_device() so that the compiler can stop complaining about unused variables. It will do dead code elimination instead and remove the match table if it isn't actually used. [1] https://lore.kernel.org/r/20191004214334.149976-1-swboyd@chromium.org Cc: Alexandre Torgue Cc: Arnd Bergmann Cc: "David S. Miller" Cc: Frank Rowand Cc: Geert Uytterhoeven Cc: Greg Kroah-Hartman Cc: Grygorii Strashko Cc: Guenter Roeck Cc: Jacopo Mondi Cc: Jean Delvare Cc: Jiri Slaby Cc: Cc: , Cc: Cc: Cc: Cc: Cc: Cc: Mauro Carvalho Chehab Cc: Maxime Coquelin Cc: Richard Leitner Cc: Rob Herring Stephen Boyd (6): media: renesas-ceu: Use of_device_get_match_data() drivers: net: davinci_mdio: Use of_device_get_match_data() serial: stm32: Use of_device_get_match_data() usb: usb251xb: Use of_device_get_match_data() hwmon: (lm70) Avoid undefined reference to match table of/device: Don't NULLify match table in of_match_device() with CONFIG_OF=n drivers/hwmon/lm70.c | 2 +- drivers/media/platform/renesas-ceu.c | 2 +- drivers/net/ethernet/ti/davinci_mdio.c | 12 ++--- drivers/tty/serial/stm32-usart.c | 71 ++++++++++++-------------- drivers/tty/serial/stm32-usart.h | 2 +- drivers/usb/misc/usb251xb.c | 12 ++--- include/linux/of_device.h | 4 +- 7 files changed, 47 insertions(+), 58 deletions(-) base-commit: 19c329f6808995b142b3966301f217c831e7cf31 -- https://chromeos.dev