From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 1/4] net/bnx2x: do not cast function pointers as a policy Date: Fri, 11 May 2018 17:03:53 +0100 Message-ID: <47379f2d-a00d-2fd0-f550-c81b960e50ce@intel.com> References: <152600339444.53624.14086407337377549776.stgit@localhost.localdomain> <152600347742.53624.12860056818159426243.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Andy Green , dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C4CE71C7BE for ; Fri, 11 May 2018 18:03:56 +0200 (CEST) In-Reply-To: <152600347742.53624.12860056818159426243.stgit@localhost.localdomain> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/11/2018 2:51 AM, Andy Green wrote: > This is stopping the compiler telling you when you have > done something stupid... that is something none of us > can afford... > > Now gcc 8.x can tell you did something stupid despite > trying to hide the evidence. > > Remove all the "black magic" casts. > > Fix the actual problems. Missing sign-off <...> > @@ -5226,9 +5228,9 @@ static elink_status_t elink_get_link_speed_duplex(struct elink_phy *phy, > return ELINK_STATUS_OK; > } > > -static elink_status_t elink_link_settings_status(struct elink_phy *phy, > - struct elink_params *params, > - struct elink_vars *vars) > +static uint8_t elink_link_settings_status(struct elink_phy *phy, > + struct elink_params *params, > + struct elink_vars *vars) > { It is possible to remove "read_status_t" casting from phy_serdes and phy_xgxs after this change. <...> > @@ -5520,9 +5522,9 @@ static void elink_set_preemphasis(struct elink_phy *phy, > } > } > > -static void elink_xgxs_config_init(struct elink_phy *phy, > - struct elink_params *params, > - struct elink_vars *vars) > +static uint8_t elink_xgxs_config_init(struct elink_phy *phy, > + struct elink_params *params, > + struct elink_vars *vars) Same here, this change can eliminate some "config_init_t" casts.