From owner-freebsd-current@FreeBSD.ORG Tue Jan 15 23:40:35 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0459E7BF; Tue, 15 Jan 2013 23:40:35 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by mx1.freebsd.org (Postfix) with ESMTP id 6C168308; Tue, 15 Jan 2013 23:40:33 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id n10so277809eaa.30 for ; Tue, 15 Jan 2013 15:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ucUXDLZwritb6V087Pvq6OzwM4WzBT+eGNcJA+uGTWU=; b=aT0pRbqg1cRWdiNuT6np1IqXICiZJ2WzeyyQU78i4p85eZoIKLhssUJw66FSCqpuuE XVkIoitf+C92NYWEK5fTZDb0nHuQ2AlkC7xxbXevyosYs7mZH4iy8SoyQyIh1COtODiS g8qno9PnwY83QBpxla4rcX8KXJdETFoRaLsJH2bu1j3D4AfvqTLF3p0cFEIhn/0XPVIT 4FOBPFbaHdLeHNNIs+g70oXrLZj5he3/wuchb7e4UWXuT6bdzCh+m1hYBaoJMD1Y4nyz CDzUeG0emELkUMT0+9frgRqRmvE7XyK8NF0LGbovwKlGD09tebyNIBKufWICne/0AW/l 2tcw== MIME-Version: 1.0 Received: by 10.14.2.66 with SMTP id 42mr246699507eee.7.1358293233055; Tue, 15 Jan 2013 15:40:33 -0800 (PST) Received: by 10.14.221.132 with HTTP; Tue, 15 Jan 2013 15:40:32 -0800 (PST) In-Reply-To: <20130115232216.GE1410@funkthat.com> References: <20130115231047.GD1410@funkthat.com> <20130115232216.GE1410@funkthat.com> Date: Tue, 15 Jan 2013 15:40:32 -0800 Message-ID: Subject: Re: Clang warning patches From: hiren panchasara To: hiren panchasara , freebsd-current , sbruno@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2013 23:40:35 -0000 On Tue, Jan 15, 2013 at 3:22 PM, John-Mark Gurney wrote: > John-Mark Gurney wrote this message on Tue, Jan 15, 2013 at 15:10 -0800: >> hiren panchasara wrote this message on Tue, Jan 15, 2013 at 07:52 -0800: >> > http://www.strugglingcoder.info/patches/clang_warnings_dev_bktr.txt >> >> This patch does not look correct at all... It is simply removing code.. >> >> How is is good that after we failed to set the tv_freq that we continue >> on? >> >> What is the warning that we are fixing here? > > I forgot to look at the intermediate variable that tv_channel was being > assigned to... Turns out it's an unsigned int, while tv_channel is > returning an int... We should fix this properly by changing temp to > be an int, or moving the check inline instead of removing it blindly... I agree. My bad. I should have looked at it a little more carefully. Turning temp to "int" looks fine. All function returns being assigned to temp are int. > > I think I still have an old bktr card that I can throw in to do some > basic testing... I will update the patch in a bit. I do not have the hardware but let me know if I can help you in testing. Thanks, Hiren > > After doing some code sperlunking, looks like this bug was introduced > w/ the original driver 15 years ago... And no one noticed even after > moving the code around a few times... > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not."