From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754872AbdJSOPR (ORCPT ); Thu, 19 Oct 2017 10:15:17 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:51740 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754040AbdJSOPO (ORCPT ); Thu, 19 Oct 2017 10:15:14 -0400 Date: Thu, 19 Oct 2017 16:15:05 +0200 From: Andrew Lunn To: Vivien Didelot Cc: Egil Hjelmeland , f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 net-next 1/2] net: dsa: lan9303: Add port_fast_age and port_fdb_dump methods Message-ID: <20171019141505.GA14840@lunn.ch> References: <20171019121015.7395-1-privat@egil-hjelmeland.no> <20171019121015.7395-2-privat@egil-hjelmeland.no> <87mv4nw869.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mv4nw869.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +/* Clear learned (non-static) entry on given port */ > > +static void alr_loop_cb_del_port_learned(struct lan9303 *chip, u32 dat0, > > + u32 dat1, int portmap, void *ctx) > > +{ > > + int *port = ctx; > > You can get the value directly to make the line below more readable: > > int port = *(int *)ctx; You have to be a bit careful with this. You often see people submitting patches taking away casts for void * pointers. If they do that here, it should at least not compile... So maybe do it in two steps? int * pport = ctx; int port = *pport; ??? Andrew