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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C91C3C433F5 for ; Fri, 1 Oct 2021 10:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B853C6134F for ; Fri, 1 Oct 2021 10:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353437AbhJAKMD (ORCPT ); Fri, 1 Oct 2021 06:12:03 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:25615 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353428AbhJAKMC (ORCPT ); Fri, 1 Oct 2021 06:12:02 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1633083018; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=ZetgfVAwbJoN4AAZzEvqpEj2r1iuIB1GedGi9+QD1zc=; b=J+pZ7xDrLdY0NDgYzAI0lsR4rHSWoe7BW09qMe9TvGFV/p97/4x9LJAsMRQZ8Eka+lZX8K+8 DxUdp7XskpDsxawPyeDuQ62hOPwkgeEuBPKxrAVkfH4UC/5twVn518dR0Zb5TXXkFYUSFCHu EvBuUSOpfx7CgtrOsC37SzT6QUg= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 6156de72605ecf100b5be9e5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 01 Oct 2021 10:09:54 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 9D619C4360D; Fri, 1 Oct 2021 10:09:54 +0000 (UTC) Received: from tykki (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0E305C43460; Fri, 1 Oct 2021 10:09:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 0E305C43460 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Kalle Valo To: Jerome Pouiller Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S . Miller" , devicetree@vger.kernel.org, Rob Herring , linux-mmc@vger.kernel.org, Pali =?utf-8?Q?Roh?= =?utf-8?Q?=C3=A1r?= , Ulf Hansson Subject: Re: [PATCH v7 15/24] wfx: add hif_rx.c/hif_rx.h References: <20210920161136.2398632-1-Jerome.Pouiller@silabs.com> <20210920161136.2398632-16-Jerome.Pouiller@silabs.com> Date: Fri, 01 Oct 2021 13:09:48 +0300 In-Reply-To: <20210920161136.2398632-16-Jerome.Pouiller@silabs.com> (Jerome Pouiller's message of "Mon, 20 Sep 2021 18:11:27 +0200") Message-ID: <87a6jtkqdv.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Jerome Pouiller writes: > From: J=C3=A9r=C3=B4me Pouiller > > Signed-off-by: J=C3=A9r=C3=B4me Pouiller [...] > +static int hif_startup_indication(struct wfx_dev *wdev, > + const struct hif_msg *hif, const void *buf) > +{ > + const struct hif_ind_startup *body =3D buf; > + > + if (body->status || body->firmware_type > 4) { > + dev_err(wdev->dev, "received invalid startup indication"); > + return -EINVAL; > + } > + memcpy(&wdev->hw_caps, body, sizeof(struct hif_ind_startup)); > + le16_to_cpus((__le16 *)&wdev->hw_caps.hardware_id); > + le16_to_cpus((__le16 *)&wdev->hw_caps.num_inp_ch_bufs); > + le16_to_cpus((__le16 *)&wdev->hw_caps.size_inp_ch_buf); > + le32_to_cpus((__le32 *)&wdev->hw_caps.supported_rate_mask); I don't really like the casts here, and not really reliable either if there's ever more fields. I would just store values as little endian in hw_caps, I doubt it's performance critical. And why does struct hif_ind_startup use both u32 and __le32? If it's in little endian it should always use __le types. [...] > + if (hif_id & 0x80) > + dev_err(wdev->dev, "unsupported HIF indication: ID %02x\n", > + hif_id); > + else > + dev_err(wdev->dev, "unexpected HIF confirmation: ID %02x\n", > + hif_id); No magic values, please. A proper define for bit 0x80 would be nice. --=20 https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes