From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <andy@warmcat.com>
Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82])
 by dpdk.org (Postfix) with ESMTP id EA5991CB5C
 for <dev@dpdk.org>; Sat, 12 May 2018 02:25:36 +0200 (CEST)
To: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org
References: <152600339444.53624.14086407337377549776.stgit@localhost.localdomain>
 <152600347742.53624.12860056818159426243.stgit@localhost.localdomain>
 <47379f2d-a00d-2fd0-f550-c81b960e50ce@intel.com>
From: Andy Green <andy@warmcat.com>
Message-ID: <725e7f6b-b0f7-d410-319e-866174d47fdf@warmcat.com>
Date: Sat, 12 May 2018 08:25:17 +0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.7.0
In-Reply-To: <47379f2d-a00d-2fd0-f550-c81b960e50ce@intel.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH 1/4] net/bnx2x: do not cast function pointers
 as a policy
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sat, 12 May 2018 00:25:37 -0000



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