Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2322382iof; Wed, 8 Jun 2022 02:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1QQdf72Y+QEmMSnEmmBfAXY1HvSTpT3AKOF8A1zjiD/cY6zPsJV4Te2vC6U/shXrwtmy4 X-Received: by 2002:a63:91ca:0:b0:3fc:9077:c7c7 with SMTP id l193-20020a6391ca000000b003fc9077c7c7mr29592901pge.201.1654680359735; Wed, 08 Jun 2022 02:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654680359; cv=none; d=google.com; s=arc-20160816; b=z0FfqVVl1Jpv9eA8EIYzZoIkuVCJPU9gJYIHOPkEHT/ib7aXrj0kx1OF7ngJcJJalT eTJ72sXFwkE1CLfoSg5exfYzVPojIPi8XvzC6M8Q/r8Y4B9rPVll/iWZ8teEcelovnbP VZZeYgmps6HF/68VkOFKxxHteKe8/08DOivPCKR6feQCGktXjvx7n74TTeTYe9JtJFmA AWEnfiX5kJtC4OdcePKnA61xyaxcPI6vhpxam1deZbSJMbF58OW3YFnHdINidlY95zNr xcc5lkoPaNj4vmns901lVR8eBZrRid4nxM69t3CwLOUAn/y07Lbd1l6MOWwadAi11uyw 6ALQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=sV45KjdZ3Us2pfBuHryrP0fcaUR6YDaK1F7RNd3O1Fc=; b=iY/q0h+spuveEKG2Qu5eWIFNy8IFD75RyUnzkUKhySOVbHqwSD5IaJMS2i9dhybRlc WEDmIp27vYhwhr2gX9tF/Ti0TnIYaE5e8EYJDrG15z1/WMGgR1j928UXaCbvd4rqeh5x srMJHglXt2CJC2p64AKsqeGir0ivNkEGQwszgg0zL+9nL5YW5s6SbZf/9e2+gff/kfDz kqXLN6SPBROUeo00zYXJ7wtsoXJiyvKZHrhkxXvXoqm9t2b6w4xMZBGEXi89FiVoHJtS i1l7Nqmo/5SduWCXWl4SKbzYx/LWhAMZQFW2/OsTuOJZibmANEL35B9kwpcBpEEUjvwK +N0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M0Ri5KV1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z6-20020a17090abd8600b001e84ad1f823si19897024pjr.107.2022.06.08.02.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M0Ri5KV1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D197915D303; Wed, 8 Jun 2022 01:57:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbiFHI4p (ORCPT + 67 others); Wed, 8 Jun 2022 04:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233196AbiFHI4C (ORCPT ); Wed, 8 Jun 2022 04:56:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D5A63CE241 for ; Wed, 8 Jun 2022 01:16:57 -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 EA6D8B825A0 for ; Wed, 8 Jun 2022 08:16:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87CAFC341C0; Wed, 8 Jun 2022 08:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654676214; bh=Evnfp3bZxO7b1ZMmJ/xwt8jr7WQx6ELnm8EwvF7sqlM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=M0Ri5KV1hhn1jkOigYeDsgmX7wQM+WB4Us1/HYD0XFwEe1YTswQ2WSFMwUjPT88tB I9FBVzQjo7wTSEaq0S2OUHhjyE8HDf8ZtsFzN/w0291x4dRvU4NFm2St/Qy31zPGM+ QmM1FbDPZmtb6RgUpZ5RXfJ85NamKz0BQE/PEUl0QX116/N3EQalKK6I5PrlcDfNJq VKjHpMpM9K27pN55ctKr0HUdrqFBVWmZrU6YwBWPZFmx/gn86OARAN7y30x6nNwSnf cmdEacPwXBCNWMCvpOYOquMZwuc9J2zXwVxHeKxojESXnNQBf0GjCF8mVDzOvYWpig fYdTV0LStlckg== From: Kalle Valo To: Ping-Ke Shih Cc: Larry Finger , Nathan Chancellor , Johannes Berg , "linux-wireless\@vger.kernel.org" Subject: Re: [PATCH v3 4/4] rtw88: Fix Sparse warning for rtw8821c_hw_spec References: <20220524153716.20450-1-Larry.Finger@lwfinger.net> <45a6b6ea84c74ffeafff1b68c2e1c5e3@realtek.com> <764fc8f115dc411e82938311273d9b51@realtek.com> <87bkv3r43b.fsf@kernel.org> <5c48cda63e844e3f9703506309854a63@realtek.com> Date: Wed, 08 Jun 2022 11:16:49 +0300 In-Reply-To: <5c48cda63e844e3f9703506309854a63@realtek.com> (Ping-Ke Shih's message of "Wed, 8 Jun 2022 08:05:46 +0000") Message-ID: <8735gfr2mm.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-wireless@vger.kernel.org Ping-Ke Shih writes: >> -----Original Message----- >> From: Kalle Valo >> Sent: Wednesday, June 8, 2022 3:45 PM >> To: Ping-Ke Shih >> Cc: Larry Finger ; Nathan Chancellor >> ; Johannes Berg >> ; linux-wireless@vger.kernel.org >> Subject: Re: [PATCH v3 4/4] rtw88: Fix Sparse warning for rtw8821c_hw_spec >> >> Ping-Ke Shih writes: >> >> > >> > The ch_param[3] is only used by 8821c, so it doesn't affect other devices. >> > I will prepare a patch to fix it. >> >> But why didn't the compiler catch this? Is there some evil cast >> somewhere which removes the const? We should fix that as well (in a >> separate patch). >> > > This is because we assign a const to .driver_data that is non-const kernel_ulong_t: > > static const struct pci_device_id rtw_8821ce_id_table[] = { > { > .driver_data = (kernel_ulong_t)&rtw8821c_hw_spec > }, > > When casting it back in pci_probe(), we need to add 'const' after Larry's patches: > > rtwdev->chip = (struct rtw_chip_info *)id->driver_data; Yeah, that definitely needs to be const. > I will prepare another patch to fix that. Great, thanks! -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches