lkml.org 
[lkml]   [2021]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] [v2] hinic: avoid gcc -Wrestrict warning
From
Date
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 24 Mar 2021 14:07:22 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> With extra warnings enabled, gcc complains that snprintf should not
> take the same buffer as source and destination:
>
> drivers/net/ethernet/huawei/hinic/hinic_ethtool.c: In function 'hinic_set_settings_to_hw':
> drivers/net/ethernet/huawei/hinic/hinic_ethtool.c:480:9: error: 'snprintf' argument 4 overlaps destination object 'set_link_str' [-Werror=restrict]
> 480 | err = snprintf(set_link_str, SET_LINK_STR_MAX_LEN,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 481 | "%sspeed %d ", set_link_str, speed);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/huawei/hinic/hinic_ethtool.c:464:7: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
> 464 | char set_link_str[SET_LINK_STR_MAX_LEN] = {0};
>
> [...]

Here is the summary with links:
- [v2] hinic: avoid gcc -Wrestrict warning
https://git.kernel.org/netdev/net-next/c/84c7f6c33f42

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


\
 
 \ /
  Last update: 2021-03-25 02:11    [W:0.044 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site