From patchwork Mon Jun 26 10:27:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 106319 Delivered-To: patch@linaro.org Received: by 10.140.97.139 with SMTP id m11csp1381030qge; Mon, 26 Jun 2017 02:57:33 -0700 (PDT) X-Received: by 10.101.91.202 with SMTP id o10mr20795111pgr.206.1498471053073; Mon, 26 Jun 2017 02:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498471053; cv=none; d=google.com; s=arc-20160816; b=amiochExq1i2sCD/GqA7MajNeVKzU6i3J0FY33vLcYjNVKmdTzNez6BTOnGdcFfs3T 8v89j1xwrmeihi6DBlX2KgAcAGF6V8y6KlrnswGcoVIzUZzU/RBlBvAhiC62eJKjNjVZ wrbw7nuew4CCvk7EhoBXUCnBCMQzBVxDUkod6GiPHH2ihpSaarm+afXA4+cANd3jB/Go IRREm2VxyAiNYGvgAsXHCAMWQ06AlVvcCBN5x7OWq/PlNeUq+s4xQWjPWjuYbPXOnQzR WW8G4fafc3slUqCdJUtPMfEA6fEfeMzzqdCKvnw9iAhJMqQZ9NuhfynbjRG1JvMi580G HK2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=yJ+ekcYv3Nb/gMVvDyavwapPqvgHFtru3o25cUtsqlY=; b=Px239qduDZyHZ5UuDuMdeudt8xPwoQB8MQMik0ftab/Y13DL/DUbh5luNQDeaYVV91 zY4jFCd/liX/h69AGR6XBOF9rVfMNPHDX5wDOrd244HOLOYxq9dJJxuxLp8kK9O9eA+b OTbc5d/cC8WU7+aVOjVPdGR9lq9LUiFHGx1vMi/W2Mmxjy+ouZoMzw3bkoml5CMeKbq+ 6W8kg+RAgrSeLVaSEiloonghnIGheomuA4aAzDAl0Qe70DeTaFdqGI/9KCNPCpv7fefo e9ZVxL9D50gFbJVmZWhYLT9eRVYB7sOkpRn1LPfjB3K9pE3T8xDCNeiRlzYeu3rbDIxS ODEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k64si8468049pge.371.2017.06.26.02.57.32; Mon, 26 Jun 2017 02:57:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751407AbdFZJ5c (ORCPT + 1 other); Mon, 26 Jun 2017 05:57:32 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8797 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbdFZJ5b (ORCPT ); Mon, 26 Jun 2017 05:57:31 -0400 Received: from 172.30.72.57 (EHLO DGGEML403-HUB.china.huawei.com) ([172.30.72.57]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AQZ29700; Mon, 26 Jun 2017 17:57:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEML403-HUB.china.huawei.com (10.3.17.33) with Microsoft SMTP Server id 14.3.301.0; Mon, 26 Jun 2017 17:57:15 +0800 From: John Garry To: , CC: , , , , John Garry Subject: [PATCH] scsi: hisi_sas: redefine hisi_sas_phy.phy_type as u32 Date: Mon, 26 Jun 2017 18:27:28 +0800 Message-ID: <1498472848-174945-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.5950DA84.0153, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8f89739ae779c5e666b7a724db00427a Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Element phy_type is a bitmask and it only ever has 2 bits possibly set, and it is overkill to define as a u64, so redefine as a u32. This change resolves static code check complaint that "phy->phy_type &= ~PORT_TYPE_SAS;" would unintentionally clear the high 32 bits as well. Structure hisi_sas_phy is also reordered to ensure packing efficiency. Reported-by: Dan Carpenter Signed-off-by: John Garry -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 4fc2308..22dd48b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -85,11 +85,11 @@ struct hisi_sas_phy { struct work_struct phyup_ws; u64 port_id; /* from hw */ u64 dev_sas_addr; - u64 phy_type; u64 frame_rcvd_size; u8 frame_rcvd[32]; u8 phy_attached; u8 reserved[3]; + u32 phy_type; enum sas_linkrate minimum_linkrate; enum sas_linkrate maximum_linkrate; };