From patchwork Fri Jul 24 10:21:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 6859231 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 20E0FC05AC for ; Fri, 24 Jul 2015 10:22:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 517B92053C for ; Fri, 24 Jul 2015 10:22:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F1FB20458 for ; Fri, 24 Jul 2015 10:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753084AbbGXKWy (ORCPT ); Fri, 24 Jul 2015 06:22:54 -0400 Received: from lb2-smtp-cloud3.xs4all.net ([194.109.24.26]:49571 "EHLO lb2-smtp-cloud3.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbbGXKWy (ORCPT ); Fri, 24 Jul 2015 06:22:54 -0400 Received: from tschai.lan ([80.203.20.209]) by smtp-cloud3.xs4all.net with ESMTP id wANq1q00B4Wfp8Y01ANtKV; Fri, 24 Jul 2015 12:22:53 +0200 Received: from tschai.fritz.box (localhost [127.0.0.1]) by tschai.lan (Postfix) with ESMTPSA id 6EDB72A160C; Fri, 24 Jul 2015 12:21:37 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: sakari.ailus@linux.intel.com, Hans Verkuil Subject: [RFC PATCH 1/7] v4l2-fh: change int to bool for v4l2_fh_is_singular(_file) Date: Fri, 24 Jul 2015 12:21:30 +0200 Message-Id: <1437733296-38198-2-git-send-email-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437733296-38198-1-git-send-email-hverkuil@xs4all.nl> References: <1437733296-38198-1-git-send-email-hverkuil@xs4all.nl> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Hans Verkuil This function really returns a bool, so use that as the return type instead of int. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fh.c | 6 +++--- include/media/v4l2-fh.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c index c97067a..20c0a0c 100644 --- a/drivers/media/v4l2-core/v4l2-fh.c +++ b/drivers/media/v4l2-core/v4l2-fh.c @@ -110,13 +110,13 @@ int v4l2_fh_release(struct file *filp) } EXPORT_SYMBOL_GPL(v4l2_fh_release); -int v4l2_fh_is_singular(struct v4l2_fh *fh) +bool v4l2_fh_is_singular(struct v4l2_fh *fh) { unsigned long flags; - int is_singular; + bool is_singular; if (fh == NULL || fh->vdev == NULL) - return 0; + return false; spin_lock_irqsave(&fh->vdev->fh_lock, flags); is_singular = list_is_singular(&fh->list); spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 8035167..13dcaae 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -91,15 +91,15 @@ void v4l2_fh_exit(struct v4l2_fh *fh); */ int v4l2_fh_release(struct file *filp); /* - * Returns 1 if this filehandle is the only filehandle opened for the - * associated video_device. If fh is NULL, then it returns 0. + * Returns true if this filehandle is the only filehandle opened for the + * associated video_device. If fh is NULL, then it returns false. */ -int v4l2_fh_is_singular(struct v4l2_fh *fh); +bool v4l2_fh_is_singular(struct v4l2_fh *fh); /* * Helper function with struct file as argument. If filp->private_data is - * NULL, then it will return 0. + * NULL, then it will return false. */ -static inline int v4l2_fh_is_singular_file(struct file *filp) +static inline bool v4l2_fh_is_singular_file(struct file *filp) { return v4l2_fh_is_singular(filp->private_data); }