[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1365690315.1929.8.camel@joe-AO722>
Date: Thu, 11 Apr 2013 07:25:15 -0700
From: Joe Perches <joe@...ches.com>
To: Bjørn Mork <bjorn@...k.no>
Cc: Dave Jones <davej@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Whitcroft <apw@...dowen.org>,
LKML <linux-kernel@...r.kernel.org>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [PATCH] checkpatch: Warn on comparisons to true and false
On Thu, 2013-04-11 at 13:56 +0200, Bjørn Mork wrote:
> I felt I had to share this little gem
> which showed up in drivers/gpu/drm/exynos/exynos_drm_vidi.c:
>
> static int vidi_power_on(struct vidi_context *ctx, bool enable)
> {
> struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
> struct device *dev = subdrv->dev;
>
> DRM_DEBUG_KMS("%s\n", __FILE__);
>
> if (enable != false && enable != true)
> return -EINVAL;
> ..
> That's taking failsafe to the next step :)
Cute. It's a relatively new driver too so I'd guess
the "int -> bool conversion leftover" defense isn't
too likely.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists