From patchwork Sat Sep 23 19:46:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9967627 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 7AE15602D8 for ; Sat, 23 Sep 2017 19:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 657202915A for ; Sat, 23 Sep 2017 19:47:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58EB329169; Sat, 23 Sep 2017 19:47:29 +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=-6.9 required=2.0 tests=BAYES_00,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 DD74F2915A for ; Sat, 23 Sep 2017 19:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751495AbdIWTqz (ORCPT ); Sat, 23 Sep 2017 15:46:55 -0400 Received: from mout.web.de ([212.227.15.14]:53568 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030AbdIWTqy (ORCPT ); Sat, 23 Sep 2017 15:46:54 -0400 Received: from [192.168.1.2] ([77.181.226.196]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M2us2-1d3Kcp0wOE-00scwI; Sat, 23 Sep 2017 21:46:49 +0200 Subject: [PATCH 3/3] [media] camss-csid: Adjust a null pointer check in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Todor Tomov Cc: LKML , kernel-janitors@vger.kernel.org References: <168ff884-7ace-c548-7f90-d4f2910bb337@users.sourceforge.net> Message-ID: Date: Sat, 23 Sep 2017 21:46:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <168ff884-7ace-c548-7f90-d4f2910bb337@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:CUVmsDSD9VjcIowvgBb+tVN87U1FmmYugwGtVcBXcOQ0jh3cLbF aKQ36PcG7ietFznBzZR59i9QWse9TWwIJkJ8Hij1PKUweGUCUFKYM6cPEoUe0ik+LA1RJ3T K1ntnPIfr/ROoeh8ljyn80EB6sdn6gJtn+Ntb/ZYGUiiU2rKmEQorcTFxCT8LIKtqcO+bQd NvPhUBFWgRhfxR/guXTxQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:mvWyUPkxQwc=:789bD9teWiG8Nslu0sqymX 5X5SYZ37iAqR/v9E4zRFdsk1FJdmfwcJ+y2mt+bFd7snUaHCRCWYyTjs9QuMzpPRG9V0mTjKm QVgJcnU116U84xFj4jus1th3XTSjgKQxH3Wz4mTfa0R4vcMsD5e8X9Gl1EqE0S2jdWV8FQr9u jjD/68pSOnHS2Sbb+DGxNnT1CsyFYGvUQKzxR63C/+K5b2hyyxvAfkQvqIG8ScgFH2oXoiBOd JwwFKsYPrRW6e0h+6PcNROr9hive5bon4IRw0WxQjqOAxGAxGrmOXdeh3Hxv98pvw6OWXTeqb a0p8qTzOii59PzcCiCF/I+oHpGXFGT/ZEdaCLVzgdkGPgEYs+yfMMhpPFcd2BlaV8SHVYVAsu Wjm58isuvDPTSfMpwKKlKEmSaoMw7BeMdfahEIzVHQXdgwmJy0Tsm4ad7QH4WtYg4KLjQu725 I1ZU2rOppyaiE1jJdRAy1QKUwEdpoVK3eEMtcH6rwJc713i49+6muBvSBwltbLTI5XRZvBqBG JsgaK/gbzo+xKDgCur/Mdwse2JIot5ZG6LlpUa3mL1yMgqbjumx80WmkrxCKCAefPiRzjYqzq tJGMqGaLcXPqxjdC21o1pLYckvwvoDc4LjzMaU8Pzu/vcQFe6zxsPmvHASUrCBlhrstQvdBUH i2X1Qy5QjorUGrqalUNwp5IBSHJPMSb9ofGiSn36UR590Q5A0HoRvPzs/Noz5+ocEOlTqetji /iVWTkKomWuzcY7GUoDTjy5OUUzMJjQM5nTyttPLHMxjnJ5cKtbnugQiAXaE8kv3/+F0kUfDg HBtN34fkIBZRb9qS/y5P3USW2hVyt9KTvfqBx2x2TDU5QJUUTg= 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 From: Markus Elfring Date: Sat, 23 Sep 2017 21:10:02 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written "!format" Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/platform/qcom/camss-8x16/camss-csid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c b/drivers/media/platform/qcom/camss-8x16/camss-csid.c index ffda0fbfe4d8..e546f97fa68c 100644 --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c @@ -653,4 +653,4 @@ static int csid_get_format(struct v4l2_subdev *sd, - if (format == NULL) + if (!format) return -EINVAL; fmt->format = *format; @@ -677,4 +677,4 @@ static int csid_set_format(struct v4l2_subdev *sd, - if (format == NULL) + if (!format) return -EINVAL; csid_try_format(csid, cfg, fmt->pad, &fmt->format, fmt->which);