From patchwork Tue May 14 05:45:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2562971 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork2.kernel.org (Postfix) with ESMTP id 4F93DDF24C for ; Tue, 14 May 2013 05:50:25 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4E5mqcl014790; Tue, 14 May 2013 00:48:52 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4E5mqlA008435; Tue, 14 May 2013 00:48:52 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 14 May 2013 00:48:52 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4E5mqLF029172; Tue, 14 May 2013 00:48:52 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 2DF3D8062B; Tue, 14 May 2013 00:48:52 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 2B7D48062C for ; Tue, 14 May 2013 00:48:48 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id r4E5mmMo007708 for ; Tue, 14 May 2013 00:48:48 -0500 (CDT) Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4E5mkHk003718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 May 2013 00:48:47 -0500 Received: from [216.82.242.131:29689] by server-11.bemta-8.messagelabs.com id D1/DD-18209-E30D1915; Tue, 14 May 2013 05:48:46 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-5.tower-76.messagelabs.com!1368510524!26754680!1 X-Originating-IP: [209.85.160.45] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.8.6.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23485 invoked from network); 14 May 2013 05:48:45 -0000 Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by server-5.tower-76.messagelabs.com with RC4-SHA encrypted SMTP; 14 May 2013 05:48:45 -0000 Received: by mail-pb0-f45.google.com with SMTP id mc8so122130pbc.18 for ; Mon, 13 May 2013 22:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=n0MI5ltaLBRFSRZkClMFWJs8sQ4tK8yhwJ5lkHp/+Pc=; b=h4mPuSzhafVmrvCcl0G9IO5WOOq4p8z4M/vDysQueOZB1hU9Xn22SV4fZSf61mzJ28 5wxK6n6j3Q/qY4ZAkUPpU4OKWnb+iHJdVH6KI8qbP3+FcUGkqjTfMkUn0GuzPiGBTAIS bDAMl403lxG01R0gHHchdUd4jLAHnS5FCVzZYpZqH2rBM4cu9imQmVk4P2OZbFxpNQgU 7c/15CsfGrV/mYi5oJrC6eSS0mRNpT7jS+9YvQxzhrtR5gmJqff2B+ujQqiHlCyIyUTL Sx4wciuaqrGdSbB23visEr939gRg45ymaUfdcaQHIGF0TDaJBJ2WnQlc0CQlGFHlyXbG 5LdQ== X-Received: by 10.66.171.11 with SMTP id aq11mr33298160pac.24.1368510523774; Mon, 13 May 2013 22:48:43 -0700 (PDT) Received: from localhost.localdomain ([59.98.240.128]) by mx.google.com with ESMTPSA id ya4sm16758033pbb.24.2013.05.13.22.48.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 22:48:42 -0700 (PDT) From: Lad Prabhakar To: LMML , , Subject: [PATCH 4/4] media: pci: remove duplicate checks for EPERM Date: Tue, 14 May 2013 11:15:17 +0530 Message-ID: <1368510317-4356-5-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1368510317-4356-1-git-send-email-prabhakar.csengg@gmail.com> References: <1368510317-4356-1-git-send-email-prabhakar.csengg@gmail.com> CC: Scott Jiang , Andy Walls , Mauro Carvalho Chehab , Jonathan Corbet , Janne Grunau , DLOS , , Alexey Klimov , Antti Palosaari , Hans Verkuil , Laurent Pinchart , Martin Bugge , =?UTF-8?q?Jon=20Arne=20J=C3=B8rgensen?= , =?UTF-8?q?Frank=20Sch=C3=A4fer?= , Andy Shevchenko , Mike Isely , Guennadi Liakhovetski , Javier Martin , Devin Heitmueller X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar This patch removes check for EPERM in dbg_g/s_register and vidioc_g/s_register as this check is already performed by core. Signed-off-by: Lad, Prabhakar --- drivers/media/pci/bt8xx/bttv-driver.c | 6 ------ drivers/media/pci/cx18/cx18-av-core.c | 4 ---- drivers/media/pci/cx23885/cx23885-ioctl.c | 6 ------ drivers/media/pci/cx23885/cx23888-ir.c | 4 ---- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 -- drivers/media/pci/saa7146/mxb.c | 4 ---- drivers/media/pci/saa7164/saa7164-encoder.c | 6 ------ 7 files changed, 0 insertions(+), 32 deletions(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index e7d0884..a334c94 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -1936,9 +1936,6 @@ static int bttv_g_register(struct file *file, void *f, struct bttv_fh *fh = f; struct bttv *btv = fh->btv; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (!v4l2_chip_match_host(®->match)) { /* TODO: subdev errors should not be ignored, this should become a subdev helper function. */ @@ -1960,9 +1957,6 @@ static int bttv_s_register(struct file *file, void *f, struct bttv_fh *fh = f; struct bttv *btv = fh->btv; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (!v4l2_chip_match_host(®->match)) { /* TODO: subdev errors should not be ignored, this should become a subdev helper function. */ diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index 38b1d64..ba8caf0 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -1258,8 +1258,6 @@ static int cx18_av_g_register(struct v4l2_subdev *sd, return -EINVAL; if ((reg->reg & 0x3) != 0) return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; reg->size = 4; reg->val = cx18_av_read4(cx, reg->reg & 0x00000ffc); return 0; @@ -1274,8 +1272,6 @@ static int cx18_av_s_register(struct v4l2_subdev *sd, return -EINVAL; if ((reg->reg & 0x3) != 0) return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; cx18_av_write4(cx, reg->reg & 0x00000ffc, reg->val); return 0; } diff --git a/drivers/media/pci/cx23885/cx23885-ioctl.c b/drivers/media/pci/cx23885/cx23885-ioctl.c index acdb6d5..00f5125 100644 --- a/drivers/media/pci/cx23885/cx23885-ioctl.c +++ b/drivers/media/pci/cx23885/cx23885-ioctl.c @@ -138,9 +138,6 @@ int cx23885_g_register(struct file *file, void *fh, { struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (reg->match.type == V4L2_CHIP_MATCH_HOST) { switch (reg->match.addr) { case 0: @@ -186,9 +183,6 @@ int cx23885_s_register(struct file *file, void *fh, { struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (reg->match.type == V4L2_CHIP_MATCH_HOST) { switch (reg->match.addr) { case 0: diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c index fa672fe..cd98651 100644 --- a/drivers/media/pci/cx23885/cx23888-ir.c +++ b/drivers/media/pci/cx23885/cx23888-ir.c @@ -1116,8 +1116,6 @@ static int cx23888_ir_g_register(struct v4l2_subdev *sd, return -EINVAL; if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG) return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; reg->size = 4; reg->val = cx23888_ir_read4(state->dev, addr); return 0; @@ -1135,8 +1133,6 @@ static int cx23888_ir_s_register(struct v4l2_subdev *sd, return -EINVAL; if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG) return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; cx23888_ir_write4(state->dev, addr, reg->val); return 0; } diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 9cbbce0..3e281ec 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -715,8 +715,6 @@ static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val) { volatile u8 __iomem *reg_start; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; if (reg >= IVTV_REG_OFFSET && reg < IVTV_REG_OFFSET + IVTV_REG_SIZE) reg_start = itv->reg_mem - IVTV_REG_OFFSET; else if (itv->has_cx23415 && reg >= IVTV_DECODER_OFFSET && diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c index 71e8bea..52cbe7a0 100644 --- a/drivers/media/pci/saa7146/mxb.c +++ b/drivers/media/pci/saa7146/mxb.c @@ -669,8 +669,6 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist { struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; if (v4l2_chip_match_host(®->match)) { reg->val = saa7146_read(dev, reg->reg); reg->size = 4; @@ -684,8 +682,6 @@ static int vidioc_s_register(struct file *file, void *fh, const struct v4l2_dbg_ { struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; if (v4l2_chip_match_host(®->match)) { saa7146_write(dev, reg->reg, reg->val); return 0; diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c index 0b74fb2..63a72fb 100644 --- a/drivers/media/pci/saa7164/saa7164-encoder.c +++ b/drivers/media/pci/saa7164/saa7164-encoder.c @@ -1306,9 +1306,6 @@ static int saa7164_g_register(struct file *file, void *fh, struct saa7164_dev *dev = port->dev; dprintk(DBGLVL_ENC, "%s()\n", __func__); - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - return 0; } @@ -1319,9 +1316,6 @@ static int saa7164_s_register(struct file *file, void *fh, struct saa7164_dev *dev = port->dev; dprintk(DBGLVL_ENC, "%s()\n", __func__); - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - return 0; } #endif