From patchwork Wed Jan 23 19:08:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10777743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C89F26C2 for ; Wed, 23 Jan 2019 19:08:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8DA02CC3D for ; Wed, 23 Jan 2019 19:08:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD39E2CED1; Wed, 23 Jan 2019 19:08:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BCC82CC3D for ; Wed, 23 Jan 2019 19:08:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbfAWTIn (ORCPT ); Wed, 23 Jan 2019 14:08:43 -0500 Received: from out002.mailprotect.be ([83.217.72.86]:49527 "EHLO out002.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfAWTIm (ORCPT ); Wed, 23 Jan 2019 14:08:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id :Date:Subject:Cc:To:From:reply-to:sender:bcc:in-reply-to:references: content-type; bh=wV+98pllaXm6zmcaL56yPSFa0ZzVrcVcyj5jS2rNqkk=; b=IJH6Tvg+7zfw 9BNMR+nhdSgG+Mo8s8HdCxyoR/1RPhbIhat2mz2xPE0GNFIvXTPAfgjIAlN81eTFPItntTP/mt1FX NArjytNA8CDorneWi5qQ7JhZWD09VAx+sdbTKvLzgCWNmj+VCF82wh7SQVn44sAfvw2WQwVVRlT2Y 0XnRhNAo5LigCbWiUD+ppHio7iJRCwUOBKbKSb3KYY8zETpcaLxsox2ty28m+1QOl3B0xTWN64Md1 0lUkf+zxFYyaGip7HHUvOBq6ys9ggza6XiVGwomo0IPb8wVfR/Zb+CTm0SVMtnp31RmXF6wbiWuUJ qA1rotMy+1Sc0avhcOCQow==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out002.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gmNt1-0008go-Ml; Wed, 23 Jan 2019 20:08:32 +0100 Received: from desktop-bart.svl.corp.google.com (unknown [104.133.8.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id 46AEBC04F4; Wed, 23 Jan 2019 20:08:13 +0100 (CET) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Jian Luo , John Garry Subject: [PATCH] libsas: Remove scsi_to_u32() Date: Wed, 23 Jan 2019 11:08:05 -0800 Message-Id: <20190123190805.119407-1-bvanassche@acm.org> X-Mailer: git-send-email 2.20.1.321.g9e740568ce-goog MIME-Version: 1.0 X-Originating-IP: 178.208.39.155 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.02) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5tCMjtE33YPGC46LqT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bi5rF8ODDqwvOmW8LP8hypHxNO+eyolGM4 l8rlxuGfhU+33LbhuikOxVCbuGxp6OB3Fs0zPvDb1rhDmgRVSpCE9+UHGvfy8ZlZN5+gnudR2/Zz X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the function scsi_to_u32() is identical to get_unaligned_be32(), change all scsi_to_u32() calls into get_unaligned_be32() calls. Cc: Jian Luo Cc: John Garry Signed-off-by: Bart Van Assche Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn --- drivers/scsi/libsas/sas_expander.c | 9 +++++---- include/scsi/scsi.h | 6 ------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 83e3715d30e4..b13b245791b0 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "sas_internal.h" @@ -696,10 +697,10 @@ int sas_smp_get_phy_events(struct sas_phy *phy) if (res) goto out; - phy->invalid_dword_count = scsi_to_u32(&resp[12]); - phy->running_disparity_error_count = scsi_to_u32(&resp[16]); - phy->loss_of_dword_sync_count = scsi_to_u32(&resp[20]); - phy->phy_reset_problem_count = scsi_to_u32(&resp[24]); + phy->invalid_dword_count = get_unaligned_be32(&resp[12]); + phy->running_disparity_error_count = get_unaligned_be32(&resp[16]); + phy->loss_of_dword_sync_count = get_unaligned_be32(&resp[20]); + phy->phy_reset_problem_count = get_unaligned_be32(&resp[24]); out: kfree(req); diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index eb7853c1a23b..5339baadc082 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -274,10 +274,4 @@ static inline int scsi_is_wlun(u64 lun) /* Used to obtain the PCI location of a device */ #define SCSI_IOCTL_GET_PCI 0x5387 -/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ -static inline __u32 scsi_to_u32(__u8 *ptr) -{ - return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; -} - #endif /* _SCSI_SCSI_H */