Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1537383yba; Thu, 4 Apr 2019 12:49:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4A7BELoCvkSuBn/R4lQnMlASu6OTeMjntM7dSY5umrdejFd4lrTQtPKQlkucUc3E5I16x X-Received: by 2002:a17:902:b713:: with SMTP id d19mr8484801pls.54.1554407352720; Thu, 04 Apr 2019 12:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554407352; cv=none; d=google.com; s=arc-20160816; b=yJ77dURiQ7E8qGK2fZW3sNx2B0KLekCdv6ndQ+WMNrgm1wRgPoxONO6ynoB2KsqFbQ 2OcIWxrViAfU1pmyPfUZG04soSEnUbgoRaqlbrmtwiotRE/UqMvhGg6+z+f0qDyqR0+9 4hzHFEAMft9ImCtjIXWVYVGMSzUNqppCUShrzL19GpLc9r3fYYJwV50S/Qh1QV5UJJeQ OfGlBCf+ZQVKXgmYyGKgD+mBUImHOzloNKfk4YnkTwphSNWoRueH3OIVxWDcEj99XNYT HWDfvqZ/F+aCm1BotUZm/EuD+5A9AEru/uwgMGlFE60TAYlBCgW5sqfc6mpDjS3NDN9r 5w4w== 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; bh=ntIjsouJDNv+5vqlB69rQop5KzmF3z5S/TdTLt9deaU=; b=txsPH85IAuIVgvUEeYQ7fqftQVRDSk3oK/4r4oIrjHTPVp9+LcwdIXxSNt0r2DTnG3 OKsloTbzGQk65UszSpapPhE0a6BHKnaCns7mPLd+s6Y9PgSxwyY1MJ5bBM7bxmsJ7JJW +/HXh2wyBnXbCkXV5F3XOPAwEmmXzNLJnSYbR2rbW6kqwStcHtOLVCNV3+Qc9vlJO0V4 wU3NPXFriuXSavNd3bHGUigfHSPVkZOTv9BqqqINSlTA1eIByGowrgviZ8e6MeqKSKLw LzZFNxcEqw/8qUFqUe0PkIr+sn2PQnkp4AUjEotHem1r+14cDjG/WOD0GfgCSpL7yzKY Dh/g== 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 o82si6986110pfi.114.2019.04.04.12.48.57; Thu, 04 Apr 2019 12:49:12 -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 S1730483AbfDDTrf (ORCPT + 99 others); Thu, 4 Apr 2019 15:47:35 -0400 Received: from gofer.mess.org ([88.97.38.141]:51055 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729714AbfDDTrf (ORCPT ); Thu, 4 Apr 2019 15:47:35 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 1AA0360366; Thu, 4 Apr 2019 20:47:33 +0100 (BST) Date: Thu, 4 Apr 2019 20:47:33 +0100 From: Sean Young To: Kangjie Lu Cc: pakki001@umn.edu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: stv090x: add missed checks for STV090x_WRITE_DEMOD Message-ID: <20190404194733.pt7w5qyfs2blq6k3@gofer.mess.org> References: <20190323024614.14883-1-kjlu@umn.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190323024614.14883-1-kjlu@umn.edu> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 22, 2019 at 09:46:13PM -0500, Kangjie Lu wrote: > Conservatively check return value of STV090x_WRITE_DEMOD in case > it fails. This can introduce regressions. It is very possible that the return value was not checked for a reason. So, this has to be tested on hardware. Sean > > Signed-off-by: Kangjie Lu > --- > drivers/media/dvb-frontends/stv090x.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c > index a0622bb71803..3e2af3969e16 100644 > --- a/drivers/media/dvb-frontends/stv090x.c > +++ b/drivers/media/dvb-frontends/stv090x.c > @@ -1446,14 +1446,17 @@ static int stv090x_start_search(struct stv090x_state *state) > /* >= Cut 3 */ > if (state->srate <= 5000000) { > /* enlarge the timing bandwidth for Low SR */ > - STV090x_WRITE_DEMOD(state, RTCS2, 0x68); > + if (STV090x_WRITE_DEMOD(state, RTCS2, 0x68) < 0) > + goto err; > } else { > /* reduce timing bandwidth for high SR */ > - STV090x_WRITE_DEMOD(state, RTCS2, 0x44); > + if (STV090x_WRITE_DEMOD(state, RTCS2, 0x44) < 0) > + goto err; > } > > /* Set CFR min and max to manual mode */ > - STV090x_WRITE_DEMOD(state, CARCFG, 0x46); > + if (STV090x_WRITE_DEMOD(state, CARCFG, 0x46) < 0) > + goto err; > > if (state->algo == STV090x_WARM_SEARCH) { > /* WARM Start > @@ -2604,7 +2607,8 @@ static enum stv090x_signal_state stv090x_get_sig_params(struct stv090x_state *st > > if (state->algo == STV090x_BLIND_SEARCH) { > tmg = STV090x_READ_DEMOD(state, TMGREG2); > - STV090x_WRITE_DEMOD(state, SFRSTEP, 0x5c); > + if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x5c) < 0) > + goto err; > while ((i <= 50) && (tmg != 0) && (tmg != 0xff)) { > tmg = STV090x_READ_DEMOD(state, TMGREG2); > msleep(5); > @@ -2910,7 +2914,9 @@ static int stv090x_optimize_track(struct stv090x_state *state) > pilots = STV090x_GETFIELD_Px(reg, DEMOD_TYPE_FIELD) & 0x01; > aclc = stv090x_optimize_carloop(state, modcod, pilots); > if (modcod <= STV090x_QPSK_910) { > - STV090x_WRITE_DEMOD(state, ACLC2S2Q, aclc); > + if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, aclc) > + < 0) > + goto err; > } else if (modcod <= STV090x_8PSK_910) { > if (STV090x_WRITE_DEMOD(state, ACLC2S2Q, 0x2a) < 0) > goto err; > @@ -2972,7 +2978,8 @@ static int stv090x_optimize_track(struct stv090x_state *state) > reg = STV090x_READ_DEMOD(state, TMGOBS); > > if (state->algo == STV090x_BLIND_SEARCH) { > - STV090x_WRITE_DEMOD(state, SFRSTEP, 0x00); > + if (STV090x_WRITE_DEMOD(state, SFRSTEP, 0x00) < 0) > + goto err; > reg = STV090x_READ_DEMOD(state, DMDCFGMD); > STV090x_SETFIELD_Px(reg, SCAN_ENABLE_FIELD, 0x00); > STV090x_SETFIELD_Px(reg, CFR_AUTOSCAN_FIELD, 0x00); > -- > 2.17.1