From patchwork Thu Oct 8 12:19:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pujin Shi X-Patchwork-Id: 11822815 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 6D850C04EBE for ; Thu, 8 Oct 2020 12:19:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 195BE21527 for ; Thu, 8 Oct 2020 12:19:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ah5DZbSn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729761AbgJHMT4 (ORCPT ); Thu, 8 Oct 2020 08:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729739AbgJHMT4 (ORCPT ); Thu, 8 Oct 2020 08:19:56 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82631C061755; Thu, 8 Oct 2020 05:19:54 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id e10so3864789pfj.1; Thu, 08 Oct 2020 05:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QK7x4WnMDD1w1AJigxZca0jvkUm/6wXO+3vn95iqnN0=; b=ah5DZbSny0r8zD0poMrz7u2KbugGuHbiELrKWzDy7luR9o49V1lzS7Ippkm2TDz7GD JvRELWTqlBeqQ02BgSm5dNckoFTqY5QrcbDMkPBr0E/wNgbO63Piu/9A8Xh3X3y3Y2Nz pfqiPSjXxMDUnv+9AUcHbuGLRHR5sBA+RG6Cg66KNbJiVJQPAslnxhPI3mMDJSK54056 CUV/qNslf+7yEl1+Wjtxgv6lEcyeTJ9oi4nnw0kNEuBaxoXMMK+KP+6G5Yp3bYEcjK0F d69386wwX9db+jCIr6pSByetkcpL0YWa45+phiPvoeJ10I0e+ItSydAsBX0WPHO7iRXQ FTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QK7x4WnMDD1w1AJigxZca0jvkUm/6wXO+3vn95iqnN0=; b=PGzMCyVSO9ErrXbC+9/+QekqDVHMc+R0J4+P8VDnZA0vVZCSbQCV1d3bDy1DeeKryu Bb/RpQMpU75cqtFu95M78sVNhi9c3zo7SiKenhwuJAb7gA+WmqyhiuBanarWgPS9pVnM /R/bri5V2ibXqZphYthGE2OpLpbpBX8cbwLq6NhFFBF16N1Kol/wKhwQ/L/BHs3lxYDh sDqH2PybjaoXjK2KylclodD+A9pUjh3tABWAhLpMxiFK1vhMZc+QsTJ0nixu4wGE4Rba F5PRK9V3HoAEZM6V7ksGJ4jDKC6oGE9amT1MjnVIJO3eL1SVayuaWcieFnT/pBypFQ6k 7cHA== X-Gm-Message-State: AOAM530ZcsG850wltHSUu6mLHG4YkrCZLkPsxCSwTng9Y54CiLCynNQW Q5vxqdgo4cLHdAs+UcMbFPqxKWbHH6Ag X-Google-Smtp-Source: ABdhPJy+OvvEdPcMzlBntde+cxsU2+kLyABp3rjbzeAEnj8gMImZKC8vY6ovtHlmqMTewoBcOEnXuA== X-Received: by 2002:a17:90a:bc2:: with SMTP id x2mr3876963pjd.54.1602159594117; Thu, 08 Oct 2020 05:19:54 -0700 (PDT) Received: from localhost.localdomain ([47.242.140.181]) by smtp.gmail.com with ESMTPSA id c7sm7233914pfj.84.2020.10.08.05.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 05:19:53 -0700 (PDT) From: Pujin Shi To: "David S . Miller" , Jakub Kicinski Cc: Ursula Braun , Karsten Graul , linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hankinsea@gmail.com, Pujin Shi Subject: [PATCH 2/2] net: smc: fix missing brace warning for old compilers Date: Thu, 8 Oct 2020 20:19:29 +0800 Message-Id: <20201008121929.1270-2-shipujin.t@gmail.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20201008121929.1270-1-shipujin.t@gmail.com> References: <20201008121929.1270-1-shipujin.t@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For older versions of gcc, the array = {0}; will cause warnings: net/smc/smc_llc.c: In function 'smc_llc_add_link_local': net/smc/smc_llc.c:1212:9: warning: missing braces around initializer [-Wmissing-braces] struct smc_llc_msg_add_link add_llc = {0}; ^ net/smc/smc_llc.c:1212:9: warning: (near initialization for 'add_llc.hd') [-Wmissing-braces] net/smc/smc_llc.c: In function 'smc_llc_srv_delete_link_local': net/smc/smc_llc.c:1245:9: warning: missing braces around initializer [-Wmissing-braces] struct smc_llc_msg_del_link del_llc = {0}; ^ net/smc/smc_llc.c:1245:9: warning: (near initialization for 'del_llc.hd') [-Wmissing-braces] 2 warnings generated Fixes: 4dadd151b265 ("net/smc: enqueue local LLC messages") Signed-off-by: Pujin Shi Acked-by: Karsten Graul --- net/smc/smc_llc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c index d09d9d2d0bfd..85df0ef60500 100644 --- a/net/smc/smc_llc.c +++ b/net/smc/smc_llc.c @@ -1209,7 +1209,7 @@ static void smc_llc_process_srv_add_link(struct smc_link_group *lgr) /* enqueue a local add_link req to trigger a new add_link flow */ void smc_llc_add_link_local(struct smc_link *link) { - struct smc_llc_msg_add_link add_llc = {0}; + struct smc_llc_msg_add_link add_llc = {}; add_llc.hd.length = sizeof(add_llc); add_llc.hd.common.type = SMC_LLC_ADD_LINK; @@ -1242,7 +1242,7 @@ static void smc_llc_add_link_work(struct work_struct *work) */ void smc_llc_srv_delete_link_local(struct smc_link *link, u8 del_link_id) { - struct smc_llc_msg_del_link del_llc = {0}; + struct smc_llc_msg_del_link del_llc = {}; del_llc.hd.length = sizeof(del_llc); del_llc.hd.common.type = SMC_LLC_DELETE_LINK;