From patchwork Tue Jun 21 09:02:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102123 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1908215qgy; Tue, 21 Jun 2016 02:02:31 -0700 (PDT) X-Received: by 10.107.143.131 with SMTP id r125mr29643639iod.54.1466499751290; Tue, 21 Jun 2016 02:02:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u190si24209810pfb.239.2016.06.21.02.02.31 for ; Tue, 21 Jun 2016 02:02:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751224AbcFUJCa (ORCPT ); Tue, 21 Jun 2016 05:02:30 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:52000 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbcFUJC2 (ORCPT ); Tue, 21 Jun 2016 05:02:28 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MLPHO-1bFpVv3dxq-000ewi; Tue, 21 Jun 2016 11:00:45 +0200 From: Arnd Bergmann To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] scsi: wd7000: print sector number as 64-bit Date: Tue, 21 Jun 2016 11:02:39 +0200 Message-Id: <20160621090249.774301-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:YdYdbc5hO4ZLfwayhjm96XS1l4Ugos3gdAgas6GerxzkYeOwnPA xetlr3LgarOnseztxlVKP5bZD+FQSR3MrGfA52ZAoGHWzZuv4AzHKTGnW340uhRJC2F20bd r9lqwz6jIAHRi/DVqrKhINforfDZjRXuw6TwJ7HEzqEgSh4Mj35AXNuo32f5J+MLZRl/cAo HAEvvX+dWS4B8yhsT40QA== X-UI-Out-Filterresults: notjunk:1; V01:K0:7lLrqjqeSGg=:PMfHArSHaKd6IhXCEKOBDe MgWdOc2eP1cqEF2tf6LHbLJAjXXg0frDZrRQ0W9DPirx9B7SjaLA0HnZ7/fifGxRcJ4pw1BrJ irai9WtJpv+az7ko5owa3fAX5rUHz9Vhvv1rwu0MtVk7kSq5EREqKF3S794SS38F+PGsb1yx6 iNAQPJLxGEoKtfvam9CLFVrhPSC54Tve79Vg1R85gAZ2vkofTLsZ0aFFbc+DD87tqTXOEEhp8 08gtlsUeFlzRckJS87WZGOMY3FnmDZ3KA8M8iKQtnoDfRqsQYXpArpDO01fCOekgKzo2dZ1MP 1OFcYggn2EXKjwUzZZy+8JZRmyW+61nx0EBU1j6bn0Fqx6sIH6DwEhN4OOjpkesACjGJ2C2jZ G4E86qJTarb7LRCPeVK68aEAGeiBPAg6dKB4eOWk9KgoMv7kwQkg8ZDRljxmjl2kfxDeWOA6r J9rUIZyILBdIRivWLJYvS7HmqEOvpzZILC1i85q9wgUnr+pYMyI7WyJg04wceTuSvG68LO+pX W1QafTIn/nvwiISowUknqbQtVcT288hsG+PlT+7cxQoRHUp/SngMe+MO/dXFAHCFZzpE7td/H q605gCETxLFL4TIz7vy0HUZb4hpQyKk9s6hLqnhelkdAPq4hIHB/t5uyxJQviF8DYWthJpXsH OQteAH/cwda1EtoBnJRDZfSwnCYHCbh6XV+veaFg7ck2lv+yhIFhOp3rjLPJM+kz5ru0= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Enabling format checking in dprintk() shows that wd7000_biosparam uses an incorrect format string for sector_t: drivers/scsi/wd7000.c: In function 'wd7000_biosparam': drivers/scsi/wd7000.c:1594:21: error: format '%d' expects argument of type 'int', but argument 3 has type 'sector_t {aka long long unsigned int}' [-Werror=format=] As sector_t can be 32-bit wide, this adds a cast to 'u64' and prints that with the correct format. The change to use no_printk() generally helps with finding this kind of hidden format string bug, and I found that when building with "-Wextra", which warned about an empty else clause in } else dprintk("ok!\n"); Signed-off-by: Arnd Bergmann --- v2: use %llu instead of %lld and use 'u64' instead of 's64' because sector_t is unsigned. drivers/scsi/wd7000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index 0c0f17b9a3eb..409f959845c4 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c @@ -192,7 +192,7 @@ #ifdef WD7000_DEBUG #define dprintk printk #else -#define dprintk(format,args...) +#define dprintk no_printk #endif /* @@ -1591,8 +1591,8 @@ static int wd7000_biosparam(struct scsi_device *sdev, { char b[BDEVNAME_SIZE]; - dprintk("wd7000_biosparam: dev=%s, size=%d, ", - bdevname(bdev, b), capacity); + dprintk("wd7000_biosparam: dev=%s, size=%llu, ", + bdevname(bdev, b), (u64)capacity); (void)b; /* unused var warning? */ /*