From patchwork Wed Feb 7 09:03:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 771115 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 922EF208C4 for ; Wed, 7 Feb 2024 09:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707296613; cv=none; b=ujiJJ8bB7orI70f8Sz2B5yaveR2vmDDU8TsaFZml6ADW56RT2n8v5mHFtm7oYvu6Ystg9dqXkIxp1/6zwwAhFGAfFeXPXi3Ms+rRVaaXtl7iqPyxiZh3MsQ5sgTwCnTlRdeIRSmH09lTEMIIAZs63J+hnL9FohossHuDyx3kRiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707296613; c=relaxed/simple; bh=5ocwE3L3BkIQod8W8Tsq5AaUNBaZOsOi9ugz97IO29A=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=pvpbhqQ9iJ1BIvNV9ZerFrp8QdkknYETzCmBUb2pANyagjbFtqipjaFspZ7B41sajmCZi1uCYcfWNmdF91u8Wet1UXs+1hZUmWc6vT1LQbNfHmSeegGphl+bxYVE8+JPSI0w9zJNlwhsEDQIUafFYDzKGzc+xGUIUByp+0q7zCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B90E7C433C7 for ; Wed, 7 Feb 2024 09:03:32 +0000 (UTC) Message-ID: <1ad05817-1f75-4492-9814-937cef20c6f7@xs4all.nl> Date: Wed, 7 Feb 2024 10:03:30 +0100 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US, nl To: Linux Media Mailing List From: Hans Verkuil Subject: [PATCH] media: core: v4l2-ioctl.c: use is_valid_ioctl() In most cases the is_valid_ioctl() macro is used to check if an ioctl is valid, except in one place. Use it there as well as it makes the code easier to read. Signed-off-by: Hans Verkuil diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index a172d33edd19..6ce443dafd97 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -3052,7 +3052,7 @@ static long __video_do_ioctl(struct file *file, if (v4l2_is_known_ioctl(cmd)) { info = &v4l2_ioctls[_IOC_NR(cmd)]; - if (!test_bit(_IOC_NR(cmd), vfd->valid_ioctls) && + if (!is_valid_ioctl(vfd, cmd) && !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler)) goto done;