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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D5C4CCA47C for ; Tue, 14 Jun 2022 08:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353036AbiFNI1L (ORCPT ); Tue, 14 Jun 2022 04:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237658AbiFNI1K (ORCPT ); Tue, 14 Jun 2022 04:27:10 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334EA41F93; Tue, 14 Jun 2022 01:27:10 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 54F8566016A5; Tue, 14 Jun 2022 09:27:07 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655195228; bh=6BHp+SEqrOka0kJh1K6ITLyHzwfMQZol0v1SsMsiHFA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iMOU2MsD9iUiBXCCIY+n5CEX/lUopW1GCACEuG/8g73YQBHeoFkGX2Q7X6esAk4mS i3pbxbMWuqgU5Soctlwin40oVpEoAjhDb6lgE1VRBcmF692J0hkTtck3nz6ohK0Gh/ ZYpWgWMgwRTum8jXRutZfRHUjVFdxhF0uuU3pZLoOej4Rg7qBb/EdsJqqXrnxwhFqW OWzBS3fL++iXbG8baGbCpZ9FiESUCgSrYkZseWInfCzKiGoOL4mNK6rh1B99dVXiSC WLOznbGnIKtjwUvYKdk3etkznlIWQt9KGaoaTS46vqGTdFa8KW2/PzgufZu6W//IxM 0Omj2zmt6duHA== Message-ID: <82e0812e-c6db-9f69-b968-794a0f6b915a@collabora.com> Date: Tue, 14 Jun 2022 10:27:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2 2/7] usb: typec: mux: Add CONFIG guards for functions Content-Language: en-US To: Prashant Malani , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: heikki.krogerus@linux.intel.com, Andrzej Hajda , Neil Armstrong , David Airlie , "open list:DRM DRIVERS" , Laurent Pinchart , Krzysztof Kozlowski , Sam Ravnborg , kernel test robot , Jernej Skrabec , Tzung-Bi Shih , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Thomas Zimmermann , =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Jonas Karlman , swboyd@chromium.org, Pin-Yen Lin , Rob Herring , Maxime Ripard , Hsin-Yi Wang , Xin Ji , Greg Kroah-Hartman , Robert Foss , =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= References: <20220609181106.3695103-1-pmalani@chromium.org> <20220609181106.3695103-3-pmalani@chromium.org> From: AngeloGioacchino Del Regno In-Reply-To: <20220609181106.3695103-3-pmalani@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Il 09/06/22 20:09, Prashant Malani ha scritto: > There are some drivers that can use the Type C mux API, but don't have > to. Introduce CONFIG guards for the mux functions so that drivers can > include the header file and not run into compilation errors on systems > which don't have CONFIG_TYPEC enabled. When CONFIG_TYPEC is not enabled, > the Type C mux functions will be stub versions of the original calls. > > Reported-by: kernel test robot > Signed-off-by: Prashant Malani > --- > > Changes since v1: > - Added static inline to stub functions. > - Updated function signature of stub functions from "struct typec_mux" > to "struct typec_mux_dev" in accordance with updates from commit > 713fd49b430c ("usb: typec: mux: Introduce indirection") > > include/linux/usb/typec_mux.h | 38 +++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > > diff --git a/include/linux/usb/typec_mux.h b/include/linux/usb/typec_mux.h > index ee57781dcf28..9eda6146fd26 100644 > --- a/include/linux/usb/typec_mux.h > +++ b/include/linux/usb/typec_mux.h > @@ -58,6 +58,8 @@ struct typec_mux_desc { > void *drvdata; > }; > > +#if IS_ENABLED(CONFIG_TYPEC) || IS_MODULE(CONFIG_TYPEC) IS_ENABLED(x) evaluates to 1 when (x == 'y' || x == 'm') IS_MODULE(x) evaluates to 1 when (x == 'm') ....this means that a IS_ENABLED(CONFIG_TYPEC) check is enough, and the latter is redundant. Regards, Angelo