From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934876Ab3BTT36 (ORCPT ); Wed, 20 Feb 2013 14:29:58 -0500 Received: from casper.infradead.org ([85.118.1.10]:43330 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933536Ab3BTT34 (ORCPT ); Wed, 20 Feb 2013 14:29:56 -0500 Message-ID: <51252454.1050609@infradead.org> Date: Wed, 20 Feb 2013 11:30:28 -0800 From: Randy Dunlap User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: Mimi Zohar CC: Stephen Rothwell , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Mimi Zohar , axboe@kernel.dk Subject: [PATCH -next] security/integrity/ima: make part_pack_uuid() always visible References: <20130219170309.efb90173fcd879bf32a7e89b@canb.auug.org.au> <512418A5.9010006@infradead.org> <1361379050.29360.12.camel@falcor1> In-Reply-To: <1361379050.29360.12.camel@falcor1> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/20/13 08:50, Mimi Zohar wrote: > On Tue, 2013-02-19 at 16:28 -0800, Randy Dunlap wrote: >> On 02/18/13 22:03, Stephen Rothwell wrote: >>> Hi all, >>> >>> Changes since 20130218: >>> >> >> on x86_64: >> >> CC security/integrity/ima/ima_policy.o >> security/integrity/ima/ima_policy.c: In function 'ima_parse_rule': >> security/integrity/ima/ima_policy.c:538:4: error: implicit declaration of function 'part_pack_uuid' [-Werror=implicit-function-declaration] >> cc1: some warnings being treated as errors >> make[4]: *** [security/integrity/ima/ima_policy.o] Error 1 >> >> >> Full randconfig file is attached. > > part_pack_uuid() is only defined for CONFIG_BLOCK in > include/linux/genhd.h. One solution would be to add a stub function > definition in include/linux/genhd.h, the other option would be to ifndef > CONFIG_BLOCK in C code. ITYM #ifdef CONFIG_BLOCK to call part_pack_uuid(). Yes, either of those would work. How about a third option -- just make part_pack_uuid() always visible and not just a stub? Patch is below. --- From: Randy Dunlap Fix build error when CONFIG_BLOCK is not enabled by making the static inline function part_pack_uuid() visible independent of CONFIG_BLOCK's setting. security/integrity/ima/ima_policy.c:538:4: error: implicit declaration of function 'part_pack_uuid' [-Werror=implicit-function-declaration] Signed-off-by: Randy Dunlap Cc: Mimi Zohar --- include/linux/genhd.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) --- linux-next-20130220.orig/include/linux/genhd.h +++ linux-next-20130220/include/linux/genhd.h @@ -213,24 +213,6 @@ static inline struct gendisk *part_to_di return NULL; } -static inline void part_pack_uuid(const u8 *uuid_str, u8 *to) -{ - int i; - for (i = 0; i < 16; ++i) { - *to++ = (hex_to_bin(*uuid_str) << 4) | - (hex_to_bin(*(uuid_str + 1))); - uuid_str += 2; - switch (i) { - case 3: - case 5: - case 7: - case 9: - uuid_str++; - continue; - } - } -} - static inline int disk_max_parts(struct gendisk *disk) { if (disk->flags & GENHD_FL_EXT_DEVT) @@ -720,4 +702,22 @@ static inline dev_t blk_lookup_devt(cons #endif /* CONFIG_BLOCK */ +static inline void part_pack_uuid(const u8 *uuid_str, u8 *to) +{ + int i; + for (i = 0; i < 16; ++i) { + *to++ = (hex_to_bin(*uuid_str) << 4) | + (hex_to_bin(*(uuid_str + 1))); + uuid_str += 2; + switch (i) { + case 3: + case 5: + case 7: + case 9: + uuid_str++; + continue; + } + } +} + #endif /* _LINUX_GENHD_H */