Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp672192imm; Fri, 27 Jul 2018 04:11:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpciyQqsD9yBkUl2dcbDU9ndAWf7zxdmjcDK0o9v+MKf5d8IuY+WObwnqhgpY1cdCgsE/O0f X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr5609991plk.323.1532689907085; Fri, 27 Jul 2018 04:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532689907; cv=none; d=google.com; s=arc-20160816; b=mDuP38/xSsAT+7xKSgcZpZJQHvZVCT1wdD5gRXc5fLIw35ioQSRzvIdYD2VC2Yeb8t uhSppRQW4SbP5THousGzxYqbmUXt6mKvO+IxwYXevC4PR7iEC3vz9J/XBZa/FwGaVJNz EXGGlljP63hrMD4oTbVIN+moRdtGqvyTcAlD9/vQvi4OcIVPctZrCg6S3QPAWlU8aNBW Yqwx0JqXgal4jvGTQJLS3ShAl/bqg+MTDDPPBx6IhWlfKA5nui/s9f/ajqzbxuB3m23J PPLH1JMBNjCicbPr3kJbBlPzcfN+xIb9nvA3vKR1wNXquzUgJcZDcdhQujjAMh4Rps24 b1Tg== 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:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Ljp7fKycJrZk6kOxEolSO4EHnp1SMXr3FGi/yhWeF8k=; b=KZoOMYh8I5MjErKo03iP4BNSgaxV8wfYdqzhqRQ+AVzygt+FXLWnsie1sUSxEo8JKp 8fzrZetVQP5eeXCbp0aQaIsRkepJYtz2LlF7njLP0z0hvUuSzB+EjX35mmme7hzmWhqx RLodz3hcEoECdtLn0cfMfsa5pib4t4yUA2XmDR/9ludvARfooFp0sC3CpaR7nSo35Bgd kwc8nB4HyGcfTI1y11mM/MH5HsVKVeQuaTskkBrZarqvk4D2kn9VzWgEfIxqrgTEpCim s+0aunWfpTQjdKHi7Fx1QQg5RSmtPyR1SHByE/+t7eE7FouYuplaWVAYfSFWhnB+rJKM 3A7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dJiknFHR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9-v6si3355659pgk.384.2018.07.27.04.11.32; Fri, 27 Jul 2018 04:11:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dJiknFHR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731134AbeG0McF (ORCPT + 99 others); Fri, 27 Jul 2018 08:32:05 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:36986 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730613AbeG0McF (ORCPT ); Fri, 27 Jul 2018 08:32:05 -0400 Received: by mail-lf1-f68.google.com with SMTP id j8-v6so3271590lfb.4; Fri, 27 Jul 2018 04:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ljp7fKycJrZk6kOxEolSO4EHnp1SMXr3FGi/yhWeF8k=; b=dJiknFHRlnjf6sgcZTFUpD7sN5GKZp4B2IcubkzUgCl2VePrwl1QR7pda1e6/OZA+2 wHWzH4ul6wxX2CYVaBVwzMw9m1G+kblOTi61S24oVKewmfMEP7fGpLeyOGWCcO0HPw8z /QcnuIlLSupvcIEIDg8rpkpN79c0DJKuS/UgVsldF8ba9KQSzPygn12SbY9h0sEpDzVc +X2E1JXtIQ9horcpnJL9jFoTzDq0x/2ir8aEfSXuy3AGHQIy6IYslNij2FyUgB/UX5+s +me3UEZPH/YUcYi70uDIxRq3DbaXR8iDmt15nk5pl5tUkt6fknGmpQPvkpYGCA/+cI4H 2AxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ljp7fKycJrZk6kOxEolSO4EHnp1SMXr3FGi/yhWeF8k=; b=ufxKP8tbpU/keRvSWJi2G/rzXReNn/JIPCt7aAy0oc/CGtpNYxd9WYwc7KGR/KRyEm TXGF8PYDzeUP7ThpXfvEC6xiMdMg7elxh2lAAjFab0vA9NTWzuCEIvHtmDLmORdJm46m i7Wz4eZXoTUl5yh2aB/pHgvR1zGOcm/AIzj5DtdxCOSFr2UUrSvm9Hulxm2KQtpoGo8j f8NMWuf3cP7G3bdWwZuXgNHBtvbN5PsQLv8IVNZHDQiWLGPPmvfeorlApY1jfYcv8o7z iSj2/QNfeNPSQdJXFiflT8TTl7qnWnasJmCmnYIT7vg8pgBVF/IkGEwwvEpxqHwHz48X 5nlw== X-Gm-Message-State: AOUpUlEB7eZbNLZ+VHDZlYbGhfHR49trm0D1Rt34BHSU74e8kTTnZl/F z0yQyi7tKa5IPMeI/Kvuez4y/R4U X-Received: by 2002:a19:4895:: with SMTP id v143-v6mr3618002lfa.82.1532689836901; Fri, 27 Jul 2018 04:10:36 -0700 (PDT) Received: from localhost.localdomain ([188.162.65.128]) by smtp.gmail.com with ESMTPSA id m29-v6sm501329lfj.45.2018.07.27.04.10.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 04:10:35 -0700 (PDT) Date: Fri, 27 Jul 2018 14:10:34 +0300 From: Ivan Bornyakov To: Mauro Carvalho Chehab Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: stv090x: fix if-else order Message-ID: <20180727111034.f42dhlwijthxfp3n@localhost.localdomain> References: <20180601161221.24807-1-brnkv.i1@gmail.com> <20180726162607.2de43b84@coco.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180726162607.2de43b84@coco.lan> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 04:26:07PM -0300, Mauro Carvalho Chehab wrote: > Em Fri, 1 Jun 2018 19:12:21 +0300 > Ivan Bornyakov escreveu: > > > There is this code: > > > > if (v >= 0x20) { > > ... > > } else if (v < 0x20) { > > ... > > } else if (v > 0x30) { > > /* this branch is impossible */ > > } > > > > It would be sensibly for last branch to be on the top. > > Have you tested it and check at the datasheets if dev_ver > 0x30 makes > sense? > > If not, I would prefer, instead, to remove the dead code, as this > patch may cause regressions (adding a FIXME comment about this > special case). > Hi, Mauro! Actually, I did not test it, because I did not have the hardware. But, in the other places of the code, the same if cases are used. Here are a couple examples: static int stv090x_dvbs_track_crl(struct stv090x_state *state) { if (state->internal->dev_ver >= 0x30) { ... } else { ... } ... } static u32 stv090x_srate_srch_coarse(struct stv090x_state *state) { ... if (state->internal->dev_ver >= 0x30) { ... } else if (state->internal->dev_ver >= 0x20) { ... } ... }