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 D3A6FC7EE29 for ; Wed, 7 Jun 2023 06:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237833AbjFGGe2 (ORCPT ); Wed, 7 Jun 2023 02:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235279AbjFGGd5 (ORCPT ); Wed, 7 Jun 2023 02:33:57 -0400 Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3164AA for ; Tue, 6 Jun 2023 23:33:26 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 33f50993-04fd-11ee-a9de-005056bdf889; Wed, 07 Jun 2023 09:33:24 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Wed, 7 Jun 2023 09:33:23 +0300 To: Oleksii Moisieiev Cc: "sudeep.holla@arm.com" , Cristian Marussi , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" Subject: Re: [PATCH v3 1/4] firmware: arm_scmi: Add optional flags to extended names helper Message-ID: References: <2ad06a5582bb31e16fe2f497e15cb41e8455e863.1686063941.git.oleksii_moisieiev@epam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ad06a5582bb31e16fe2f497e15cb41e8455e863.1686063941.git.oleksii_moisieiev@epam.com> Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Tue, Jun 06, 2023 at 04:22:27PM +0000, Oleksii Moisieiev kirjoitti: > Some recently added SCMI protocols needs an additional flags parameter to > be able to properly configure the command used to query the extended name > of a resource. ... > put_unaligned_le32(res_id, t->tx.buf); > + if (flags) > + put_unaligned_le32(*flags, > + (u8 *)t->tx.buf + sizeof(res_id)); I believe this can be one line, esp. if the buffer is void *, you do not need an explicit casting, void * pointer arithmetics is byte-based (yes, non-standard but very widely used in the kernel). > resp = t->rx.buf; -- With Best Regards, Andy Shevchenko