Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2422571rda; Wed, 25 Oct 2023 02:09:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKB3e2f7crZb8Xcj3sCS8jJDdURq1CUfU/Ot00mLfSH8DG0lVYe9z9OnsrwbEwTcMIzqh1 X-Received: by 2002:a0d:d5c4:0:b0:59e:7f14:4b48 with SMTP id x187-20020a0dd5c4000000b0059e7f144b48mr14257085ywd.41.1698224967848; Wed, 25 Oct 2023 02:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698224967; cv=none; d=google.com; s=arc-20160816; b=OLLgScJXwuBjKuAjkprxDgDQmBK0WVPb5pBHKDkEc8ymBdFVo8lYuhyFCCs6GmwlCW JKlNTQOZFQeElY0Wg77nOUY/iQ0/j5NyeFkhfx5yHLfCujFJZXgQvDCW8YOx/RjH4Pn/ ZjRRtNMILITi4b6HfS8gW66zbBgwAxYFfaFF3/VD5LNi464Q0oS0ZjehaaC7UnxYvjWl +zYRhFKBDcoTyFLZYh6dLtFxnoaBFZDJ/JMkTyERqaEVbp9ocL5KrsrYzTpeVk/c4l65 aGc1XPcj9EgjkoQGNoq0xEZEL5MwgWt01kpKdm9A+egu0gVwwijtzjUfLAY//t39crkb aReA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=b8l8NiTZKUOMqhlcWNpiHC8GkinV/KDvy367HwoynOo=; fh=JT3UhT4HCWLMIU+pP0F+7WqHuW7NoYjZwdQ1EhPpVs0=; b=R/jXkXlqkau54jo3pt94RlAxwsGXFQUZDLryd4ZI0dui6CoZGJodk0vObpvRiGYY7X pIzUG9LLJaqR0rlfzqSXhehR+2b+fb7lXJXqwkjKz4RHgpEPLinZC6ND+XrhwHUTybrX Mezd79qwAtVnFDjChozUYNcRgz5yaMjB7VnedrMw8W94/g824uRS1DCar4Z8hJtKNeOZ xIIeCEY77ahbd3mN82HJGy9n3cqviF92buq1lDjEI7EKdINY5k50PTtv4AsER2soNlZp 0gTmr1vHvA9APorZ66TUW32uJpDnPzjMSw7iXHd4Xn2pE2miuBRIDBGi/MJBQS1i2i76 wrJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P5Hm5noU; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m67-20020a0de346000000b0059286299822si10120473ywe.240.2023.10.25.02.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:09:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P5Hm5noU; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1DCB1801BACF; Wed, 25 Oct 2023 02:09:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233537AbjJYJJX (ORCPT + 52 others); Wed, 25 Oct 2023 05:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233538AbjJYJJW (ORCPT ); Wed, 25 Oct 2023 05:09:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E99136 for ; Wed, 25 Oct 2023 02:09:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE8A9C433C8; Wed, 25 Oct 2023 09:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698224958; bh=ItsyWWnSe2Fsg7MQVBc0Wc5NeoaWrB1B1RIE7BbXM9U=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=P5Hm5noUQ3/FU0gD9NuyWUcrj1IFnS4d0FKD1VWjsyoX5qnFw9qquA4LhmLXJr9D5 mcaRIedklfXM8K9Ubaq1dLkWoLoY5IsIsUuI6/giNXxnxhneYr4/KhlkZ/AeYmKoxb KMAkbcgniaLeHMZ6F8NyNN9FxkcYSENcXX08FtT08ENkGZze+hVX9jveVNzzD01Uu8 SimCF8E/Y1IdZtmvVZezm8psurcA+kyUuXVt5zN1xtAYdMKbPbuZntp5CqO8sv5XX1 ZOOrGNs2eWQTe5UETIXW7/DqvDL9g9+1dsnqWydZyZaLyDmKNp+70FHVr1kAKa4WCP DSWaKq8NPxr/w== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing From: Kalle Valo In-Reply-To: <20231020040940.33154-1-dmantipov@yandex.ru> References: <20231020040940.33154-1-dmantipov@yandex.ru> To: Dmitry Antipov Cc: Ping-Ke Shih , Tom Rix , linux-wireless@vger.kernel.org, Dmitry Antipov User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169822495599.836535.4324036715351093593.kvalo@kernel.org> Date: Wed, 25 Oct 2023 09:09:17 +0000 (UTC) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 02:09:24 -0700 (PDT) Dmitry Antipov wrote: > When compiling with clang-18, I've noticed the following: > > drivers/net/wireless/realtek/rtw89/fw.c:389:28: warning: cast to smaller > integer type 'enum rtw89_fw_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] > 389 | enum rtw89_fw_type type = (enum rtw89_fw_type)data; > | ^~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/realtek/rtw89/fw.c:569:13: warning: cast to smaller > integer type 'enum rtw89_rf_path' from 'const void *' [-Wvoid-pointer-to-enum-cast] > 569 | rf_path = (enum rtw89_rf_path)data; > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > So avoid brutal everything-to-const-void-and-back casts, introduce > 'union rtw89_fw_element_arg' to pass parameters to element handler > callbacks, and adjust all of the related bits accordingly. Compile > tested only. > > Signed-off-by: Dmitry Antipov Patch applied to wireless-next.git, thanks. 7d7b6f2953b3 wifi: rtw89: cleanup firmware elements parsing -- https://patchwork.kernel.org/project/linux-wireless/patch/20231020040940.33154-1-dmantipov@yandex.ru/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches