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: 8801521 Return-Path: X-Original-To: patchwork-alsa-devel@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 16A88C0553 for ; Mon, 11 Apr 2016 13:35:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AD3C202F8 for ; Mon, 11 Apr 2016 13:35:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EEF7C20204 for ; Mon, 11 Apr 2016 13:35:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8FE03265D12; Mon, 11 Apr 2016 15:35:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E7971265818; Mon, 11 Apr 2016 15:30:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 09E1A2652B4; Mon, 11 Apr 2016 15:26:43 +0200 (CEST) Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) by alsa0.perex.cz (Postfix) with ESMTP id D28C426527F for ; Mon, 11 Apr 2016 15:26:35 +0200 (CEST) Received: by mail-yw0-f174.google.com with SMTP id i84so202056342ywc.2 for ; Mon, 11 Apr 2016 06:26:35 -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=jLBye473AkYxiHQDKEzgs/7tv5lqHDNptQJPn8ai+0O2VP93yuMqgB9seWz0bL7CUv s5Ko0RFB99EWymv9Vps2hc51xymV/Unb/zhG0tD44tvaEiIcOfRA7cYcGTy7PbI3mZAd auVD4lq92tGkZ16FVWkUYGJwhha9moz6pM8muQwXWVqjvSUtpC4RwjJZFeJ2OjUnGLV8 EZhCFUPwC3wZ2NrcdBafJUkqB9f0Qgo/1KMA1h1U9inCyhaE+759ws6yS4K0+GNxraXV aT2rR6b6R46J74zdDU8Dhe9ZLzrW+GUstqJF52sxkdkdtImolps7SE3faVDXD/4onFU5 vTqA== X-Gm-Message-State: AD7BkJJK8ZD/tY4srGX9ig/43OwxqoMvY/nl6wTAdkdqrJdaHNg0+qSHpZnzpgkjGeRWLA== 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 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: X-Mailman-Approved-At: Mon, 11 Apr 2016 15:30:00 +0200 Cc: alsa-devel@alsa-project.org, "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [alsa-devel] [PATCH 3/4] scsi: ultrastor: Use correct format identifier for kernel pointer X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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; }