From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751464AbdFZJ5k (ORCPT ); Mon, 26 Jun 2017 05:57:40 -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 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 Content-Type: text/plain 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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 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; }; -- 1.9.1