From patchwork Tue Aug 7 12:26:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10558645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7496B13AC for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6329329C3D for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5712929C3E; Tue, 7 Aug 2018 12:26:47 +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 01DF729C39 for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389010AbeHGOkv (ORCPT ); Tue, 7 Aug 2018 10:40:51 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47486 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388940AbeHGOkv (ORCPT ); Tue, 7 Aug 2018 10:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Message-Id:Date:Subject:Cc:To: From:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: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=ibc4/eB5kuwDODCXtUvYLb56VJsdK2LyJcg4s/7AY1A=; b=eUz348BOIZvYSsefPxWMq/upss fRQYVD98WWaUx2MNoe02UcwsidEQwRD5wszNuI0nbaHs602xJjj2wBfrxqkPUWqOlrdu13dZ+aUeq PaloXyZCxA6NBosSd4Xw8nMlbfApoQhT+cHrNpWHWBnZmC441UKK94k5iiqDycuSJ5goYlgAXm8xw GMVZ8p/GLFAkbmmmSjahzNmp/Z17Up8STMWBJCDrz3C5aOcyK3YVHvC1yn7bQTmhzPYtFaZceFpA8 rpUhICzbOcyb0TFBNlJ4StXmy/y3Pn6CRMEaJ5BnnQktLAxS4cNNeKniQuYJLogSzKY+G/s7RwP6h vou3VNNw==; Received: from [179.177.31.111] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fn14X-0005B7-H1; Tue, 07 Aug 2018 12:26:45 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fn14V-0009rg-Ex; Tue, 07 Aug 2018 08:26:43 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 1/3] media: tuner-xc2028: don't use casts for printing sizes Date: Tue, 7 Aug 2018 08:26:40 -0400 Message-Id: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Makes smatch happier by using %zd instead of casting sizes: drivers/media/tuners/tuner-xc2028.c:378 load_all_firmwares() warn: argument 4 to %d specifier is cast from pointer drivers/media/tuners/tuner-xc2028.c:619 load_firmware() warn: argument 6 to %d specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/tuner-xc2028.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index 222b93ef31c0..aa6861dcd3fd 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c @@ -376,9 +376,8 @@ static int load_all_firmwares(struct dvb_frontend *fe, tuner_err("Firmware type "); dump_firm_type(type); printk(KERN_CONT - "(%x), id %llx is corrupted (size=%d, expected %d)\n", - type, (unsigned long long)id, - (unsigned)(endp - p), size); + "(%x), id %llx is corrupted (size=%zd, expected %d)\n", + type, (unsigned long long)id, (endp - p), size); goto corrupt; } @@ -616,8 +615,8 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, } if ((size + p > endp)) { - tuner_err("missing bytes: need %d, have %d\n", - size, (int)(endp - p)); + tuner_err("missing bytes: need %d, have %zd\n", + size, (endp - p)); return -EINVAL; } From patchwork Tue Aug 7 12:26:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10558647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D3168157D for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2A1E29C39 for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6C4C29C3E; Tue, 7 Aug 2018 12:26:47 +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 5982D29C39 for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389025AbeHGOkw (ORCPT ); Tue, 7 Aug 2018 10:40:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47488 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388940AbeHGOkv (ORCPT ); Tue, 7 Aug 2018 10:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5ER+9JDQlQ1bQiGYWg459lcvHZhdwNtgeLvVjh5Op/0=; b=K8pMBjLcvIBe/axsaCE7kSDe8 LJF1nXmxFLNcFjIPDGMUXxsOpmqRQrvND7aN2iO8ksrZCPToMn8CuGL5NnM8xDEDDsR2sU04rIVKw GyTK4ZYvovyurt/jzKXVirakmew7xqM8z7bnT1ZxU+RVjOchnB8NndYzvvOGSelZk5qMCpUKV2DQL 2uH7bcM1l0Eb1FjnNin30sylRJWYv2JgnJuZDVmUX3+izHGGiNi1wI+OhD5FXnTNxK7AQuprfsTF/ rb8yPKaTl+CbtpQUwQGM8Mkx5pX6JrlG9tsownOlh+sqb2276dx9xh4k0IOQSrnsG4ng1WItWK50z goWjO9U6Q==; Received: from [179.177.31.111] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fn14X-0005B8-Jd; Tue, 07 Aug 2018 12:26:45 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fn14V-0009rk-Fe; Tue, 07 Aug 2018 08:26:43 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Nick Desaulniers Subject: [PATCH 2/3] media: drxj: get rid of uneeded casts Date: Tue, 7 Aug 2018 08:26:41 -0400 Message-Id: <73679ccd7a36de61bd8405e9828989e9dd959bc5.1533644783.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> References: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> In-Reply-To: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> References: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of doing casts, use %zd to print sizes, in order to make smatch happier: drivers/media/dvb-frontends/drx39xyj/drxj.c:11814 drx_ctrl_u_code() warn: argument 4 to %u specifier is cast from pointer drivers/media/dvb-frontends/drx39xyj/drxj.c:11845 drx_ctrl_u_code() warn: argument 3 to %u specifier is cast from pointer drivers/media/dvb-frontends/drx39xyj/drxj.c:11869 drx_ctrl_u_code() warn: argument 3 to %u specifier is cast from pointer drivers/media/dvb-frontends/drx39xyj/drxj.c:11878 drx_ctrl_u_code() warn: argument 3 to %u specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Nick Desaulniers --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 2948d12d7c14..9628d4067fe1 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -11810,8 +11810,8 @@ static int drx_ctrl_u_code(struct drx_demod_instance *demod, block_hdr.CRC = be16_to_cpu(*(__be16 *)(mc_data)); mc_data += sizeof(u16); - pr_debug("%u: addr %u, size %u, flags 0x%04x, CRC 0x%04x\n", - (unsigned)(mc_data - mc_data_init), block_hdr.addr, + pr_debug("%zd: addr %u, size %u, flags 0x%04x, CRC 0x%04x\n", + (mc_data - mc_data_init), block_hdr.addr, block_hdr.size, block_hdr.flags, block_hdr.CRC); /* Check block header on: @@ -11841,8 +11841,8 @@ static int drx_ctrl_u_code(struct drx_demod_instance *demod, mc_block_nr_bytes, mc_data, 0x0000)) { rc = -EIO; - pr_err("error writing firmware at pos %u\n", - (unsigned)(mc_data - mc_data_init)); + pr_err("error writing firmware at pos %zd\n", + mc_data - mc_data_init); goto release; } break; @@ -11865,8 +11865,8 @@ static int drx_ctrl_u_code(struct drx_demod_instance *demod, (u16)bytes_to_comp, (u8 *)mc_data_buffer, 0x0000)) { - pr_err("error reading firmware at pos %u\n", - (unsigned)(mc_data - mc_data_init)); + pr_err("error reading firmware at pos %zd\n", + mc_data - mc_data_init); return -EIO; } @@ -11874,8 +11874,8 @@ static int drx_ctrl_u_code(struct drx_demod_instance *demod, bytes_to_comp); if (result) { - pr_err("error verifying firmware at pos %u\n", - (unsigned)(mc_data - mc_data_init)); + pr_err("error verifying firmware at pos %zd\n", + mc_data - mc_data_init); return -EIO; } From patchwork Tue Aug 7 12:26:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10558649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B54B13AC for ; Tue, 7 Aug 2018 12:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59E1229C39 for ; Tue, 7 Aug 2018 12:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E6AB29C3E; Tue, 7 Aug 2018 12:26:48 +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 F212129C39 for ; Tue, 7 Aug 2018 12:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389071AbeHGOkw (ORCPT ); Tue, 7 Aug 2018 10:40:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47494 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389022AbeHGOkw (ORCPT ); Tue, 7 Aug 2018 10:40:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rDGutmk3M+hlG7O5Uo0H0M8NjDyGBGHOts1bDE1+O6k=; b=tH129iGctAxNHfdVuUCfkUX9c c5h2gSLajpoiusqDoh5SZX2bW6sNA/ctz3fZTU44DaUmtdwUzkuNLKeR+k9LFFZLuGMpEofyCNKzA V99yOGnTuMYJxSVOuBQHSvXbytHr/acL7cmGqJkHH6ABTu2EPFP0fYH8pgtmlAJYX71JFGrq8Z3bz 7+fJLN+CNJIHNKvFuJCklL3B8J6qP4gVciVRzzBByU7wQ5akaKb7rx0t7RN965xCkha20gnDyY6LY Pc9pOgvwknLm9KAuuGtjh9+F/tIKReupIpPuH/EeiQ8LEYZYqa4tsRMBZYNP2fcHVNV+KImzqRh7W V7fnOEQZA==; Received: from [179.177.31.111] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fn14X-0005B9-KL; Tue, 07 Aug 2018 12:26:45 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fn14V-0009ro-GM; Tue, 07 Aug 2018 08:26:43 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Michael Buesch Subject: [PATCH 3/3] media: xc4000: get rid of uneeded casts Date: Tue, 7 Aug 2018 08:26:42 -0400 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> References: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> In-Reply-To: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> References: <7fbc03c87b03ffb9128fe67bcbca6f1c6cc96c5c.1533644783.git.mchehab+samsung@kernel.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of doing casts, use %zd to print sizes, in order to make smatch happier: drivers/media/tuners/xc4000.c:818 xc4000_fwupload() warn: argument 4 to %d specifier is cast from pointer Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/xc4000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c index 76b3f37f24a8..eb6d65dae748 100644 --- a/drivers/media/tuners/xc4000.c +++ b/drivers/media/tuners/xc4000.c @@ -815,9 +815,9 @@ static int xc4000_fwupload(struct dvb_frontend *fe) p += sizeof(size); if (!size || size > endp - p) { - printk(KERN_ERR "Firmware type (%x), id %llx is corrupted (size=%d, expected %d)\n", + printk(KERN_ERR "Firmware type (%x), id %llx is corrupted (size=%zd, expected %d)\n", type, (unsigned long long)id, - (unsigned)(endp - p), size); + endp - p, size); goto corrupt; }