From patchwork Sat Jun 6 00:15:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 6558621 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 592E1C0020 for ; Sat, 6 Jun 2015 00:15:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7498820812 for ; Sat, 6 Jun 2015 00:15:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 648FC20807 for ; Sat, 6 Jun 2015 00:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752920AbbFFAPR (ORCPT ); Fri, 5 Jun 2015 20:15:17 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:34336 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752843AbbFFAPO (ORCPT ); Fri, 5 Jun 2015 20:15:14 -0400 Received: by pdbki1 with SMTP id ki1so62724654pdb.1; Fri, 05 Jun 2015 17:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=uCEAYDXPHK0HUNIgjLLRHd3Jt5IGzj8S8XDcWCgXJKg=; b=cAoFjb4ewQZZbAZpeWa+NkqgKWUs96IHQcwbvrymplNTDuXYH94o95/EycAeebvfID 7ELM3deIKmnZbtZLYp/0r1JIj/5uQYnJup3vzkRiwV+CxCcblPVSQYJQjJs7pPWUDcf2 I5NjkK3/ofpP/s58HoSvpIgWANy4USN5wbJ8v9XV3VyxYochnX9nfwnOBMvlxm4Mlvu2 dxsk9EaYkLS35do5bnHyINW7JQsDxi8AEg1VqKZOlbK9ocEiRSZpnXQh7NAh80DaM9vv J6ruhxajxlhRLRoEvRfW5zFt36E3IrfI+NM2VfZWtSnq+JhbWRl+7e6l6kdARXKL7hPF 8/eg== X-Received: by 10.68.68.203 with SMTP id y11mr9746719pbt.34.1433549714279; Fri, 05 Jun 2015 17:15:14 -0700 (PDT) Received: from vaishali-Ideapad-Z570 ([43.249.235.16]) by mx.google.com with ESMTPSA id za1sm7769515pbb.55.2015.06.05.17.15.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Jun 2015 17:15:13 -0700 (PDT) Date: Sat, 6 Jun 2015 05:45:03 +0530 From: Vaishali Thakkar To: "James E.J. Bottomley" Cc: QLogic-Storage-Upstream@qlogic.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Julia Lawall Subject: [PATCH] [SCSI] qla4xxx: Convert __constant_cpu_to_le16 to cpu_to_le16 Message-ID: <20150606001503.GA7996@vaishali-Ideapad-Z570> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In big endian cases, macro cpu_to_le16 unfolds to __swab16 which provides special case for constants. In little endian cases, __constant_cpu_to_le16 and cpu_to_le16 expand directly to the same expression. So, replace __constant_cpu_to_le16 with cpu_to_le16 with the goal of getting rid of the definition of __constant_cpu_to_le16 completely. The semantic patch that performs this transformation is as follows: @@expression x;@@ - __constant_cpu_to_le16(x) + cpu_to_le16(x) Signed-off-by: Vaishali Thakkar --- drivers/scsi/qla4xxx/ql4_nx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index 7c33658..06d6cce 100644 --- a/drivers/scsi/qla4xxx/ql4_nx.c +++ b/drivers/scsi/qla4xxx/ql4_nx.c @@ -3741,9 +3741,9 @@ qla4_8xxx_get_flt_info(struct scsi_qla_host *ha, uint32_t flt_addr) goto no_flash_data; } - if (*wptr == __constant_cpu_to_le16(0xffff)) + if (*wptr == cpu_to_le16(0xffff)) goto no_flash_data; - if (flt->version != __constant_cpu_to_le16(1)) { + if (flt->version != cpu_to_le16(1)) { DEBUG2(ql4_printk(KERN_INFO, ha, "Unsupported FLT detected: " "version=0x%x length=0x%x checksum=0x%x.\n", le16_to_cpu(flt->version), le16_to_cpu(flt->length), @@ -3846,7 +3846,7 @@ qla4_82xx_get_fdt_info(struct scsi_qla_host *ha) qla4_82xx_read_optrom_data(ha, (uint8_t *)ha->request_ring, hw->flt_region_fdt << 2, OPTROM_BURST_SIZE); - if (*wptr == __constant_cpu_to_le16(0xffff)) + if (*wptr == cpu_to_le16(0xffff)) goto no_flash_data; if (fdt->sig[0] != 'Q' || fdt->sig[1] != 'L' || fdt->sig[2] != 'I' ||