From patchwork Sun May 1 21:54:08 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: 8989581 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 5FF11BF29F for ; Sun, 1 May 2016 21:54:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 856AE20115 for ; Sun, 1 May 2016 21:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E5EB200E3 for ; Sun, 1 May 2016 21:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752379AbcEAVyR (ORCPT ); Sun, 1 May 2016 17:54:17 -0400 Received: from mail-yw0-f178.google.com ([209.85.161.178]:36841 "EHLO mail-yw0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300AbcEAVyQ (ORCPT ); Sun, 1 May 2016 17:54:16 -0400 Received: by mail-yw0-f178.google.com with SMTP id o66so253457988ywc.3; Sun, 01 May 2016 14:54:15 -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-disposition :user-agent; bh=Paeu4JcHvjxBXfIu9zoWtKGPoeZJ+KSD4N4C7WZ+Phg=; b=czUhkcVjT9YygCXgbZ/LfHIZG3Fr58NaRfklMhxWmIu/JYoYdiNeESuVvBpH+l5Cjb Ktl51Xobl75V1ZrhqFDv9ISHp4n1D9EeMj0LMzVyLH7aEkqLNkmntbG7X9zqtv8HPXdR RKfUL6Yf2Vnmx1fxo4fGAyhXGd+bvdST2ZmXyzt3sQlj7L4HA6FejxFuaPuzsQzlOWL8 SKEwRZGd+ed/J7OYv0vWo1B34yF3kzMEV1xjPCMlAtmu93EMPnNUx5Id2HAK0QhAR/cr Rf5XmkVGjgtVOZx0ENePO9gLzlVi25lWVdf+zEAIWt67LA7BgT1X8+ANEOH1XDaJlLoD tICQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=Paeu4JcHvjxBXfIu9zoWtKGPoeZJ+KSD4N4C7WZ+Phg=; b=MIUeN/zfH8pI1GH9FuIdxE0UOUeIWzhSIFzjAkdGCpqMI4XxsuJmBPTU95LhIpnJyn Va8Cv6K18zbvSJL+tA7AXsiReTlKdWNftozbF+cF1a/n3aV52+uM25JjjCR/Jfx5gBKd omS4HR1+S5PEYMZbM1UH+uTTBGfkYWTNvlk/TZNMIWYyV+MN5/5YgugSxJWNPOomfIyx PA/KFX8Lb/zCt8BT7pfNpZk12w6qOgUZK7eDSsPoOwfTdh4elGN5V6WHwMJyf1Pgpvm3 iqqIxXEYytd/lKmTbrKvJN8YEAJHvmy5Gi3Pco84Q2/vpX3avXnXIIF6GzRMH6DPcanQ Dj3A== X-Gm-Message-State: AOPr4FWTdo1UDMQOj0eYFPX01pVINU6F+huKxX2seiWmhCaap6BSaLCMZbUtPfHNLPk2Iw== X-Received: by 10.37.215.84 with SMTP id o81mr16215724ybg.134.1462139655309; Sun, 01 May 2016 14:54:15 -0700 (PDT) Received: from sophia (71-47-58-73.res.bhn.net. [71.47.58.73]) by smtp.gmail.com with ESMTPSA id x3sm13721616ywd.15.2016.05.01.14.54.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 May 2016 14:54:14 -0700 (PDT) Date: Sun, 1 May 2016 17:54:08 -0400 From: William Breathitt Gray To: JBottomley@odin.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] scsi: ultrastor: Use correct format identifier for kernel pointer Message-ID: <20160501215356.GA16432@sophia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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. 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; }