From patchwork Mon Mar 22 15:53:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12155209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5684FC433ED for ; Mon, 22 Mar 2021 15:53:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4178A6192E for ; Mon, 22 Mar 2021 15:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231376AbhCVPx2 (ORCPT ); Mon, 22 Mar 2021 11:53:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:49076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhCVPxQ (ORCPT ); Mon, 22 Mar 2021 11:53:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFB93619AD; Mon, 22 Mar 2021 15:53:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616428394; bh=VZ6mpIEVz/dYilkRg2l19PXHpiyaBPX/Ce0HWBs7Zwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I/zFRrZEZRZojLWcfZI5UhPw5GkYeL2P09Bq4fnQKiQME9XMzpR3ZVsyFA800/awi IMSfr34jZaCeyYarutOqUv60jaCY0j6TOUmlDq5BZjnFHTVrX+pY7dWyQDZyGz1E5W 3aeVe8U2x6aENhnuDkyFUc3VXP5ZnrfiM4l9auF+dGx3XBEFfvOyphLKE402tuCri5 0CdjyoRhhp9MsRzULtZ+PaKXixMOqRh5EWUGFkM5cH75jGOR7ci2NG2RSZCmsb9tvJ A8jRgp8J8redtN0vMhA0ZGuAyWuZ9CZduNux9iNlsE2JzuAoQ+C3hhose1G0ZgBAQd BaLMnXE1DBfDQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lOMs1-0002Zn-1s; Mon, 22 Mar 2021 16:53:33 +0100 From: Johan Hovold To: Oliver Neukum , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 6/8] USB: cdc-acm: use negation for NULL checks Date: Mon, 22 Mar 2021 16:53:16 +0100 Message-Id: <20210322155318.9837-7-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210322155318.9837-1-johan@kernel.org> References: <20210322155318.9837-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Use negation consistently throughout the driver for NULL checks. Acked-by: Oliver Neukum Signed-off-by: Johan Hovold --- drivers/usb/class/cdc-acm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index e3c45f5880fc..6991ffd66c5d 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1323,7 +1323,7 @@ static int acm_probe(struct usb_interface *intf, dev_dbg(&intf->dev, "interfaces are valid\n"); acm = kzalloc(sizeof(struct acm), GFP_KERNEL); - if (acm == NULL) + if (!acm) return -ENOMEM; tty_port_init(&acm->port); @@ -1416,7 +1416,7 @@ static int acm_probe(struct usb_interface *intf, struct acm_wb *snd = &(acm->wb[i]); snd->urb = usb_alloc_urb(0, GFP_KERNEL); - if (snd->urb == NULL) + if (!snd->urb) goto err_free_write_urbs; if (usb_endpoint_xfer_int(epwrite))