Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp20668pxb; Tue, 12 Apr 2022 15:37:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrMQetYQKOWASadQB1qlHS1c28g3PVmjTq6OtiubCCBWTFsXueUMeIML9EpgJwVTCj+KP1 X-Received: by 2002:a05:6a00:230d:b0:4f6:ec4f:35ff with SMTP id h13-20020a056a00230d00b004f6ec4f35ffmr40052625pfh.53.1649803079588; Tue, 12 Apr 2022 15:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803079; cv=none; d=google.com; s=arc-20160816; b=q7+WkyDuaY0s16Dc0c4nw9ZoTEF5u0xiRt7Tro5x8Uy9N6m/E+aHbSAdz6mwkc7BF6 6p3eeEFu/BmRjNk0Xgm5JekXbjm8MJZrjVGoot4hAO1ZNy7lja2GThJVD7vh2VEcbVEI f/1LDymFR6WjV5aYvoMKvVAYn5hN7HLDl8q6JOL8+rl5FEIdTZKU3WCETRHSrTLEFrOJ NOLD1jjPt5GwQhDn86ICXcoEbhhsmM5LzozTraGdbYwbf9NaxNqe5TlIMXQRcWvks6wJ JuUZSLPPGSAcafBwI/iXyhIgKp2hQ4hupDJOAKgFoZxfr7UUKqlSuKK3KnNl5kEfLKTU fGRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cqlwkzNfnlV9gL5ZnRGTNGada28Y4A8d0Tvno1UH9pQ=; b=zwtWxH1i6m1tufSwZCK/A9r/QcF2jy9N8unfpx5UD2M7BjMlzwYTUTlFAWfgcI19jn 8xKgSALnBnmR0UrSkdHRAMqU3ki+E0r1zcZyk4D9BVASeLUKQQ3nMpegytsBleSaeHxl kb+mh4nEVLvt6QmJ4BUQXD1LC1ufTYt1QZa5YS483+FS93XLcOz/XdJAsE50dyLK8XBz jiaOfeCOoUCdEPCMcqrZ+Kt7bKkSZNgBtrc5r766A9Y0GujvVc2GcGuOs92GgTBPOB+S 3HZc713BS6E48vuxSCNT43yKhjMTBmVPdx0ZtfhZDooDIEpxDYWcdbwQjy+i1cQx4nBx EUnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bxXrb3FN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id pf3-20020a17090b1d8300b001caa70213c0si18436526pjb.132.2022.04.12.15.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:37:59 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bxXrb3FN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 721C01A2A0A; Tue, 12 Apr 2022 14:15:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242249AbiDLFCF (ORCPT + 99 others); Tue, 12 Apr 2022 01:02:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbiDLFCD (ORCPT ); Tue, 12 Apr 2022 01:02:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552B33335E for ; Mon, 11 Apr 2022 21:59:47 -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 1238AB818C8 for ; Tue, 12 Apr 2022 04:59:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66164C385A6; Tue, 12 Apr 2022 04:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649739584; bh=7GTblpVpSQYcAVhFqTpBAzjm8SimTPaUHKg0ETvVUI0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bxXrb3FNHbJBnyOCUDOz2Y+T89PrBH/HRtU3ykwISXCaDAPkHd7OOsNnkZT9CkX4/ x1ZnFXoudcryTVI0Ny+Tc6dlwwI/QiuphrVkXnuViw23GzN7J+Z07UICJSDp9jI4Uq VMG/Qs5IJMOXZIkBOokMJjAQnZq4pQfzqQcoRwnU= Date: Tue, 12 Apr 2022 06:59:42 +0200 From: Greg Kroah-Hartman To: Jaehee Park Cc: =?iso-8859-1?B?Suly9G1l?= Pouiller , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev, Stefano Brivio Subject: Re: [PATCH V3] wfx: use container_of() to get vif Message-ID: References: <20220412041218.GA2859599@jaehee-ThinkPad-X1-Extreme> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220412041218.GA2859599@jaehee-ThinkPad-X1-Extreme> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org On Tue, Apr 12, 2022 at 12:12:18AM -0400, Jaehee Park wrote: > Currently, upon virtual interface creation, wfx_add_interface() stores > a reference to the corresponding struct ieee80211_vif in private data, > for later usage. This is not needed when using the container_of > construct. This construct already has all the info it needs to retrieve > the reference to the corresponding struct from the offset that is > already available, inherent in container_of(), between its type and > member inputs (struct ieee80211_vif and drv_priv, respectively). > Remove vif (which was previously storing the reference to the struct > ieee80211_vif) from the struct wfx_vif, define a macro > wvif_to_vif(wvif) for container_of(), and replace all wvif->vif with > the newly defined container_of construct. > > Signed-off-by: Jaehee Park > --- > > Changes in v3: > - Made edits to the commit message. > - Shortened the macro name from wvif_to_vif to to_vif. > - For functions that had more than one instance of vif, defined one > reference vif at the beginning of the function and used that instead. > - Broke the if-statements that ran long into two lines. > (There are 3 lines that exceed 80 by less than 4 characters. Two of > those lines of code could be shorted but it involved defining two more > variables, and could potentially make the code less readable.) > > Note: I will mail this patch to the wireless-next tree after testing. > > > drivers/staging/wfx/wfx.h | 2 +- This file is not in linux-next anymore.