Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1540959pxb; Thu, 16 Sep 2021 09:32:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI1Lw7Ba9EibIrmAHrNO6JQpR15WhXLe/Zyl1nNKA3WqQN043BkIMs7WD4I3P2y3awqQZH X-Received: by 2002:a6b:bad5:: with SMTP id k204mr5277294iof.65.1631809948110; Thu, 16 Sep 2021 09:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809948; cv=none; d=google.com; s=arc-20160816; b=nupkJrdKr1oO73ejpkChJRRaffwiqR1zILVveCqgRl5CgNm/GLm4XxL5pzAqOxXNWy D/1L0k5s6zYyifCm3noECtjqStUgEmHdgfwSiu7/vq+vw2OQ6b8eHuRfVOkktsO5PvjA PBEXyla3t6pv2+01ihkuXG0e/KY6SylBHJwx7lkc1JBx3ktYH3RwqTLUoOr62i96G9+k +lWnhMrErNlrT6FVR2ANmLNqMvGirP0zfuLteNJVm+BYAJggDi7XTm6OsPqQZh6/G+cw /g9iQ5lymAsKJ88b15xxFyrHSnmb+77U1w+mZDu8jnu6Wtj8w5J3SFOK2HvGLE4Z2hru UJyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9smOakcEvHGdqL99aBTK2p0Gjez7MxK2MTTvArRJeKI=; b=DLvmceUlEyhb52hqFDNiYJgWddkp6dlMSS6aE3VY0yc7/WeLxM0sp9PuIx4/GNTVSN AKgsHudIe4wlFvAauug5Ucnrq9Y5NvJ7VnxqWQElqsZWYqoMiq6qhVVYvD4Kg78Wh7QB Mqp1bU4dz2aJwfiVLvfX5ZOpu406iHZeJoJgoCy/pGjnnqDUr0XvykfWf5DE5kggxafx KunRNogbBtqAKPR97aJiQAfaT2Gvv0Xabi9R/RpNHl23x1jYrZtcvJWoikBoBtbYbT9p 55Hkqx4yKvzIfQPl45cGTRRJdu/P8jPfLznHKoNpceh2IT0aPkvr8lEv8i7YHnpyqoq+ nEPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IlBvCsTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si1849281ilv.67.2021.09.16.09.32.10; Thu, 16 Sep 2021 09:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IlBvCsTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243509AbhIPQbc (ORCPT + 99 others); Thu, 16 Sep 2021 12:31:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:59260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235730AbhIPQXW (ORCPT ); Thu, 16 Sep 2021 12:23:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B802E61462; Thu, 16 Sep 2021 16:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808940; bh=OObXcfMPhShBnk286/vBx+X4jknTOz5u8U8voGgtQbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IlBvCsTDAigex2VHMVPoLDkGrJHn2gVea7jsQQe64NK5Af+f/d/JcoUJz+Z+URalh BSThs/HaS22WJ9i9hWCDqXab7AZfveZLWoigMtr5+wjUk26xeQOjUT9+fD5x8fRQYj PVuEV9ONQ/YGwlx6Wh5C0XH53VoaxHgWkGftS5j4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guojia Liao , Guangbin Huang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 277/306] net: hns3: clean up a type mismatch warning Date: Thu, 16 Sep 2021 18:00:22 +0200 Message-Id: <20210916155803.516967343@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guojia Liao [ Upstream commit e79c0e324b011b0288cd411a5b53870a7730f163 ] abs() returns signed long, which could not convert the type as unsigned, and it may cause a mismatch type warning from static tools. To fix it, this patch uses an variable to save the abs()'s result and does a explicit conversion. Signed-off-by: Guojia Liao Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index 61f6f0287cbe..ff9d84a7147f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -10,7 +10,14 @@ static u16 hclge_errno_to_resp(int errno) { - return abs(errno); + int resp = abs(errno); + + /* The status for pf to vf msg cmd is u16, constrainted by HW. + * We need to keep the same type with it. + * The intput errno is the stander error code, it's safely to + * use a u16 to store the abs(errno). + */ + return (u16)resp; } /* hclge_gen_resp_to_vf: used to generate a synchronous response to VF when PF -- 2.30.2