From patchwork Sat Jan 23 03:44:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 370067 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 4F24EC433E9 for ; Sat, 23 Jan 2021 03:45:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2421C23B21 for ; Sat, 23 Jan 2021 03:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbhAWDpP (ORCPT ); Fri, 22 Jan 2021 22:45:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbhAWDpN (ORCPT ); Fri, 22 Jan 2021 22:45:13 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9640C061788 for ; Fri, 22 Jan 2021 19:44:32 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id my11so7254049pjb.1 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=M6EwUvjnOh+5MAGherjzP65Kv8h0qtvzo2h+L+LrQYIIuoW8V1KFpot14ZNo8GcjNv vJftd+j+fIVTYvJt+EDzfxRc98hcADUzti0G1PP5KhJ3k5LwlgQckFTvt43iWB7vcnh1 msNup1a+qZ+cmwfkpBWHMOF6KR5fN637SvMdM61XAF/sTSCGx+Kzb6aMglQ45tDyHvd3 ya3REC9FOykJqHp5M1bha1XwfCsn187Js+pNwHY/2a32ph1g4hPTWEudx9iCu4lqvgAV NBlO8pvuwc3lirjNkqmpcWfrRNHOJU0YmTmPgIRTBobH0Md6Hvcc2xORNSMyltQJVM2D pW5A== X-Gm-Message-State: AOAM530S/oecIz9O0auGRTyLlBStdLA0Exde2IRRppJmxwqIbWmGlFk+ 3vFa8ruchkzX1Bgs62NxrW2E2Q== 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 Precedence: bulk List-ID: X-Mailing-List: linux-serial@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