Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a89dd8f authored by Felix Beck's avatar Felix Beck Committed by Heiko Carstens
Browse files

[S390] Cleanup zcrypt printk messages.

parent 26348f78
Loading
Loading
Loading
Loading
+5 −19
Original line number Diff line number Diff line
@@ -1068,10 +1068,8 @@ static int zcrypt_status_write(struct file *file, const char __user *buffer,

#define LBUFSIZE 1200UL
	lbuf = kmalloc(LBUFSIZE, GFP_KERNEL);
	if (!lbuf) {
		PRINTK("kmalloc failed!\n");
	if (!lbuf)
		return 0;
	}

	local_count = min(LBUFSIZE - 1, count);
	if (copy_from_user(lbuf, buffer, local_count) != 0) {
@@ -1081,23 +1079,15 @@ static int zcrypt_status_write(struct file *file, const char __user *buffer,
	lbuf[local_count] = '\0';

	ptr = strstr(lbuf, "Online devices");
	if (!ptr) {
		PRINTK("Unable to parse data (missing \"Online devices\")\n");
	if (!ptr)
		goto out;
	}
	ptr = strstr(ptr, "\n");
	if (!ptr) {
		PRINTK("Unable to parse data (missing newline "
		       "after \"Online devices\")\n");
	if (!ptr)
		goto out;
	}
	ptr++;

	if (strstr(ptr, "Waiting work element counts") == NULL) {
		PRINTK("Unable to parse data (missing "
		       "\"Waiting work element counts\")\n");
	if (strstr(ptr, "Waiting work element counts") == NULL)
		goto out;
	}

	for (j = 0; j < 64 && *ptr; ptr++) {
		/*
@@ -1197,16 +1187,12 @@ int __init zcrypt_api_init(void)

	/* Register the request sprayer. */
	rc = misc_register(&zcrypt_misc_device);
	if (rc < 0) {
		PRINTKW(KERN_ERR "misc_register (minor %d) failed with %d\n",
			zcrypt_misc_device.minor, rc);
	if (rc < 0)
		goto out;
	}

	/* Set up the proc file system */
	zcrypt_entry = create_proc_entry("driver/z90crypt", 0644, NULL);
	if (!zcrypt_entry) {
		PRINTK("Couldn't create z90crypt proc entry\n");
		rc = -ENOMEM;
		goto out_misc;
	}
+0 −28
Original line number Diff line number Diff line
@@ -30,34 +30,6 @@
#ifndef _ZCRYPT_API_H_
#define _ZCRYPT_API_H_

/**
 * Macro definitions
 *
 * PDEBUG debugs in the form "zcrypt: function_name -> message"
 *
 * PRINTK is like PDEBUG, except that it is always enabled
 * PRINTKN is like PRINTK, except that it does not include the function name
 * PRINTKW is like PRINTK, except that it uses KERN_WARNING
 * PRINTKC is like PRINTK, except that it uses KERN_CRIT
 */
#define DEV_NAME	"zcrypt"

#define PRINTK(fmt, args...) \
	printk(KERN_DEBUG DEV_NAME ": %s -> " fmt, __func__ , ## args)
#define PRINTKN(fmt, args...) \
	printk(KERN_DEBUG DEV_NAME ": " fmt, ## args)
#define PRINTKW(fmt, args...) \
	printk(KERN_WARNING DEV_NAME ": %s -> " fmt, __func__ , ## args)
#define PRINTKC(fmt, args...) \
	printk(KERN_CRIT DEV_NAME ": %s -> " fmt, __func__ , ## args)

#ifdef ZCRYPT_DEBUG
#define PDEBUG(fmt, args...) \
	printk(KERN_DEBUG DEV_NAME ": %s -> " fmt, __func__ , ## args)
#else
#define PDEBUG(fmt, args...) do {} while (0)
#endif

#include "ap_bus.h"
#include <asm/zcrypt.h>

+0 −3
Original line number Diff line number Diff line
@@ -243,9 +243,6 @@ static int convert_response(struct zcrypt_device *zdev,
		return convert_type80(zdev, reply,
				      outputdata, outputdatalength);
	default: /* Unknown response type, this should NEVER EVER happen */
		PRINTK("Unrecognized Message Header: %08x%08x\n",
		       *(unsigned int *) reply->message,
		       *(unsigned int *) (reply->message+4));
		zdev->online = 0;
		return -EAGAIN;	/* repeat the request on a different device. */
	}
+0 −6
Original line number Diff line number Diff line
@@ -92,10 +92,6 @@ static inline int convert_error(struct zcrypt_device *zdev,
{
	struct error_hdr *ehdr = reply->message;

	PRINTK("Hardware error : Type %02x Message Header: %08x%08x\n",
	       ehdr->type, *(unsigned int *) reply->message,
	       *(unsigned int *) (reply->message + 4));

	switch (ehdr->reply_code) {
	case REP82_ERROR_OPERAND_INVALID:
	case REP82_ERROR_OPERAND_SIZE:
@@ -123,8 +119,6 @@ static inline int convert_error(struct zcrypt_device *zdev,
		zdev->online = 0;
		return -EAGAIN;
	default:
		PRINTKW("unknown type %02x reply code = %d\n",
			ehdr->type, ehdr->reply_code);
		zdev->online = 0;
		return -EAGAIN;	/* repeat the request on a different device. */
	}
+0 −3
Original line number Diff line number Diff line
@@ -226,9 +226,6 @@ static int convert_response(struct zcrypt_device *zdev,
		return convert_type84(zdev, reply,
				      outputdata, outputdatalength);
	default: /* Unknown response type, this should NEVER EVER happen */
		PRINTK("Unrecognized Message Header: %08x%08x\n",
		       *(unsigned int *) reply->message,
		       *(unsigned int *) (reply->message+4));
		zdev->online = 0;
		return -EAGAIN;	/* repeat the request on a different device. */
	}
Loading