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 1CA47C433EF for ; Sun, 17 Apr 2022 10:34:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233952AbiDQKgd (ORCPT ); Sun, 17 Apr 2022 06:36:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbiDQKgb (ORCPT ); Sun, 17 Apr 2022 06:36:31 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C642E36169 for ; Sun, 17 Apr 2022 03:33:56 -0700 (PDT) Received: from martin by viti.kaiser.cx with local (Exim 4.89) (envelope-from ) id 1ng2E4-0002Nz-GJ; Sun, 17 Apr 2022 12:33:52 +0200 Date: Sun, 17 Apr 2022 12:33:52 +0200 From: Martin Kaiser To: Pavel Skripkin Cc: Greg Kroah-Hartman , Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] staging: r8188eu: merge _mgt_dispatcher into mgt_dispatcher Message-ID: <20220417103352.jqkqpi2auxir2g6g@viti.kaiser.cx> References: <20220413200742.276806-1-martin@kaiser.cx> <20220413200742.276806-3-martin@kaiser.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: Martin Kaiser Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, Thus wrote Pavel Skripkin (paskripkin@gmail.com): > On 4/13/22 23:07, Martin Kaiser wrote: > > All that the _mgt_dispatcher function does is to call a function from > > a function pointer. It's not worth having a separate function for this. > > Merge _mgt_dispatcher into mgt_dispatcher. > > Signed-off-by: Martin Kaiser > > --- > [code snip] > > + > > + if (ptable->func) { > > + /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ > > + if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && > > + !is_broadcast_ether_addr(GetAddr1Ptr(pframe))) > > + return; > > + ptable->func(padapter, precv_frame); > > + } > > } > Looks like each `mlme_sta_tbl` element has `func` member initialized. I > think, we can remove this check. I've just sent a series to refactor mgt_dispatcher. All mlme_sta_tbl entries have a function pointer, but some of the point to a dummy function DoReserved. I guess we should use NULL and keep the check instead of calling a function that does nothing. Best regards, Martin