From patchwork Sun Jun 25 12:32:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RGF2aWQgSMODwqRyZGVtYW4=?= X-Patchwork-Id: 9808145 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 A595B603F3 for ; Sun, 25 Jun 2017 12:32:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9692E201BD for ; Sun, 25 Jun 2017 12:32:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B603285E5; Sun, 25 Jun 2017 12:32:25 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 26563201BD for ; Sun, 25 Jun 2017 12:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751353AbdFYMcX (ORCPT ); Sun, 25 Jun 2017 08:32:23 -0400 Received: from vader.hardeman.nu ([95.142.160.32]:56439 "EHLO hardeman.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdFYMcW (ORCPT ); Sun, 25 Jun 2017 08:32:22 -0400 Received: from hardeman.nu (zeus.hardeman.nu [IPv6:fd27:2a41:8fcb:2::a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vader.hardeman.nu (Postfix) with ESMTPSA id 585D1B88; Sun, 25 Jun 2017 14:32:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hardeman.nu; s=hardeman-201705; t=1498393941; bh=iRmcM6KhM2Bx1gQIGr/vKabXu5GEUn9xPpGCkHaFZNg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=JiS5FyOGerUzfzSVNyicoGpKzg0C3QP118/gHoFbEt3a498CmaISVjWo5UneWLhlw +p2aT4A0vyLChEdDs+IJRkBVIeDwcnSPu91qnqlEUTsNla/i6jxE0CNw1ZFZKtuZd/ gNmkmRc5VpxELLqLC5FzCzix+ScUeETKe9PCRnXpZiBhsAU6/ArAzHR4xkjywY2FbY V9H/XMrhBBzzGiJDkJrbo8K9lUZBnqrCVqd0dYfvMm6OHb3CUsSTAXpxg/zLvT0Rui dp2pVTlp6fJGvSwXG7pvyOd2jBFti84m8TbDfrxvoE0R2ZPysUYY0vNX1Oev2+UGxR 1eAYwzzCszrVQ== Received: (nullmailer pid 29150 invoked by uid 1000); Sun, 25 Jun 2017 12:32:20 -0000 Subject: [PATCH 13/19] lirc_dev: remove the BUFLEN define From: David =?utf-8?b?SMOkcmRlbWFu?= To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, sean@mess.org Date: Sun, 25 Jun 2017 14:32:20 +0200 Message-ID: <149839394084.28811.5942756570190479247.stgit@zeus.hardeman.nu> In-Reply-To: <149839373103.28811.9486751698665303339.stgit@zeus.hardeman.nu> References: <149839373103.28811.9486751698665303339.stgit@zeus.hardeman.nu> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 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 The define is only used in the lirc_zilog driver and once in lirc_dev. In lirc_dev it rather serves to make the limits on d->code_length less clear, so move the define to lirc_zilog. Signed-off-by: David Härdeman --- drivers/media/rc/lirc_dev.c | 5 ++--- drivers/staging/media/lirc/lirc_zilog.c | 3 +++ include/media/lirc_dev.h | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index d107ed6b634b..80944c2f7e91 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -145,9 +145,8 @@ int lirc_register_device(struct lirc_dev *d) return -EINVAL; } - if (d->code_length < 1 || d->code_length > (BUFLEN * 8)) { - dev_err(d->dev, "code length must be less than %d bits\n", - BUFLEN * 8); + if (d->code_length < 1 || d->code_length > 128) { + dev_err(d->dev, "invalid code_length!\n"); return -EBADRQC; } diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index a8aefd033ad9..f54b66de4a27 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -64,6 +64,9 @@ /* Max transfer size done by I2C transfer functions */ #define MAX_XFER_SIZE 64 +/* LIRC buffer size */ +#define BUFLEN 16 + struct IR; struct IR_rx { diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index 3f8edabfef88..21aac9494678 100644 --- a/include/media/lirc_dev.h +++ b/include/media/lirc_dev.h @@ -9,8 +9,6 @@ #ifndef _LINUX_LIRC_DEV_H #define _LINUX_LIRC_DEV_H -#define BUFLEN 16 - #include #include #include