From patchwork Wed Dec 30 12:24:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7932971 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0CEAA9F32E for ; Wed, 30 Dec 2015 12:25:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A33C202C8 for ; Wed, 30 Dec 2015 12:25:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D943202A1 for ; Wed, 30 Dec 2015 12:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754764AbbL3MZA (ORCPT ); Wed, 30 Dec 2015 07:25:00 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37519 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754749AbbL3MY1 (ORCPT ); Wed, 30 Dec 2015 07:24:27 -0500 Received: by mail-wm0-f51.google.com with SMTP id f206so75936471wmf.0 for ; Wed, 30 Dec 2015 04:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=7myKj4vP0hiDP0JMf3lpT2NQ9A0J40c4YsAV+k5amrI=; b=LuuEvDWOXc92oiPPNodDleqLHJuObHgjcLgWwiS+FfqPuxWjaeEiNNRM6ZI0Bef/VT ZZDA4nMB1iOi47BK75/pYrFMt0Q+bdlovlz2TFZH+qQ8yiL03qSsjdvxmEd2bCmTl58K UNW+7PU18OnjGfY2VuvY9UHxRM90oAE7fBs59XPtBTAfRXJIQqKi28oO0NmgdDhRbTeJ lxFhDfcRGY+eBwXIy9OtxyoUTq2wUNKqNXxP6yZ9LckGH+0N2z0oyL+6ZYxAgggNXU2Z B0/bYXZBietd0so5T7ZWQnzMxVO6AZU8Cezsb2nn5cGiwm0VuUJHGrOWZt7z5RYI6vWt bO0w== X-Received: by 10.28.128.22 with SMTP id b22mr28510099wmd.44.1451478266245; Wed, 30 Dec 2015 04:24:26 -0800 (PST) Received: from ?IPv6:2003:62:5f55:ba00:68ea:9bc3:2b4a:64cf? (p200300625F55BA0068EA9BC32B4A64CF.dip0.t-ipconnect.de. [2003:62:5f55:ba00:68ea:9bc3:2b4a:64cf]) by smtp.googlemail.com with ESMTPSA id pn6sm65269499wjb.15.2015.12.30.04.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Dec 2015 04:24:25 -0800 (PST) From: Heiner Kallweit Subject: [PATCH] media: rc: core: simplify DEFINE_IR_RAW_EVENT To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Message-ID: <5683CCEF.5030306@gmail.com> Date: Wed, 30 Dec 2015 13:24:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 DEFINE_IR_RAW_EVENT can be simplified and doesn't provide much benefit as all elements are initialized to 0. But keep it as it is used in a lot of places. duration is the first element of the embedded union and therefore used for the initialization even if not explicitely mentioned. Signed-off-by: Heiner Kallweit --- include/media/rc-core.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/media/rc-core.h b/include/media/rc-core.h index f649470..91c6633 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -226,13 +226,7 @@ struct ir_raw_event { unsigned carrier_report:1; }; -#define DEFINE_IR_RAW_EVENT(event) \ - struct ir_raw_event event = { \ - { .duration = 0 } , \ - .pulse = 0, \ - .reset = 0, \ - .timeout = 0, \ - .carrier_report = 0 } +#define DEFINE_IR_RAW_EVENT(event) struct ir_raw_event event = {} static inline void init_ir_raw_event(struct ir_raw_event *ev) { @@ -254,8 +248,7 @@ void ir_raw_event_set_idle(struct rc_dev *dev, bool idle); static inline void ir_raw_event_reset(struct rc_dev *dev) { - DEFINE_IR_RAW_EVENT(ev); - ev.reset = true; + struct ir_raw_event ev = { .reset = true }; ir_raw_event_store(dev, &ev); ir_raw_event_handle(dev);