From patchwork Mon Apr 11 13:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 8801261 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 195ADC0553 for ; Mon, 11 Apr 2016 13:27:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30C23200D0 for ; Mon, 11 Apr 2016 13:27:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 307E82034B for ; Mon, 11 Apr 2016 13:27:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932473AbcDKN1b (ORCPT ); Mon, 11 Apr 2016 09:27:31 -0400 Received: from mail-yw0-f182.google.com ([209.85.161.182]:36095 "EHLO mail-yw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932637AbcDKN0l (ORCPT ); Mon, 11 Apr 2016 09:26:41 -0400 Received: by mail-yw0-f182.google.com with SMTP id o66so116955755ywc.3; Mon, 11 Apr 2016 06:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=YnRlujJhVKjRxc+xfiyHBqeIHEEbarf/BJ9HqRiOjvY=; b=Udddpn//n1Fr/y/1HWOxyNs3pRbYwa+lmGcKkvqRCI6K/5+y2UZ/fjcx5ggJviadwS bdCYysrl8u6g75A3VHUzksfChkXtC/adfo/GDefVqa1LFSl/STYbB7PqJQ2FQik93lHu Gf4CmiqTxtbKlJi0QZPHFngF0giFyP+H7sBGhb/g+aAa0poq8G0ue0rZgEE/oQGsXlz5 hbBAqGFEgA1UhUa68/XbO25R4wNwCm6UbRRbqJW/qnWqihrMobdQLCmq9Fxw7SLduuYu L+HGFScsGEHCLV8TrK0gB4u1Gt2hhg0sDdg0KvlB8OCqRxPpEQcC9c3NKg1ZK6xhaxsw KDkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YnRlujJhVKjRxc+xfiyHBqeIHEEbarf/BJ9HqRiOjvY=; b=E0H/hUpwXCg74jDpBSMIXn6JMgZzoV9xIOXuAF6XuTPKlsRKrDlG5yyP6ubESfnReH qaIN18Xp6AfIhI/+xJRXLNbfkWsNywzIUNhzadIVIpd3XtJ+orTzmZqQfCu17KlcsBzR IY5JAR9kr6vq0yhBbq64m2iGSiKhvZX+gic65e6iEKDMse0whnGGrDALi65GMueDtDSe IWdJGMbvd71ovHg6itAkJYBoF3axh7hS944FC40LQ0Zm9W6Za8rIP/1HYJZqHzGBh1lC fiEgIZB806125O/RerPFPomQjeq2ykWtK9ahaCxZgbDzfNioLb2KSmRXOEm1XXBhKEdA nPPQ== X-Gm-Message-State: AD7BkJLDbGpzbKwywV5pFArEp4bLEncBTu/ceP9FZ1o9f+Za/jePhi9gwYNRwyW3P2kvrQ== X-Received: by 10.13.212.142 with SMTP id w136mr10483864ywd.3.1460381195324; Mon, 11 Apr 2016 06:26:35 -0700 (PDT) Received: from localhost (71-47-58-73.res.bhn.net. [71.47.58.73]) by smtp.gmail.com with ESMTPSA id m184sm6423780ywd.2.2016.04.11.06.26.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 06:26:34 -0700 (PDT) From: William Breathitt Gray To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, gregkh@linuxfoundation.org Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, alsa-devel@alsa-project.org, William Breathitt Gray , "James E . J . Bottomley" , "Martin K . Petersen" Subject: [PATCH 3/4] scsi: ultrastor: Use correct format identifier for kernel pointer Date: Mon, 11 Apr 2016 09:25:53 -0400 Message-Id: X-Mailer: git-send-email 2.7.3 In-Reply-To: References: In-Reply-To: References: 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The 'bios_segment' member of a struct ultrastor_config is passed to the sprintf function with a respective %05X format identifier. The 'bio_segment' member is a kernel pointer, but the %X format identifier expects an int data type. A cast to int is correctly used to satisfy the format identifier, but this assumes that the int data type is the same size as the kernel pointer, which is not the case on several architectures such as X86_64. This patch removes the int cast and replaces the %05X format identifier with %pK in order to print the 'bio_segment' member regardless of architecture. Cc: James E.J. Bottomley Cc: Martin K. Petersen Signed-off-by: William Breathitt Gray --- drivers/scsi/ultrastor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 14e0c40..2e99f98 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -670,12 +670,12 @@ static const char *ultrastor_info(struct Scsi_Host * shpnt) sprintf(buf, "UltraStor 24F SCSI @ Slot %u IRQ%u", config.slot, config.interrupt); else if (config.subversion) - sprintf(buf, "UltraStor 34F SCSI @ Port %03X BIOS %05X IRQ%u", - config.port_address, (int)config.bios_segment, + sprintf(buf, "UltraStor 34F SCSI @ Port %03X BIOS %pK IRQ%u", + config.port_address, config.bios_segment, config.interrupt); else - sprintf(buf, "UltraStor 14F SCSI @ Port %03X BIOS %05X IRQ%u DMA%u", - config.port_address, (int)config.bios_segment, + sprintf(buf, "UltraStor 14F SCSI @ Port %03X BIOS %pK IRQ%u DMA%u", + config.port_address, config.bios_segment, config.interrupt, config.dma_channel); return buf; }