alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: William Breathitt Gray <vilhelm.gray@gmail.com>
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 <vilhelm.gray@gmail.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 3/4] scsi: ultrastor: Use correct format identifier for kernel pointer
Date: Mon, 11 Apr 2016 09:25:53 -0400	[thread overview]
Message-ID: <e3ec50672b8e8fd8279178bdba00edfe9af85cbe.1460379702.git.vilhelm.gray@gmail.com> (raw)
In-Reply-To: <cover.1460379702.git.vilhelm.gray@gmail.com>
In-Reply-To: <cover.1460379702.git.vilhelm.gray@gmail.com>

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 <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
 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


  parent reply	other threads:[~2016-04-11 13:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 13:25 [PATCH 0/4] Decouple X86_32 dependency from the ISA Kconfig option William Breathitt Gray
2016-04-11 13:25 ` [PATCH 1/4] pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS William Breathitt Gray
2016-04-22 23:51   ` Rafael J. Wysocki
2016-04-23 14:53     ` William Breathitt Gray
2016-05-01 15:52     ` William Breathitt Gray
2016-04-11 13:25 ` [PATCH 2/4] sound: isa: sscape: Use correct format identifier for size_t William Breathitt Gray
2016-04-11 13:54   ` Takashi Iwai
2016-04-11 13:25 ` William Breathitt Gray [this message]
2016-04-11 13:25 ` [PATCH 4/4] isa: Remove the ISA_BUS Kconfig option William Breathitt Gray
2016-04-13  7:26 ` [PATCH 0/4] Decouple X86_32 dependency from the ISA " Ingo Molnar
2016-04-13 12:15   ` William Breathitt Gray
2016-04-13 14:38     ` Ingo Molnar
2016-04-13 14:48       ` William Breathitt Gray
2016-04-13 15:18         ` Greg KH
2016-05-01 16:17           ` William Breathitt Gray
2016-05-01 21:25             ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3ec50672b8e8fd8279178bdba00edfe9af85cbe.1460379702.git.vilhelm.gray@gmail.com \
    --to=vilhelm.gray@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).