Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1239157iog; Tue, 14 Jun 2022 02:02:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3dJhpUMHymDEWjRhPBGR60b5QpQD0JOiEV6juTqQpZNT6DkZh2FQd9J5kOq5P/8yuoGoQ X-Received: by 2002:a17:907:6f07:b0:715:7e23:bbb7 with SMTP id sy7-20020a1709076f0700b007157e23bbb7mr3248528ejc.462.1655197332124; Tue, 14 Jun 2022 02:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655197332; cv=none; d=google.com; s=arc-20160816; b=anRVjc+9UnXoT86P0OYC4soz3xnaA1LIOCizlGMW54EwFwSV9v+BtLEUUOdpuboE6P 0fhLB2cdC7BbZr67gOvBDLGMS2tk/VZT65T4eFNQCZgRK4ll3bs5+TNCWfSxKsSynG+d hJhQoyj+OUbuPwBh98v5jNnIn9c+aZpyu1wXMUX7K6VVeoSLHg0h9dl4dOwiV8D2srfy oQYoOPRXl/7eJO8xecXE/fvRlLyfPTK4/MUpmP+HBXlUJOUpJHltQzoBwtyzswvs/NKL 9nHwU/ByMdEmpq/iqkhkbQFE45BOtFGy/GDW/BGLdMmotQVwbO+dADfRnnu/EmOpWb5h e34Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/j7o7/6sums0kP1UeIQpthV3rS9lh1aenM5DuXHlO6U=; b=we0p3kGDr7QkH2tHHPz2AvpPvmfpbzAzSFI+wkGGv/t19CCuliopwVwSeJmz/ZU7kn SS0gF4z+thF9TpPh8d3qAq3hn3I1DgUQgN0+bi7w+EpLLh8XpYWiAR2v+GVg7uieot/A DPZjqm/+zy9pbCab8HQh1EUq492TrYMPv9hTDJ2i2z1aBntpZ7Fp7ySgnaK7q8lnvzIi LMYbBqqHUIrIRMfYFGgNZrh7v16QFSnwEKtyJ7I41XkYjpNqK0gozjKBtdYaPgZbMrnj b7xSAiZTtzVJwn3jh8STXq6kLXzEsizSXSpZ7/ge3IHhGMKuFFVbZq2rvGO2nFDnMpck R4ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iMOU2MsD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s29-20020a170906779d00b007121c97d1d5si11011201ejm.711.2022.06.14.02.01.45; Tue, 14 Jun 2022 02:02:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iMOU2MsD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353079AbiFNI1N (ORCPT + 99 others); Tue, 14 Jun 2022 04:27:13 -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 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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