Re: [PATCH 0/3] SCSI device blacklist handling improvements
Bart, > Are you perhaps referring to the five __force casts? If so, do you > have a suggestion for avoiding that sparse reports false positive > warnings on the conversions between int and blist_flags_t? The only > approach I can think of to reduce the number of __force casts is to > embed these __force casts into two helper functions - one for the > conversion from int to blist_flags_t and one for the conversion the > other way around. blist_flags_t is an unsigned int, you are forcing it to u32 two places. That's a problem waiting to happen next time we add a blacklist flag. -- Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 0/3] SCSI device blacklist handling improvements
On Wed, 2017-12-06 at 21:03 -0500, Martin K. Petersen wrote: > > These three patches is what I came up with after having reviewed > > recent changes in the code for handling blacklist flags > > handling. Please consider these patches for kernel v4.16. > > I applied 1 and 3 to 4.16/scsi-queue. I am still not a fan of forcing > u32. That's a recipe for disaster when we add the next flag. Hello Martin, Are you perhaps referring to the five __force casts? If so, do you have a suggestion for avoiding that sparse reports false positive warnings on the conversions between int and blist_flags_t? The only approach I can think of to reduce the number of __force casts is to embed these __force casts into two helper functions - one for the conversion from int to blist_flags_t and one for the conversion the other way around. Thanks, Bart.
Re: [PATCH 0/3] SCSI device blacklist handling improvements
Bart, > These three patches is what I came up with after having reviewed > recent changes in the code for handling blacklist flags > handling. Please consider these patches for kernel v4.16. I applied 1 and 3 to 4.16/scsi-queue. I am still not a fan of forcing u32. That's a recipe for disaster when we add the next flag. -- Martin K. Petersen Oracle Linux Engineering
[PATCH 0/3] SCSI device blacklist handling improvements
Hello Martin, These three patches is what I came up with after having reviewed recent changes in the code for handling blacklist flags handling. Please consider these patches for kernel v4.16. Note: since patch "Use 'blist_flags_t' for scsi_devinfo flags" is not yet in the 4.16/scsi-queue branch I have developed these patches on top of a merge of the v4.15-rc1 release and your 4.16/scsi-queue branch. Thanks, Bart. Bart Van Assche (3): scsi_get_device_flags_keyed(): Always return device flags Use blist_flags_t consistently Introduce scsi_devinfo_key enumeration type drivers/scsi/scsi_devinfo.c | 29 - drivers/scsi/scsi_priv.h | 14 -- drivers/scsi/scsi_scan.c | 13 +++-- drivers/scsi/scsi_sysfs.c | 4 ++-- drivers/scsi/scsi_transport_spi.c | 12 +++- 5 files changed, 36 insertions(+), 36 deletions(-) -- 2.15.0