public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "hare@suse.de" <hare@suse.de>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "hch@lst.de" <hch@lst.de>,
	"james.bottomley@hansenpartnership.com"
	<james.bottomley@hansenpartnership.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"hare@suse.com" <hare@suse.com>,
	"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>
Subject: Re: [PATCHv3 2/5] scsi: Export blacklist flags to sysfs
Date: Tue, 15 Aug 2017 22:47:05 +0000	[thread overview]
Message-ID: <1502837223.2259.15.camel@wdc.com> (raw)
In-Reply-To: <dd9d797a-ec8e-7395-6d7c-068c4ece08d0@suse.de>

On Tue, 2017-08-15 at 10:03 +0200, Hannes Reinecke wrote:
> On 08/15/2017 05:18 AM, Martin K. Petersen wrote:
> > 
> > Hannes,
> > 
> > > +		name = sdev_bflags_name(bflags);
> > > +		if (name)
> > > +			blen = snprintf(ptr, strlen(name) + 1,
> > > +					"%s", name);
> > > +		else
> > > +			blen = snprintf(ptr, 67, "0x%X", bflags);
> > 
> > It seems this else statement facilitates papering over the fact that
> > scsi_sysfs.c and scsi_devinfo.h can get out of sync.
> > 
> 
> But there is no good way of avoiding that, is there?

Hello Hannes,

How about running the following shell code from a makefile, storing the
result in a file and #including that file from drivers/scsi/scsi_sysfs.c?

sed -n 's/^#define BLIST_\([^[:blank:]]*\).*/\t{ BLIST_\1, "\1" },/p' include/scsi/scsi_devinfo.h

Bart.

  reply	other threads:[~2017-08-15 22:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11 14:23 [PATCHv3 0/5] Hi all, Hannes Reinecke
2017-08-11 14:23 ` [PATCHv3 1/5] scsi_debug: allow to specify inquiry vendor and model Hannes Reinecke
2017-08-15 22:41   ` Bart Van Assche
2017-08-11 14:23 ` [PATCHv3 2/5] scsi: Export blacklist flags to sysfs Hannes Reinecke
2017-08-15  3:18   ` Martin K. Petersen
2017-08-15  8:03     ` Hannes Reinecke
2017-08-15 22:47       ` Bart Van Assche [this message]
2017-08-16  5:56         ` Hannes Reinecke
2017-08-17  0:10           ` Martin K. Petersen
2017-08-16  2:09       ` Martin K. Petersen
2017-08-15 14:24   ` Bart Van Assche
2017-08-15 14:40     ` Hannes Reinecke
2017-08-16  2:03       ` Martin K. Petersen
2017-08-11 14:23 ` [PATCHv3 3/5] scsi_devinfo: Reformat blacklist flags Hannes Reinecke
2017-08-15 22:52   ` Bart Van Assche
2017-08-16  5:56     ` Hannes Reinecke
2017-08-11 14:23 ` [PATCHv3 4/5] scsi: whitespace fixes in scsi_devinfo.c Hannes Reinecke
2017-08-11 14:23 ` [PATCHv3 5/5] scsi_devinfo: fixup string compare Hannes Reinecke
2017-08-11 15:08   ` Alan Stern
2017-08-15 23:03   ` Bart Van Assche
2017-08-16  5:57     ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502837223.2259.15.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=hare@suse.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox