From patchwork Mon Jul 9 08:36:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10514035 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 55347603D7 for ; Mon, 9 Jul 2018 08:42:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41116288E5 for ; Mon, 9 Jul 2018 08:42:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34BAA28A5C; Mon, 9 Jul 2018 08:42:33 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D451C288E5 for ; Mon, 9 Jul 2018 08:42:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932677AbeGIIly (ORCPT ); Mon, 9 Jul 2018 04:41:54 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:46101 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754579AbeGIIhL (ORCPT ); Mon, 9 Jul 2018 04:37:11 -0400 Received: by mail-ed1-f66.google.com with SMTP id r17-v6so13262048edo.13 for ; Mon, 09 Jul 2018 01:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ECSxS/Tu1J8yJoeTNndRt3Ju+K1/adxa0HpIrDBgnIk=; b=Ujzvu4GOI7K6XVEjopEXycGdZ9LWKakpFhS/zA0CPD15VmKmAeRsUFb4aUkqG6ANNu jJ/xqNqHvQQYhUD5ytsfjzRpbCm0DggwDlTLJWgAxUstiFixoLWxOaKoH+1ZnjKWcmQc vq7Q6iAOH+1y9XfDBcIksZUkh/fg17DGudKiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ECSxS/Tu1J8yJoeTNndRt3Ju+K1/adxa0HpIrDBgnIk=; b=d7o2MoM/ipi9HF40Gj2JaOG/aM79u8i5jaG7oTZStS8Z7+2Ei25njQay2+ooV5Yqt6 RNM/U3xmsj7JfPdqpIIRaawb8YDcWj6xUg3I3hztjY7uFNxAuFmV67BToMQOFRdxivrJ Qp4nZPRIeEUSAtlbcVzigGOO8IVrak5sPGG3bMCJhK4OsgUAxzmR7q909U/4WAyeV2jB VAUptZNNM4+Ihn7giD3NZvSitUQmCHYBHZsn6eBZZsVLvMkDHPF/pQPkh04dPu0aYYY3 q4g/DCbooqPYXYUcRvfwunPPVbgB0Zb1ETOxBR3Pk5yb7yvLLDMZ3XgamM+wl+ewfb7e PQPw== X-Gm-Message-State: APt69E3W3w8fI6SFdTssKtHXlsTh2N4ATEgVE+omMqSK3O/9j3+HJ6wl qophMI9WnCpywI7P+FknnArttg== X-Google-Smtp-Source: AAOMgpfW2YyXQXz+DkEXJ3K+MK75A2gCWsR9Atbs2ObyPxL+jus6EmNmlXfd/mes5dn2XfU7YaXHBQ== X-Received: by 2002:a50:8e09:: with SMTP id 9-v6mr81843edw.101.1531125430737; Mon, 09 Jul 2018 01:37:10 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5628:0:496f:7dc5:66d7:a057]) by smtp.gmail.com with ESMTPSA id 8-v6sm340067edv.77.2018.07.09.01.37.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 01:37:10 -0700 (PDT) From: Daniel Vetter To: LKML Cc: DRI Development , Intel Graphics Development , Daniel Vetter , Daniel Vetter , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 12/12] usb: use for_each_if Date: Mon, 9 Jul 2018 10:36:50 +0200 Message-Id: <20180709083650.23549-12-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180709083650.23549-1-daniel.vetter@ffwll.ch> References: <20180709083650.23549-1-daniel.vetter@ffwll.ch> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoids the inverted condition compared to the open-coded version. Signed-off-by: Daniel Vetter Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org --- include/linux/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/usb.h b/include/linux/usb.h index 4cdd515a4385..a9da7237c619 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -732,7 +732,7 @@ extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ port1 <= hdev->maxchild; \ child = usb_hub_find_child(hdev, ++port1)) \ - if (!child) continue; else + for_each_if (child) /* USB device locking */ #define usb_lock_device(udev) device_lock(&(udev)->dev)