Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1638997 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-05-10 20:10 +0200 |
| Last post | 2017-05-11 00:40 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] S390-DASD: Fine-tuning for some function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-10 20:10 +0200
[PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-10 20:10 +0200
Re: [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() Dan Carpenter <dan.carpenter@oracle.com> - 2017-05-10 21:40 +0200
Re: [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() kbuild test robot <lkp@intel.com> - 2017-05-11 00:40 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-10 20:10 +0200 |
| Subject | [PATCH 0/3] S390-DASD: Fine-tuning for some function implementations |
| Message-ID | <tFEdH-40t-15@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 10 May 2017 19:43:21 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (3): Adjust buffer output in dasd_hosts_print() Fix typos in two comment lines Adjust six checks for null pointers drivers/s390/block/dasd_eckd.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) -- 2.12.3
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-10 20:10 +0200 |
| Subject | [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() |
| Message-ID | <tFEdI-40t-23@gated-at.bofh.it> |
| In reply to | #1638997 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 May 2017 18:52:28 +0200
* Use a special format string specification for the desired output of the
array "pgid" into a sequence.
This issue was detected by using the Coccinelle software.
* Delete the local variable "j" and a call of the function "seq_puts"
wich became unnecessary with this refactoring.
Fixes: 5a3b7b112884f80ff19b18028fabeb4f9c035518 ("s390/dasd: add query host access to volume support")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/s390/block/dasd_eckd.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 122456e4db89..b3709d3cba54 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -5288,7 +5288,7 @@ static int dasd_hosts_print(struct dasd_device *device, struct seq_file *m)
struct dasd_ckd_path_group_entry *entry;
struct dasd_ckd_host_information *info;
char sysplex[9] = "";
- int rc, i, j;
+ int rc, i;
access = kzalloc(sizeof(*access), GFP_NOIO);
if (!access) {
@@ -5308,10 +5308,8 @@ static int dasd_hosts_print(struct dasd_device *device, struct seq_file *m)
entry = (struct dasd_ckd_path_group_entry *)
(info->entry + i * info->entry_size);
/* PGID */
- seq_puts(m, "pgid ");
- for (j = 0; j < 11; j++)
- seq_printf(m, "%02x", entry->pgid[j]);
- seq_putc(m, '\n');
+ seq_printf(m, "pgid %*phN\n",
+ ARRAY_SIZE(entry->pgid), entry->pgid);
/* FLAGS */
seq_printf(m, "status_flags %02x\n", entry->status_flags);
/* SYSPLEX NAME */
--
2.12.3
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2017-05-10 21:40 +0200 |
| Subject | Re: [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() |
| Message-ID | <tFFCO-4HE-21@gated-at.bofh.it> |
| In reply to | #1639000 |
On Wed, May 10, 2017 at 08:01:17PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 10 May 2017 18:52:28 +0200
>
> * Use a special format string specification for the desired output of the
> array "pgid" into a sequence.
>
> This issue was detected by using the Coccinelle software.
>
> * Delete the local variable "j" and a call of the function "seq_puts"
> wich became unnecessary with this refactoring.
>
> Fixes: 5a3b7b112884f80ff19b18028fabeb4f9c035518 ("s390/dasd: add query host access to volume support")
Stop using the fixes tag when you are not fixing bugs.
regards,
dan carpenter
[toc] | [prev] | [next] | [standalone]
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2017-05-11 00:40 +0200 |
| Subject | Re: [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() |
| Message-ID | <tFIqZ-6rQ-5@gated-at.bofh.it> |
| In reply to | #1639000 |
[Multipart message — attachments visible in raw view] — view raw
Hi Markus,
[auto build test WARNING on s390/features]
[also build test WARNING on v4.11 next-20170510]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/SF-Markus-Elfring/S390-DASD-Fine-tuning-for-some-function-implementations/20170511-022121
base: https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
config: s390-default_defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=s390
All warnings (new ones prefixed by >>):
drivers/s390/block/dasd_eckd.c: In function 'dasd_hosts_print':
>> drivers/s390/block/dasd_eckd.c:5311:24: warning: field width specifier '*' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat=]
seq_printf(m, "pgid %*phN\n",
^
vim +5311 drivers/s390/block/dasd_eckd.c
5295 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s",
5296 "Could not allocate access buffer");
5297 return -ENOMEM;
5298 }
5299 rc = dasd_eckd_query_host_access(device, access);
5300 if (rc) {
5301 kfree(access);
5302 return rc;
5303 }
5304
5305 info = (struct dasd_ckd_host_information *)
5306 access->host_access_information;
5307 for (i = 0; i < info->entry_count; i++) {
5308 entry = (struct dasd_ckd_path_group_entry *)
5309 (info->entry + i * info->entry_size);
5310 /* PGID */
> 5311 seq_printf(m, "pgid %*phN\n",
5312 ARRAY_SIZE(entry->pgid), entry->pgid);
5313 /* FLAGS */
5314 seq_printf(m, "status_flags %02x\n", entry->status_flags);
5315 /* SYSPLEX NAME */
5316 memcpy(&sysplex, &entry->sysplex_name, sizeof(sysplex) - 1);
5317 EBCASC(sysplex, sizeof(sysplex));
5318 seq_printf(m, "sysplex_name %8s\n", sysplex);
5319 /* SUPPORTED CYLINDER */
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web