From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [resend][PATCH] fs: use kernel's hex_to_bin() method Date: Wed, 05 Jan 2011 09:54:58 +0000 Message-ID: <28315.1294221298@redhat.com> References: <20110104152100.29d0da02.akpm@linux-foundation.org> <1291978505-29076-1-git-send-email-andy.shevchenko@gmail.com> Cc: dhowells@redhat.com, Andy Shevchenko , linux-kernel@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, Mimi Zohar , "Serge E. Hallyn" , James Morris To: Andrew Morton Return-path: Received: from mx1.redhat.com ([209.132.183.28]:26280 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648Ab1AEJzJ (ORCPT ); Wed, 5 Jan 2011 04:55:09 -0500 In-Reply-To: <20110104152100.29d0da02.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Andrew Morton wrote: > Not a terribly convenient convenience, as most callers will need to cast > away the constness of the return value. Oh well, those callers should > have been using a `const char *' anyway. Maybe. You could always do as strchr(): char *strchr(const char *s, int c); Then you don't need to cast the result. The problem[*] is that you can't tell the compiler that the return value should carry the same constness as one of the arguments because you don't have something like C++ templates. [*] If indeed not having C++ or templates should be seen as a problem... David