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 22EAEC32772 for ; Tue, 16 Aug 2022 07:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbiHPH4u (ORCPT ); Tue, 16 Aug 2022 03:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiHPH4X (ORCPT ); Tue, 16 Aug 2022 03:56:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2B0A00F6 for ; Mon, 15 Aug 2022 22:11:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9AFEAB815A6 for ; Tue, 16 Aug 2022 05:11:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8B27C433D6; Tue, 16 Aug 2022 05:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660626697; bh=VTfuQNZqqRUtXPfUaP+wKO7HWPRqgktoX0lYnO9MlWw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FSvN+1NUIylb/EyTqC0Tj6dbuDQGXtHcwgv9wsru0mqhvE9EkBjZ+w5o67jRlZKox jn687pLzHh6Kbcu7959MTVBduPcqdrgO1wY2/Z0MqaqzcOg3qOOwO1HxQwhO/Hnkfc buBHaE+IXJuTS9QCcHHhU/4p0suMj9oHys3wsiMxZY/tE8/akv6nndgORfLFffpsOQ HnGvneXbnQxwmjtJBe47yg6CBunrS4GomBwLEklKt51fP7RFWSe0SMEnw1hzmYHsOm Dvy4O9xz+i0NZVLTofhzTvGoy9EekRVrJ3TufncBDAaqi7FR7a4yfZN5k76sZHApO6 Qi14Ni8FPTyeg== Date: Tue, 16 Aug 2022 05:11:33 +0000 From: Tzung-Bi Shih To: Prashant Malani Cc: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, bleung@chromium.org, Daisuke Nojiri , "Dustin L. Howett" , Greg Kroah-Hartman , Guenter Roeck , "Gustavo A. R. Silva" , Tinghan Shen , Xiang wangx Subject: Re: [PATCH v5 3/7] platform/chrome: cros_typec_switch: Set EC retimer Message-ID: References: <20220815063555.1384505-1-pmalani@chromium.org> <20220815063555.1384505-4-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220815063555.1384505-4-pmalani@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 15, 2022 at 06:34:21AM +0000, Prashant Malani wrote: > +static int cros_typec_cmd_mux_set(struct cros_typec_switch_data *sdata, int port_num, u8 index, > + u8 state) > +{ > + struct typec_usb_mux_set params = { > + .mux_index = index, > + .mux_flags = state, > + }; > + > + struct ec_params_typec_control req = { > + .port = port_num, > + .command = TYPEC_CONTROL_COMMAND_USB_MUX_SET, > + .mux_params = params, > + }; Would it be better to avoid the memory copy by making `params` inline? E.g.: struct ec_params_typec_control req = { ... .mux_params = { ... }, ... > +/* > + * The Chrome EC treats both mode-switches and retimers as "muxes" for the purposes of the To be consistent to the series, I guess you would like to use ChromeOS instead of Chrome?