From patchwork Sun May 1 21:57:40 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: 8989601 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D19B9F1C1 for ; Sun, 1 May 2016 21:58:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B552201B4 for ; Sun, 1 May 2016 21:58:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5545220115 for ; Sun, 1 May 2016 21:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752476AbcEAV5t (ORCPT ); Sun, 1 May 2016 17:57:49 -0400 Received: from mail-yw0-f174.google.com ([209.85.161.174]:34371 "EHLO mail-yw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752459AbcEAV5s (ORCPT ); Sun, 1 May 2016 17:57:48 -0400 Received: by mail-yw0-f174.google.com with SMTP id j74so220885238ywg.1; Sun, 01 May 2016 14:57:48 -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=BlyyGrWAlW9YnliSPLTR+EKpfRAVnOslVbdiu+XgrccPR2hV2nrNvPq/HyBc2ysx9N z6fjO1ddrMm7oN0ndDdJ5pph0HaJNjB895Q+aVt4Us8ou9OwGJTcvJgb0vCQzji3d7/p IPLrTdsQEYhBzyweN4NBg+p2wvHFLFBQm/DLQKoX85dOsHmQWTjCWaBVJ8cJNiZi38XV K5hanJU/YlUYzMbo1rZvClyVNgE8gFjS4hoOojG+D5qzgveR5cUycdi30mdyrBnJ7JcR 9nxKpKokzHT5PZA52NcqLxUQBssL3DEDllNbsj8SxDvsCHtHwyiIY3bC39D4xOejOk0T Ao3Q== 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=Al/N61mGNjl7X+frhGkHCmcgujeVgPN6IueHL3wZ9cZVOOjpWJWvMruijcQx6olJux okUW8ZuDhZ1ZhCpoHmr4j7WOi+/F1qMuKH9U52z7G+v05KAX/Z9gwBThRHBHaTj5ihsG xXqNNRwa3DdmsBSnn/kTBFh4qh5ouFJAlGnIxqZcDgFjaj2HC0TI9iyufO5ATL3UogXC 4lLJBR9A6nHFVkEc/ocGu/GeJB+bSUzW50djl0ZlfObdq+Zem5aGWR1s35Vcr+UqtxVj QbFS+Buo0Nu04PJm9Q2YO4vWzFNa6LMt4elUDga2MqWJVmLLFTc3CvoYviVsC/oZ2CPQ NcmA== X-Gm-Message-State: AOPr4FWp7QC4jsC4Nrang0VBu20oGIs2PZ8k7K0tahD0zeqGVjnZsUwm+6WAjJDg6Eb0wg== X-Received: by 10.129.85.134 with SMTP id j128mr17196920ywb.177.1462139867636; Sun, 01 May 2016 14:57:47 -0700 (PDT) Received: from sophia (71-47-58-73.res.bhn.net. [71.47.58.73]) by smtp.gmail.com with ESMTPSA id i196sm13702836ywg.33.2016.05.01.14.57.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 May 2016 14:57:47 -0700 (PDT) Date: Sun, 1 May 2016 17:57:40 -0400 From: William Breathitt Gray To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.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: <20160501215740.GA22213@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; }