From patchwork Fri Jan 2 23:29:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5561171 Return-Path: X-Original-To: patchwork-linux-media@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 30774BF6C3 for ; Fri, 2 Jan 2015 23:26:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F6AE2024D for ; Fri, 2 Jan 2015 23:26:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4926A2021B for ; Fri, 2 Jan 2015 23:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752396AbbABX0J (ORCPT ); Fri, 2 Jan 2015 18:26:09 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34815 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbbABX0I (ORCPT ); Fri, 2 Jan 2015 18:26:08 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so264849wiv.14 for ; Fri, 02 Jan 2015 15:26:07 -0800 (PST) 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; bh=2uedZdoJlncuEDonlcxLdodF0pI6owGPdgMaM/A2tPE=; b=cXhTbKojLLZqB4oB4Lkbqdi8PmAl0eb6i6iatslEuK536jeg+gBTMPKN/7jmyaZHik cMZBnGZ7r5jCDoSwYjksiJpgRpCfgkHKJ5nVtUni8eL/blLtXXRaRdYSvnc6w64MQkYY jKFFqZAO1uJjLIeQHijb2YDGiFKAPpa8DBgaZCnVeLSp5S+6nq6X8KcVXAGiuo5yzkYZ 1L4mp38RpGY4OTw3YhTl08dkknEJZnapEDM7CxuH/fDV0vZcjoa6us2fegRpjB6N7/o+ SGbZcdx6ZxPpklychqJtyTPpYxkP7RmhNy9uDEuAC1ZpTWLgtKURhu/C0Chnx6rMzQzn 93cQ== X-Gm-Message-State: ALoCoQkzx2RuzR0I7cbWTrEbiHPbDDfTTEs7lwhck7SODzCc463WNVzCgAkinKToiPLfcGHMgH7r X-Received: by 10.194.82.97 with SMTP id h1mr157586949wjy.116.1420241166953; Fri, 02 Jan 2015 15:26:06 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id h8sm721795wiy.17.2015.01.02.15.26.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jan 2015 15:26:06 -0800 (PST) From: Rickard Strandqvist To: Hans Verkuil , Mauro Carvalho Chehab Cc: Rickard Strandqvist , Grant Likely , Rob Herring , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH] media: i2c: adv7604: Remove some unused functions Date: Sat, 3 Jan 2015 00:29:08 +0100 Message-Id: <1420241348-4776-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removes some functions that are not used anywhere: test_read() edid_read_block() dpp_write() dpp_read() esdp_write() esdp_read() cec_write_clr_set() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/media/i2c/adv7604.c | 66 ------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 47795ff..5e07b91 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -466,11 +466,6 @@ static inline int cec_write(struct v4l2_subdev *sd, u8 reg, u8 val) return adv_smbus_write_byte_data(state, ADV7604_PAGE_CEC, reg, val); } -static inline int cec_write_clr_set(struct v4l2_subdev *sd, u8 reg, u8 mask, u8 val) -{ - return cec_write(sd, reg, (cec_read(sd, reg) & ~mask) | val); -} - static inline int infoframe_read(struct v4l2_subdev *sd, u8 reg) { struct adv7604_state *state = to_state(sd); @@ -486,34 +481,6 @@ static inline int infoframe_write(struct v4l2_subdev *sd, u8 reg, u8 val) reg, val); } -static inline int esdp_read(struct v4l2_subdev *sd, u8 reg) -{ - struct adv7604_state *state = to_state(sd); - - return adv_smbus_read_byte_data(state, ADV7604_PAGE_ESDP, reg); -} - -static inline int esdp_write(struct v4l2_subdev *sd, u8 reg, u8 val) -{ - struct adv7604_state *state = to_state(sd); - - return adv_smbus_write_byte_data(state, ADV7604_PAGE_ESDP, reg, val); -} - -static inline int dpp_read(struct v4l2_subdev *sd, u8 reg) -{ - struct adv7604_state *state = to_state(sd); - - return adv_smbus_read_byte_data(state, ADV7604_PAGE_DPP, reg); -} - -static inline int dpp_write(struct v4l2_subdev *sd, u8 reg, u8 val) -{ - struct adv7604_state *state = to_state(sd); - - return adv_smbus_write_byte_data(state, ADV7604_PAGE_DPP, reg, val); -} - static inline int afe_read(struct v4l2_subdev *sd, u8 reg) { struct adv7604_state *state = to_state(sd); @@ -561,32 +528,6 @@ static inline int edid_write(struct v4l2_subdev *sd, u8 reg, u8 val) return adv_smbus_write_byte_data(state, ADV7604_PAGE_EDID, reg, val); } -static inline int edid_read_block(struct v4l2_subdev *sd, unsigned len, u8 *val) -{ - struct adv7604_state *state = to_state(sd); - struct i2c_client *client = state->i2c_clients[ADV7604_PAGE_EDID]; - u8 msgbuf0[1] = { 0 }; - u8 msgbuf1[256]; - struct i2c_msg msg[2] = { - { - .addr = client->addr, - .len = 1, - .buf = msgbuf0 - }, - { - .addr = client->addr, - .flags = I2C_M_RD, - .len = len, - .buf = msgbuf1 - }, - }; - - if (i2c_transfer(client->adapter, msg, 2) < 0) - return -EIO; - memcpy(val, msgbuf1, len); - return 0; -} - static inline int edid_write_block(struct v4l2_subdev *sd, unsigned len, const u8 *val) { @@ -652,13 +593,6 @@ static inline int hdmi_write_clr_set(struct v4l2_subdev *sd, u8 reg, u8 mask, u8 return hdmi_write(sd, reg, (hdmi_read(sd, reg) & ~mask) | val); } -static inline int test_read(struct v4l2_subdev *sd, u8 reg) -{ - struct adv7604_state *state = to_state(sd); - - return adv_smbus_read_byte_data(state, ADV7604_PAGE_TEST, reg); -} - static inline int test_write(struct v4l2_subdev *sd, u8 reg, u8 val) { struct adv7604_state *state = to_state(sd);