Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5250037imm; Tue, 12 Jun 2018 05:09:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKhPKMALSF36k/3Rel0qkXREMYNSvt7F7tfQsfE7RPZnOPDE0/uVozPgPTAEJQmAfGoUfna X-Received: by 2002:a17:902:1029:: with SMTP id b38-v6mr88255pla.277.1528805372730; Tue, 12 Jun 2018 05:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528805372; cv=none; d=google.com; s=arc-20160816; b=cD63SPdkEhV95ocjaCbF3M77H9QtiWWzzhleCX3r6+3LL1G3uq+CVQC/DszghwZY0G +YDwIH5gPFEpu5CMTH7RfIcv8FC68Vor5mGj9SfhzxqyT0D4hGAZFa2vtOAVhYEKJEGI Js8IT1nLEy2b9x6fwgAPxMBkmqxZ2cgTk/y3DpEWmDzVTScV3JCc6KI6CGvfEaNqF4dv wG6Q4e9nIWW4eICB+rpekLhYWfpy821a/ZFSU6XLPc3D0g6HqS0qYgYZG2jkRZplum25 V2pXMaw3E8U3pgYblKv2d/4+ez2SueE0mAY0Pd6CNZSNmR7YNNEV8gqpB6FuEkGnzeMH nHgw== 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:message-id:from :content-transfer-encoding:mime-version:date:references:subject:cc :to:arc-authentication-results; bh=BAwwY+7+4c9Sz6kCxg1O08IMDNs0cCotZfKgZ+kPNQw=; b=ZnSpA9YS3GetO0KvlsusXNdgRZo1hCQbFpuAZuIF0Lel3cOIXkA6r4qagdpksrA59J IODlQ+RQv0qZo27YBmJye5ogrJjLNGCVyGDbXVR6Il23UvucX0vahPrSMl8viOHkpWbe G9YsdppYZgq7kZ8dJAkZuoOnATnjT4IxF8Nm1FWfWuQf/3Wx3zQS5ix5iYwSlOn7V03z 0M701wQtVanjGUu21sApn7uRpaS5kstAeMbL8FQrxanA55EVotW4cbcjER/6UpVtSGzg UG4IdMelSbgSGU5SjFhLuW2ckIUiuIpfG1dw+weQHHu60KK1X+Fj7Wte377rZ7rN7Yid qkwA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si1825ple.192.2018.06.12.05.09.18; Tue, 12 Jun 2018 05:09:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932807AbeFLMIw (ORCPT + 99 others); Tue, 12 Jun 2018 08:08:52 -0400 Received: from mga07.intel.com ([134.134.136.100]:41804 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754250AbeFLMIv (ORCPT ); Tue, 12 Jun 2018 08:08:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2018 05:08:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,214,1526367600"; d="scan'208";a="46505056" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga007.fm.intel.com with ESMTP; 12 Jun 2018 05:08:48 -0700 Received: from mwajdecz-mobl1.ger.corp.intel.com (mwajdecz-mobl1.ger.corp.intel.com [172.28.174.165]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w5CC8l1M028135; Tue, 12 Jun 2018 13:08:47 +0100 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Jani Nikula" , "Joonas Lahtinen" , "Rodrigo Vivi" , "David Airlie" , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, "Colin King" Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Intel-gfx] [PATCH][V3] drm/i915/guc: fix GEM_BUG_ON check References: <20180612093804.11341-1-colin.king@canonical.com> Date: Tue, 12 Jun 2018 14:08:43 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Michal Wajdeczko" Message-ID: In-Reply-To: <20180612093804.11341-1-colin.king@canonical.com> User-Agent: Opera Mail/1.0 (Win32) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Jun 2018 11:38:04 +0200, Colin King wrote: > From: Colin Ian King > > The check for level being less than zero always false because flags > is currently unsigned and can never be negative. Fix this by making > level a s32. > > Detected by CoverityScan, CID#1468363 ("Macro compares unsigned to 0") > > Fixes: cb5d64e9f13e ("drm/i915/guc: Allow user to control default GuC > logging") > Signed-off-by: Colin Ian King > > --- > V3: Make level s32 and add the missing Fixes: tag, thanks to Dan > Carpenter and > Jani Nikula for correcting my mistakes > > --- > drivers/gpu/drm/i915/intel_guc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_guc.c > b/drivers/gpu/drm/i915/intel_guc.c > index 116f4ccf1bbd..bdb1fab322bf 100644 > --- a/drivers/gpu/drm/i915/intel_guc.c > +++ b/drivers/gpu/drm/i915/intel_guc.c > @@ -205,7 +205,7 @@ void intel_guc_fini(struct intel_guc *guc) > static u32 get_log_control_flags(void) > { > - u32 level = i915_modparams.guc_log_level; > + s32 level = i915_modparams.guc_log_level; s/s32 level/int level to match modparam type as already suggested by others > u32 flags = 0; > GEM_BUG_ON(level < 0); please note that this BUG_ON will go away with pending [1] so maybe we can just merge series [2] instead ? Thanks, Michal [1] https://patchwork.freedesktop.org/patch/227365/ [2] https://patchwork.freedesktop.org/series/44201/