lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1515258237.21222.45.camel@perches.com>
Date:   Sat, 06 Jan 2018 09:03:57 -0800
From:   Joe Perches <joe@...ches.com>
To:     George Edward Bulmer <gebulmer@...glemail.com>,
        gregkh@...uxfoundation.org
Cc:     gilad@...yossef.com, linux-crypto@...r.kernel.org,
        driverdev-devel@...uxdriverproject.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: ccree: shorten lengthy lines with breaks

On Sat, 2018-01-06 at 15:47 +0000, George Edward Bulmer wrote:
> This fixes five instances of checkpatch warning:
> WARNING: line over 80 characters
[]
> diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c
[]
> @@ -32,15 +32,26 @@ static ssize_t ssi_sys_regdump_show(struct kobject *kobj,
>  	int offset = 0;
>  
>  	register_value = cc_ioread(drvdata, CC_REG(HOST_SIGNATURE));
> -	offset += scnprintf(buf + offset, PAGE_SIZE - offset, "%s \t(0x%lX)\t 0x%08X\n", "HOST_SIGNATURE       ", DX_HOST_SIGNATURE_REG_OFFSET, register_value);
> +	offset += scnprintf(buf + offset, PAGE_SIZE - offset,
> +			    "%s \t(0x%lX)\t 0x%08X\n", "HOST_SIGNATURE       ",

trivia:

Using %-21s would do the same as padding the format
string argument and would create smaller object code.

	offset += scnprintf(buf + offset, PAGE_SIZE - offset,
			    "%-21s \t(0x%lX)\t 0x%08X\n", "HOST_SIGNATURE",

Using an extra space before a tab is odd.

Using a space after a tab is odd too.

> +			    DX_HOST_SIGNATURE_REG_OFFSET, register_value);
>  	register_value = cc_ioread(drvdata, CC_REG(HOST_IRR));
> -	offset += scnprintf(buf + offset, PAGE_SIZE - offset, "%s \t(0x%lX)\t 0x%08X\n", "HOST_IRR             ", DX_HOST_IRR_REG_OFFSET, register_value);
> +	offset += scnprintf(buf + offset, PAGE_SIZE - offset,
> +			    "%s \t(0x%lX)\t 0x%08X\n", "HOST_IRR             ",

etc...

> +			    DX_HOST_IRR_REG_OFFSET, register_value);
>  	register_value = cc_ioread(drvdata, CC_REG(HOST_POWER_DOWN_EN));
> -	offset += scnprintf(buf + offset, PAGE_SIZE - offset, "%s \t(0x%lX)\t 0x%08X\n", "HOST_POWER_DOWN_EN   ", DX_HOST_POWER_DOWN_EN_REG_OFFSET, register_value);
> +	offset += scnprintf(buf + offset, PAGE_SIZE - offset,
> +			    "%s \t(0x%lX)\t 0x%08X\n", "HOST_POWER_DOWN_EN   ",
> +			    DX_HOST_POWER_DOWN_EN_REG_OFFSET, register_value);
>  	register_value =  cc_ioread(drvdata, CC_REG(AXIM_MON_ERR));
> -	offset += scnprintf(buf + offset, PAGE_SIZE - offset, "%s \t(0x%lX)\t 0x%08X\n", "AXIM_MON_ERR         ", DX_AXIM_MON_ERR_REG_OFFSET, register_value);
> +	offset += scnprintf(buf + offset, PAGE_SIZE - offset,
> +			    "%s \t(0x%lX)\t 0x%08X\n", "AXIM_MON_ERR         ",
> +			    DX_AXIM_MON_ERR_REG_OFFSET, register_value);
>  	register_value = cc_ioread(drvdata, CC_REG(DSCRPTR_QUEUE_CONTENT));
> -	offset += scnprintf(buf + offset, PAGE_SIZE - offset, "%s \t(0x%lX)\t 0x%08X\n", "DSCRPTR_QUEUE_CONTENT", DX_DSCRPTR_QUEUE_CONTENT_REG_OFFSET, register_value);
> +	offset += scnprintf(buf + offset, PAGE_SIZE - offset,
> +			    "%s \t(0x%lX)\t 0x%08X\n", "DSCRPTR_QUEUE_CONTENT",
> +			    DX_DSCRPTR_QUEUE_CONTENT_REG_OFFSET,
> +			    register_value);
>  	return offset;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ