4242 * and <dustin.kirkland@us.ibm.com> for LSPP certification compliance.
4343 */
4444
45+ #define pr_fmt (fmt ) KBUILD_MODNAME ": " fmt
46+
4547#include <linux/init.h>
4648#include <asm/types.h>
4749#include <linux/atomic.h>
@@ -850,16 +852,15 @@ static inline void audit_free_names(struct audit_context *context)
850852 if (context -> put_count + context -> ino_count != context -> name_count ) {
851853 int i = 0 ;
852854
853- printk (KERN_ERR "%s:%d(:%d): major=%d in_syscall=%d"
854- " name_count=%d put_count=%d"
855- " ino_count=%d [NOT freeing]\n" ,
856- __FILE__ , __LINE__ ,
855+ pr_err ("%s:%d(:%d): major=%d in_syscall=%d"
856+ " name_count=%d put_count=%d ino_count=%d"
857+ " [NOT freeing]\n" , __FILE__ , __LINE__ ,
857858 context -> serial , context -> major , context -> in_syscall ,
858859 context -> name_count , context -> put_count ,
859860 context -> ino_count );
860861 list_for_each_entry (n , & context -> names_list , list ) {
861- printk ( KERN_ERR "names[%d] = %p = %s\n" , i ++ ,
862- n -> name , n -> name -> name ?: "(null)" );
862+ pr_err ( "names[%d] = %p = %s\n" , i ++ , n -> name ,
863+ n -> name -> name ?: "(null)" );
863864 }
864865 dump_stack ();
865866 return ;
@@ -1550,7 +1551,7 @@ static inline void handle_one(const struct inode *inode)
15501551 if (likely (put_tree_ref (context , chunk )))
15511552 return ;
15521553 if (unlikely (!grow_tree_refs (context ))) {
1553- printk ( KERN_WARNING "out of memory, audit has lost a tree reference\n" );
1554+ pr_warn ( "out of memory, audit has lost a tree reference\n" );
15541555 audit_set_auditable (context );
15551556 audit_put_chunk (chunk );
15561557 unroll_tree_refs (context , p , count );
@@ -1609,8 +1610,7 @@ static void handle_path(const struct dentry *dentry)
16091610 goto retry ;
16101611 }
16111612 /* too bad */
1612- printk (KERN_WARNING
1613- "out of memory, audit has lost a tree reference\n" );
1613+ pr_warn ("out of memory, audit has lost a tree reference\n" );
16141614 unroll_tree_refs (context , p , count );
16151615 audit_set_auditable (context );
16161616 return ;
@@ -1682,7 +1682,7 @@ void __audit_getname(struct filename *name)
16821682
16831683 if (!context -> in_syscall ) {
16841684#if AUDIT_DEBUG == 2
1685- printk ( KERN_ERR "%s:%d(:%d): ignoring getname(%p)\n" ,
1685+ pr_err ( "%s:%d(:%d): ignoring getname(%p)\n" ,
16861686 __FILE__ , __LINE__ , context -> serial , name );
16871687 dump_stack ();
16881688#endif
@@ -1721,15 +1721,15 @@ void audit_putname(struct filename *name)
17211721 BUG_ON (!context );
17221722 if (!context -> in_syscall ) {
17231723#if AUDIT_DEBUG == 2
1724- printk ( KERN_ERR "%s:%d(:%d): final_putname(%p)\n" ,
1724+ pr_err ( "%s:%d(:%d): final_putname(%p)\n" ,
17251725 __FILE__ , __LINE__ , context -> serial , name );
17261726 if (context -> name_count ) {
17271727 struct audit_names * n ;
17281728 int i = 0 ;
17291729
17301730 list_for_each_entry (n , & context -> names_list , list )
1731- printk ( KERN_ERR "name[%d] = %p = %s\n" , i ++ ,
1732- n -> name , n -> name -> name ?: "(null)" );
1731+ pr_err ( "name[%d] = %p = %s\n" , i ++ , n -> name ,
1732+ n -> name -> name ?: "(null)" );
17331733 }
17341734#endif
17351735 final_putname (name );
@@ -1738,9 +1738,8 @@ void audit_putname(struct filename *name)
17381738 else {
17391739 ++ context -> put_count ;
17401740 if (context -> put_count > context -> name_count ) {
1741- printk (KERN_ERR "%s:%d(:%d): major=%d"
1742- " in_syscall=%d putname(%p) name_count=%d"
1743- " put_count=%d\n" ,
1741+ pr_err ("%s:%d(:%d): major=%d in_syscall=%d putname(%p)"
1742+ " name_count=%d put_count=%d\n" ,
17441743 __FILE__ , __LINE__ ,
17451744 context -> serial , context -> major ,
17461745 context -> in_syscall , name -> name ,
0 commit comments