From patchwork Sat Aug 14 09:57:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 497610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9D8BC4338F for ; Sat, 14 Aug 2021 09:58:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD18D60FC0 for ; Sat, 14 Aug 2021 09:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237962AbhHNJ6Z (ORCPT ); Sat, 14 Aug 2021 05:58:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:37794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238028AbhHNJ6U (ORCPT ); Sat, 14 Aug 2021 05:58:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4806D60E93; Sat, 14 Aug 2021 09:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628935072; bh=G10PfifuW7zSncaUKdKeC95zgBDC68Nv+v9qApbeRGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ttBpJ8ucPiNLEAKZUjRroaI0VapCGRxsmkRRVOVQzgs5Kd2UVK1LeSwX7ZPuy6WP+ p79MhJB0ewWtKH/lNBh09mnn+YWkrzUguhKXMaopjByW+t3ao7HK9yhVt8+b9D+63W esc0+4+wzWsCMS89p8Wth96VF0VViMWmVTR7HIECHTj6U9VyGFjGvO01lLpiiLk+m8 9B5O6OWZsFGWhak7wdp7U4vm26fpk4ZInT0EWxt1giRxTITQiMakd+krix7MOX3/py lBrYl4g4Ciuov//g7SLzSe6ek4779KvMlWn6VfDKET9shZEKAfZzsydek9gb5CHomt u2vw+9+FASqkg== From: Leon Romanovsky To: "David S . Miller" , Jakub Kicinski Cc: Leon Romanovsky , Guangbin Huang , Jacob Keller , Jiri Pirko , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Salil Mehta , Shannon Nelson , Yisen Zhuang , Yufeng Mo Subject: [PATCH net-next 5/6] devlink: Clear whole devlink_flash_notify struct Date: Sat, 14 Aug 2021 12:57:30 +0300 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Leon Romanovsky The { 0 } doesn't clear all fields in the struct, but tells to the compiler to set all fields to zero and doesn't touch any sub-fields if they exists. The {} is an empty initialiser that instructs to fully initialize whole struct including sub-fields, which is error-prone for future devlink_flash_notify extensions. Fixes: 6700acc5f1fe ("devlink: collect flash notify params into a struct") Signed-off-by: Leon Romanovsky Reviewed-by: Jacob Keller --- net/core/devlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/devlink.c b/net/core/devlink.c index d218f57ad8cf..a856ae401ea5 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4169,7 +4169,7 @@ static void __devlink_flash_update_notify(struct devlink *devlink, static void devlink_flash_update_begin_notify(struct devlink *devlink) { - struct devlink_flash_notify params = { 0 }; + struct devlink_flash_notify params = {}; __devlink_flash_update_notify(devlink, DEVLINK_CMD_FLASH_UPDATE, @@ -4178,7 +4178,7 @@ static void devlink_flash_update_begin_notify(struct devlink *devlink) static void devlink_flash_update_end_notify(struct devlink *devlink) { - struct devlink_flash_notify params = { 0 }; + struct devlink_flash_notify params = {}; __devlink_flash_update_notify(devlink, DEVLINK_CMD_FLASH_UPDATE_END,