Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp410820pxv; Thu, 8 Jul 2021 05:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDixTkJ1VytnLjgzn9wQcMGpJwi4NPRFJKBbP0X6fKqKr620uQcTJxJ91VcOLvqvuTur1n X-Received: by 2002:a17:906:d92:: with SMTP id m18mr29672586eji.309.1625747477851; Thu, 08 Jul 2021 05:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625747477; cv=none; d=google.com; s=arc-20160816; b=ZvV5S4QeR5yXUmScRuukgFZ6v1ELUetxQjoE5bp3EDiCeqK55mKPgOu618/Z3kaxDK b9jO7Ze5+WttmDMsYIC+4RHQu+xujlcnOy8cJnN6JTN0zgQmp7mp6U12XZ7xQ+AR8yKb v4AR1IvddmacR9X/co+ZPs+D+eRKT2or0Dwb0pRa2oq8G3rIdc+acVZe0+SfaCI3Dlgi KgUdQuLSXMmW/JidYaKvREuFh3Vj7wkdC5+DlFZNiNA+RkugCgdbgUzXOOfoT2Sy5vfQ f6QmVNiOJHg1bG7920WOE6DxjeBJrSsXPJk0Qo/7ISWjAw1i6C6zq2CdwhisN2FaLA2r c2Rg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sa/YWV+BNnQ/r3dcaFZq+ayIUIx4XIAudZHXVYnwhVA=; b=U0hk5f+Y9P1Who4o22oMiXmW9RIWm7v3+I+u+5OzELckSnxo9oavG5Z40AdO4GW4PI 4cbt8Efrj8qq2F6uLAXjoZb/eApIdcWep9S+5ejZ32gNGPpreoHfXPDQ6hnItVw2PW/s 05ooI7AjF7B9ATd082C6fr/pfsAuzUJySfz8PD/Ck66imjyuDX5dMhv7irWPBqQZXG9k +sKUuyx4BwGCt9silruW43NZili4lH9x/axphqSbXK6inNg1H70BolK/UA0DEkxeFQl3 jCNlp0n04rFWPPxp1mSIpsNR/l4agorehBcVV+Vk7TdvZ+uDRgdOu+75liXvcb1Q65aC L6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=t7Jwd2X0; 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=yadro.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si3150278ejt.645.2021.07.08.05.30.54; Thu, 08 Jul 2021 05:31:17 -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=@yadro.com header.s=mta-01 header.b=t7Jwd2X0; 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=yadro.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbhGHMai (ORCPT + 99 others); Thu, 8 Jul 2021 08:30:38 -0400 Received: from mta-02.yadro.com ([89.207.88.252]:45006 "EHLO mta-01.yadro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231126AbhGHMah (ORCPT ); Thu, 8 Jul 2021 08:30:37 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 3051F49E44; Thu, 8 Jul 2021 12:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1625747273; x=1627561674; bh=vK96Sc7MNGUkW8R4Eq+yIewGLHOFKMnjDyv qwGbS51s=; b=t7Jwd2X0qcTmF6cEfkt+UCjbb6s4kg16gqeDEe9e1BeWzKutVR4 frTxLgvoFAhWvUEu1Vx7XbGWlEfQvWXjAY0Qn1c7a+ED6JbBA8e+FvvWLJoN3JzE 42nZ02t515wPkjxfBpVViN0xrY/s/B26Fy1rYxOyH4nL0jO37Z10EDbM= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2flJR5XKGTo4; Thu, 8 Jul 2021 15:27:53 +0300 (MSK) Received: from T-EXCH-03.corp.yadro.com (t-exch-03.corp.yadro.com [172.17.100.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 0089D49F48; Thu, 8 Jul 2021 15:18:27 +0300 (MSK) Received: from fedora.mshome.net (10.199.0.196) by T-EXCH-03.corp.yadro.com (172.17.100.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Thu, 8 Jul 2021 15:18:25 +0300 From: Ivan Mikhaylov To: "David S . Miller" , Jakub Kicinski , Samuel Mendoza-Jonas CC: Ivan Mikhaylov , Joel Stanley , Benjamin Herrenschmidt , , , Subject: [PATCH v2 1/3] net/ncsi: fix restricted cast warning of sparse Date: Thu, 8 Jul 2021 15:27:52 +0300 Message-ID: <20210708122754.555846-2-i.mikhaylov@yadro.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210708122754.555846-1-i.mikhaylov@yadro.com> References: <20210708122754.555846-1-i.mikhaylov@yadro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.199.0.196] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-03.corp.yadro.com (172.17.100.103) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse reports: net/ncsi/ncsi-rsp.c:406:24: warning: cast to restricted __be32 net/ncsi/ncsi-manage.c:732:33: warning: cast to restricted __be32 net/ncsi/ncsi-manage.c:756:25: warning: cast to restricted __be32 net/ncsi/ncsi-manage.c:779:25: warning: cast to restricted __be32 Signed-off-by: Ivan Mikhaylov --- net/ncsi/ncsi-manage.c | 6 +++--- net/ncsi/ncsi-rsp.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index ca04b6df1341..42b54a3da2e6 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -700,7 +700,7 @@ static int ncsi_oem_gma_handler_bcm(struct ncsi_cmd_arg *nca) nca->payload = NCSI_OEM_BCM_CMD_GMA_LEN; memset(data, 0, NCSI_OEM_BCM_CMD_GMA_LEN); - *(unsigned int *)data = ntohl(NCSI_OEM_MFR_BCM_ID); + *(unsigned int *)data = ntohl((__force __be32)NCSI_OEM_MFR_BCM_ID); data[5] = NCSI_OEM_BCM_CMD_GMA; nca->data = data; @@ -724,7 +724,7 @@ static int ncsi_oem_gma_handler_mlx(struct ncsi_cmd_arg *nca) nca->payload = NCSI_OEM_MLX_CMD_GMA_LEN; memset(&u, 0, sizeof(u)); - u.data_u32[0] = ntohl(NCSI_OEM_MFR_MLX_ID); + u.data_u32[0] = ntohl((__force __be32)NCSI_OEM_MFR_MLX_ID); u.data_u8[5] = NCSI_OEM_MLX_CMD_GMA; u.data_u8[6] = NCSI_OEM_MLX_CMD_GMA_PARAM; @@ -747,7 +747,7 @@ static int ncsi_oem_smaf_mlx(struct ncsi_cmd_arg *nca) int ret = 0; memset(&u, 0, sizeof(u)); - u.data_u32[0] = ntohl(NCSI_OEM_MFR_MLX_ID); + u.data_u32[0] = ntohl((__force __be32)NCSI_OEM_MFR_MLX_ID); u.data_u8[5] = NCSI_OEM_MLX_CMD_SMAF; u.data_u8[6] = NCSI_OEM_MLX_CMD_SMAF_PARAM; memcpy(&u.data_u8[MLX_SMAF_MAC_ADDR_OFFSET], diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 888ccc2d4e34..04bc50be5c01 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -403,7 +403,7 @@ static int ncsi_rsp_handler_ev(struct ncsi_request *nr) /* Update to VLAN mode */ cmd = (struct ncsi_cmd_ev_pkt *)skb_network_header(nr->cmd); ncm->enable = 1; - ncm->data[0] = ntohl(cmd->mode); + ncm->data[0] = ntohl((__force __be32)cmd->mode); return 0; } -- 2.31.1