From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Green Subject: Re: [PATCH 1/4] net/bnx2x: do not cast function pointers as a policy Date: Sat, 12 May 2018 08:25:17 +0800 Message-ID: <725e7f6b-b0f7-d410-319e-866174d47fdf@warmcat.com> References: <152600339444.53624.14086407337377549776.stgit@localhost.localdomain> <152600347742.53624.12860056818159426243.stgit@localhost.localdomain> <47379f2d-a00d-2fd0-f550-c81b960e50ce@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: Ferruh Yigit , dev@dpdk.org Return-path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id EA5991CB5C for ; Sat, 12 May 2018 02:25:36 +0200 (CEST) In-Reply-To: <47379f2d-a00d-2fd0-f550-c81b960e50ce@intel.com> 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 05/12/2018 12:03 AM, Ferruh Yigit wrote: > 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. > The first errors from the compile came after phy_serdes and phy_xgxs definition, so I did not notice they also have "black magic casts" (casting NULL amongst others...) ... I removed all the casts on those as well and build is still happy. -Andy