Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3605342imm; Mon, 4 Jun 2018 06:30:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwL7MyO3al37B4g069PHQrCAqC+aE5WjWGNNEhgg2aO+jHcMfQ0olyR0un3fT2tN++aPBv X-Received: by 2002:aa7:8311:: with SMTP id t17-v6mr21559323pfm.45.1528119031219; Mon, 04 Jun 2018 06:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528119031; cv=none; d=google.com; s=arc-20160816; b=Ukc350+MlVd7BLOOvOVJoLe2wKTu861/wY3xNsJXT1E71FS9droQwKqarcCzNXLyyT JbIawn9d7YiTUUtqDQmfyLCz3WPBbdv8spcrjlcAXBpYqKjO5Azd1Bav60UnYIXaPf+O oeWHGoAqSj+UklYvI1dUcLf/X5fCQoSH8F1wulh9e9rR4ObZmhfMm2rKZREFzvdlfrj6 xtPdpxXVF/mBWsxz1JfkkMScf2ZlzzfvXoT/mqLJnTdTfLnoj5QjZ01cTfCwDYOvnTsL nuGpsirxSY7Qb7u9F6vOc7+s1zAAuXtugdNR1MgUnXN76Q15K4wppupsC+prhjKakDGa srZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=j5krBXwTuDvehSpzHJ9Wa/y5XoGsB0dnsE0MvpLm1lM=; b=BxgzrH8pktyxOxbXUeNOyAh5QeL8+eitLM/RT1wYkjkc+hyyi/Eos5zw7ZdzsLKtNx ap1xbtt4exzlUovr/1TOYlfaJv49k5ypPMamjKgLA1bu0nU1iV4LA3kfPBy/x9chcAhQ bnyEBTON2Qqlv0FWhCbE3/bKYgoeAoh8PDs81ofMjVVmK1DdXKtDBTaDBkNRGRGCDHBC c52ZlhQQOC+l1+QfGzX111QHF2nOoP3A73EFUMx3AhyAUj0WfENzsjaPAchzwA2DjvoG x3XnTdM7qSWPv6DC5zH2o8YKDzBPtN5lHtodV5qe1VxXmS8kmoceX8mBs/CgApeJsf5o vVEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si27605858plg.230.2018.06.04.06.30.16; Mon, 04 Jun 2018 06:30:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753258AbeFDN2k (ORCPT + 99 others); Mon, 4 Jun 2018 09:28:40 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:51317 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbeFDN2j (ORCPT ); Mon, 4 Jun 2018 09:28:39 -0400 X-IronPort-AV: E=Sophos;i="5.49,476,1520924400"; d="scan'208";a="12718500" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Jun 2018 06:28:35 -0700 Received: from localhost (10.10.76.4) by chn-sv-exch03.mchp-main.com (10.10.76.49) with Microsoft SMTP Server id 14.3.352.0; Mon, 4 Jun 2018 06:28:34 -0700 Date: Mon, 4 Jun 2018 15:27:36 +0200 From: Ludovic Desroches To: Nicholas Mc Guire CC: Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , , , , Nicholas Mc Guire Subject: Re: [PATCH] media: atmel-isi: drop unnecessary while loop Message-ID: <20180604132736.zay3ae5we6d7adsk@rfolt0960.corp.atmel.com> Mail-Followup-To: Nicholas Mc Guire , Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire References: <1527857174-24616-1-git-send-email-hofrat@opentech.at> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1527857174-24616-1-git-send-email-hofrat@opentech.at> User-Agent: NeoMutt/20180512 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 12:46:14PM +0000, Nicholas Mc Guire wrote: > From: Nicholas Mc Guire > > As there is no way this can loop it actually makes no sense to have > a while(1){} around the body - all three possible paths end in a return > statement. > > Signed-off-by: Nicholas Mc Guire > Fixes: commit c1d82b895380 "[media] atmel-isi: move out of soc_camera to atmel" Acked-by: Ludovic Desroches Thanks. > --- > > The diff output is unfortunately not that readable - essentially only > the outer while(1){ } was removed. > > Patch was compile tested with: x86_64_defconfig + CONFIG_MEDIA_SUPPORT=y > MEDIA_CAMERA_SUPPORT=y, CONFIG_MEDIA_CONTROLLER=y, V4L_PLATFORM_DRIVERS=y > OF=y, CONFIG_COMPILE_TEST=y, CONFIG_VIDEO_ATMEL_ISI=y > > Compile testing atmel-isi.c shows some sparse warnings. Seems to be due to > sizeof operator being applied to a union (not related to the function being > changed though). > > Patch is against 4.17-rc7 (localversion-next is next-20180531) > > drivers/media/platform/atmel/atmel-isi.c | 28 +++++++++++++--------------- > 1 file changed, 13 insertions(+), 15 deletions(-) > > diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c > index e5be21a..85fc7b9 100644 > --- a/drivers/media/platform/atmel/atmel-isi.c > +++ b/drivers/media/platform/atmel/atmel-isi.c > @@ -1106,23 +1106,21 @@ static int isi_graph_parse(struct atmel_isi *isi, struct device_node *node) > struct device_node *ep = NULL; > struct device_node *remote; > > - while (1) { > - ep = of_graph_get_next_endpoint(node, ep); > - if (!ep) > - return -EINVAL; > - > - remote = of_graph_get_remote_port_parent(ep); > - if (!remote) { > - of_node_put(ep); > - return -EINVAL; > - } > + ep = of_graph_get_next_endpoint(node, ep); > + if (!ep) > + return -EINVAL; > > - /* Remote node to connect */ > - isi->entity.node = remote; > - isi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE; > - isi->entity.asd.match.fwnode = of_fwnode_handle(remote); > - return 0; > + remote = of_graph_get_remote_port_parent(ep); > + if (!remote) { > + of_node_put(ep); > + return -EINVAL; > } > + > + /* Remote node to connect */ > + isi->entity.node = remote; > + isi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE; > + isi->entity.asd.match.fwnode = of_fwnode_handle(remote); > + return 0; > } > > static int isi_graph_init(struct atmel_isi *isi) > -- > 2.1.4 >