From patchwork Thu May 3 18:21:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10378851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02CD46037D for ; Thu, 3 May 2018 18:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E867C291DA for ; Thu, 3 May 2018 18:21:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB74029215; Thu, 3 May 2018 18:21:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68309291DA for ; Thu, 3 May 2018 18:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbeECSVL (ORCPT ); Thu, 3 May 2018 14:21:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37510 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbeECSVJ (ORCPT ); Thu, 3 May 2018 14:21:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Cc:Subject:From:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8dWXHLC042g0IElkFiUiqjckT1rMTZJBiTYBQ0xQmwc=; b=igRP49i3ApGf1G3vlUTqO0Cwh XcQ4Kgm84X8vAFoU0NeIgw6zP/iTxKljMjATGvkCrPRC9EH41BI9ZuwQ5E40mVU2VChN1uuyvk5We QBI4CA1dkQMgt2sKdNDmTAOpoOGOrJYmMqGGk5vJuOnuttDyQP2HodubffKBTfjnsBXURPiSQ+/EC uDuEBilOpuxyKa0K/gAls1anmljlo+631uRFdsC2gquzkBhZ0Cy7R+B3izX1IdiYD6fvVyyUk1Ltm PhzqJoHS4FeF4qZjlH+QoSizupy+3a0XpGR3bbP/Bg9ChMz7QIZ2rZCXE99a29EYSyN0KYStH1ArY zDRT5tzuw==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEIqp-0000wa-Bs; Thu, 03 May 2018 18:21:07 +0000 To: LKML , "linux-block@vger.kernel.org" , axboe@kernel.dk From: Randy Dunlap Subject: [PATCH -next] zram: fix printk formats in zram_drv.c Cc: Nitin Gupta , Minchan Kim , Sergey Senozhatsky Message-ID: <3652ccb1-96ef-0b0b-05d1-f661d7733dcc@infradead.org> Date: Thu, 3 May 2018 11:21:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap Fix printk format warnings (seen on i386 build): ../drivers/block/zram/zram_drv.c:678:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ssize_t’ [-Wformat=] ../drivers/block/zram/zram_drv.c:678:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘time64_t’ [-Wformat=] time64_t is 64 bits (and signed), so printing it should use %lld, not %ld. %ld (long) is only 32 bits on several architectures. Signed-off-by: Randy Dunlap Cc: Nitin Gupta Cc: Minchan Kim Cc: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-next-20180503.orig/drivers/block/zram/zram_drv.c +++ linux-next-20180503/drivers/block/zram/zram_drv.c @@ -671,7 +671,7 @@ static ssize_t read_block_state(struct f ts = ktime_to_timespec64(zram->table[index].ac_time); copied = snprintf(kbuf + written, count, - "%12lu %12lu.%06lu %c%c%c\n", + "%12zd %12lld.%06lu %c%c%c\n", index, ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC, zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.', zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',