Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932853AbcDKN1b (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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1837 Lines: 40 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; } -- 2.7.3