[PATCH v2] scsi: scsi_debugfs: Use for_each_set_bit to simplify code

2019-07-25 Thread Andy Shevchenko
We can use for_each_set_bit() to slightly simplify the code. Signed-off-by: Andy Shevchenko --- - fix title by adding "fs" (Doug) drivers/scsi/scsi_debugfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debug

[PATCH v1] scsi: scsi_debug: Use for_each_set_bit to simplify code

2019-07-10 Thread Andy Shevchenko
We can use for_each_set_bit() to slightly simplify the code. Signed-off-by: Andy Shevchenko --- drivers/scsi/scsi_debugfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debugfs.c index c5a8756384bc..c19ea7ab54cb 100644

Re: [PATCH 3/3][V3] iio: Handle enumerated properties with gaps

2019-05-08 Thread Andy Shevchenko
s ", > e->items[i]); > + } The problem here that the user will have no clue where the gap is happened, to solve this we need either bitmap of array, where set bits shows defined items, or use comma-separated list of values. The latter would need another node since we don't break user space. -- With Best Regards, Andy Shevchenko

[PATCH v1] scsi: tcmu: Switch to bitmap_zalloc()

2019-03-04 Thread Andy Shevchenko
Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/target/target_core_user.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers

Re: [PATCH v4 9/9] dmapool: debug: prevent endless loop in case of corruption

2018-12-04 Thread Andy Shevchenko
On Tue, Dec 4, 2018 at 11:26 PM Tony Battersby wrote: > > On 12/4/18 3:30 PM, Andy Shevchenko wrote: > > On Tue, Dec 4, 2018 at 10:18 PM Matthew Wilcox wrote: > >> On Tue, Dec 04, 2018 at 12:14:43PM -0800, Andrew Morton wrote: > >>> Also, Andy had issues with the

Re: [PATCH v4 9/9] dmapool: debug: prevent endless loop in case of corruption

2018-12-04 Thread Andy Shevchenko
me ago. If I _was_ in Cc list and didn't comment, I'm fine with it. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] codafs: Fix build using bare-metal toolchain

2018-11-23 Thread Andy Shevchenko
ically get picked up through kernel janitors, > or maybe an akpm linux-next patch queue. In fact, I'm not even sure if > there is a designated person I would be passing updates to, I've sent > patches to akpm, viro, hellwig, linus, and gregkh at various times. % scripts/get_maintainer.pl -f include/linux/coda.h Jan Harkes (maintainer:CODA FILE SYSTEM) c...@cs.cmu.edu (maintainer:CODA FILE SYSTEM) codal...@coda.cs.cmu.edu (open list:CODA FILE SYSTEM) linux-ker...@vger.kernel.org (open list) Aren't you a maintainer? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] codafs: Fix build using bare-metal toolchain

2018-11-22 Thread Andy Shevchenko
On Wed, Nov 21, 2018 at 8:10 PM Jan Harkes wrote: > > On Wed, Nov 21, 2018 at 06:41:13PM +0200, Andy Shevchenko wrote: > > I'm not sure how you managed to miss people in this list (perhaps by > > default you have suppress all Cc in your Git configuration), but I >

Re: [PATCH v2] codafs: Fix build using bare-metal toolchain

2018-11-21 Thread Andy Shevchenko
use of > > this u_quad_t type is not defined when using bare-metal toolchain and > > codafs build fails. This patch fixes it by defining u_quad_t type > > unconditionally. > > > > Cc: Jan Harkes > > Cc: Christoph Hellwig > > Cc: Andy Shevchenko I'm no

Re: [PATCH v7 0/8] mpt3sas: some bug fixes patches

2018-11-02 Thread Andy Shevchenko
looking at the code structure; I > have no idea how the mpt3sas hardware or the SCSI mid-layer work, so > you're on your own there :) > > Reviewed-by: Bjorn Helgaas > > Andy also gave his reviewed-by on the v6 series, so I cc'd him here. > I think it's good practice to specifically cc anybody who has > commented on previous versions of your patch set. Right, thanks! With the same caveat as Bjorn posted I give my Reviewed-by: Andy Shevchenko to v7. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] codafs: Fix build using bare-metal toolchain

2018-10-30 Thread Andy Shevchenko
With Best Regards, Andy Shevchenko

Re: [v6 0/4] mpt3sas: Hot-Plug Surprise removal support on IOC.

2018-10-30 Thread Andy Shevchenko
tests, we ll post Hot-Plug Surprise removal patches. > FWIW, Reviewed-by: Andy Shevchenko P.S. We are in the middle of merge window, so, this week is a little chance anyone will look at it. > Thanks, > Suganath Prabu > On Tue, Oct 23, 2018 at 3:51 PM Suganath Prabu > wrote: >

Re: [PATCH v2] codafs: Fix build using bare-metal toolchain

2018-10-29 Thread Andy Shevchenko
inux/coda.h > > @@ -58,8 +58,7 @@ Mellon the rights to redistribute these changes without > > encumbrance. > > #ifndef _CODA_HEADER_ > > #define _CODA_HEADER_ > > > > -#if defined(__linux__) > > typedef unsigned long long u_quad_t; > > -#endif > > + > > #include > > #endif > > -- > > 2.19.1 > > -- With Best Regards, Andy Shevchenko

Re: [v5 2/4] mpt3sas: Fix Sync cache command failure during driver unload

2018-10-18 Thread Andy Shevchenko
On Thu, Oct 18, 2018 at 10:11 AM Suganath Prabu Subramani wrote: > > > > On Wed, Oct 17, 2018 at 2:02 PM Andy Shevchenko > wrote: >> >> On Wed, Oct 17, 2018 at 8:59 AM Suganath Prabu >> wrote: >> > >> > This is to fix Sync cache and start sto

Re: [v5 1/4] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational

2018-10-18 Thread Andy Shevchenko
On Thu, Oct 18, 2018 at 10:10 AM Suganath Prabu Subramani wrote: > On Wed, Oct 17, 2018 at 1:49 PM Andy Shevchenko > wrote: >> On Wed, Oct 17, 2018 at 11:17 AM Andy Shevchenko >> wrote: >> > I understand this is part of existing code, but can you consider to >&

Re: [v5 2/4] mpt3sas: Fix Sync cache command failure during driver unload

2018-10-17 Thread Andy Shevchenko
} > + } > + > + return true; Wouldn't be the same as if (!ioc->remove_host || ioc->hba_mpi_version_belonged == MPI2_VERSION) return !ioc->remove_host; switch (scmd->cmnd[0]) { case SYNCHRONIZE_CACHE: case START_STOP: return true; default: return false; } ? -- With Best Regards, Andy Shevchenko

Re: [v5 3/4] mpt3sas:Fix driver modifying persistent data.

2018-10-17 Thread Andy Shevchenko
e == 0)) { No need to have parens. -- With Best Regards, Andy Shevchenko

Re: [v5 1/4] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational

2018-10-17 Thread Andy Shevchenko
On Wed, Oct 17, 2018 at 11:17 AM Andy Shevchenko wrote: > > On Wed, Oct 17, 2018 at 8:59 AM Suganath Prabu > wrote: > > > > No functional changes. This section of code > > "wait for IOC to be operational" is used in many places > > across the dri

Re: [v5 1/4] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational

2018-10-17 Thread Andy Shevchenko
OUNT); One line? > + rc = mpt3sas_wait_for_ioc_to_operational(ioc, > + IOC_OPERATIONAL_WAIT_COUNT); Ditto. > + rc = mpt3sas_wait_for_ioc_to_operational(ioc, > + IOC_OPERATIONAL_WAIT_COUNT); Ditto. > + rc = mpt3sas_wait_for_ioc_to_operational(ioc, > + IOC_OPERATIONAL_WAIT_COUNT); Ditto. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-25 Thread Andy Shevchenko
On Tue, Sep 25, 2018 at 1:29 PM Suganath Prabu Subramani wrote: > > On Tue, Sep 25, 2018 at 3:22 PM Andy Shevchenko > wrote: > > > > On Tue, Sep 25, 2018 at 12:46 PM Suganath Prabu Subramani > > wrote: > > > > > > > + pr_err(MPT3SAS_

Re: [PATCH v3 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-25 Thread Andy Shevchenko
This should be just one line. > Above line crosses over 80 characters, so it is in two lines. For years there is no such requirement for string literals. Please, don't split string literals in ugly way like this. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 1/6] mpt3sas: Introduce mpt3sas_base_pci_device_is_available

2018-09-25 Thread Andy Shevchenko
pr_err(MPT3SAS_FMT > + "%s: pci error recovery reset or" > + " pci device unplug occurred\n", This should be just one line. > + ioc->name, __func__); > + return; > + } -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 0/6] mpt3sas: Hot-Plug Surprise removal support on IOC.

2018-09-25 Thread Andy Shevchenko
/scsi/mpt3sas/mpt3sas_ctl.c | 26 + > drivers/scsi/mpt3sas/mpt3sas_scsih.c | 189 > +++ > drivers/scsi/mpt3sas/mpt3sas_transport.c | 82 +++--- > 6 files changed, 298 insertions(+), 177 deletions(-) > > -- > 1.8.3.1 > -- With Best Regards, Andy Shevchenko

Re: [Patch v1 0/7] mpt3sas: Hot-Plug Surprise removal support on IOC.

2018-08-30 Thread Andy Shevchenko
| 17 ++- > drivers/scsi/mpt3sas/mpt3sas_config.c| 32 +--- > drivers/scsi/mpt3sas/mpt3sas_ctl.c | 26 +--- > drivers/scsi/mpt3sas/mpt3sas_scsih.c | 188 --- > drivers/scsi/mpt3sas/mpt3sas_transport.c | 82 +++--- > 6 files changed, 414 insertions(+), 179 deletions(-) > > -- > 1.8.3.1 > -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] mpt3sas: correct reset of smid while clearing scsi tracker

2018-08-03 Thread Andy Shevchenko
ows this kind of style. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 RESEND] mpt3sas: Swap I/O memory read value back to cpu endianness

2018-08-03 Thread Andy Shevchenko
On Fri, 2018-08-03 at 16:04 +0530, Sreekanth Reddy wrote: > On Fri, Aug 3, 2018 at 3:07 PM, Andy Shevchenko > wrote: > > On Thu, 2018-08-02 at 16:16 -0400, Martin K. Petersen wrote: > > > Andy, > > > > > > Please review the changes Sreekanth made to addres

Re: [PATCH v1 RESEND] mpt3sas: Swap I/O memory read value back to cpu endianness

2018-08-03 Thread Andy Shevchenko
s patch I am correcting it by adding these APIs back > > before accessing I/O memory. > > > > v1: Changelog: > > Replaced writeq API with __raw_writeq() & mmiowb() APIs. > > -- Andy Shevchenko Intel Finland Oy

Re: [PATCH] mpt3sas: Swap I/O memory read value back to cpu endianness

2018-07-26 Thread Andy Shevchenko
On Thu, Jul 26, 2018 at 2:25 PM, Sreekanth Reddy wrote: > On Wed, Jul 25, 2018 at 8:32 PM, Andy Shevchenko > wrote: >> On Wed, Jul 25, 2018 at 12:42 PM, Sreekanth Reddy >> wrote: >>> Swap the I/O memory read value back to cpu endianness before storing it >>

Re: [PATCH] mpt3sas: Swap I/O memory read value back to cpu endianness

2018-07-25 Thread Andy Shevchenko
32)(request[i]), &ioc->chip->Doorbell); > + writel(cpu_to_le32(request[i]), &ioc->chip->Doorbell); This kind of endianess play (including above) should make sparse unhappy. Did you run it with C=1 CF=-D__CHECK_ENDIAN__ ? -- With Best Regards, Andy Shevchenko

Re: [PATCH] mpt3sas: Fix for regression caused due to cf6bf9710c patch

2018-06-29 Thread Andy Shevchenko
ng the non-raw readX/writeX it should be cpu endian > internally which cf6bf9710c upsets. And we definitely won't see the constructions like writeq(cpu_to_le64()) in the code, because it's weird. If I get it correctly it's equivalent to __raw_writeq(). -- With Best Regards, Andy Shevchenko

Re: [PATCH] mpt3sas: Fix for regression caused due to cf6bf9710c patch

2018-06-29 Thread Andy Shevchenko
er sparse warnings. As an example: > - writeq(b, addr); > + writeq(cpu_to_le64(b), addr); /* Not all architectures has a writeq() equivalent to the below (sparc64) */ __raw_writeq(...) -- With Best Regards, Andy Shevchenko

Re: [PATCH] scsi: sd: Keep disk read-only when re-reading partition

2018-03-01 Thread Andy Shevchenko
p->write_prot = ((data.device_specific & 0x80) != 0) || > + disk_ro; Perhaps sdkp->write_prot = (data.device_specific & 0x80) || disk_ro; will save a line. -- With Best Regards, Andy Shevchenko

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Andy Shevchenko
On Fri, Feb 23, 2018 at 7:09 PM, David Laight wrote: > From: Andy Shevchenko >> Sent: 23 February 2018 16:51 >> On Fri, Feb 23, 2018 at 6:41 PM, David Laight >> wrote: >> The side-effect I referred previously is about tails, i.e. unaligned >> bytes are trans

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Andy Shevchenko
On Fri, Feb 23, 2018 at 6:51 PM, Andy Shevchenko wrote: > On Fri, Feb 23, 2018 at 6:41 PM, David Laight wrote: >> From: Arnd Bergmann >>> Sent: 23 February 2018 15:37 >>> >>> 32-bit architectures generally cannot use writeq(), so we now get a b

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Andy Shevchenko
e transfers. > So instead of the 8 byte transfers (on 64 bit) you get single bytes. > This won't be what is intended! > memcpy_toio() should probably use 'rep movsd' for the bulk of the transfer. Maybe I'm wrong but it uses movsq on 64-bit and movsl on 32-bit. The side-effect I referred previously is about tails, i.e. unaligned bytes are transferred in portions like 7 on 64-bit will be 4 + 2 + 1, 5 = 4 + 1 etc Similar way on 32-bit. -- With Best Regards, Andy Shevchenko

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Andy Shevchenko
On Fri, Feb 23, 2018 at 5:59 PM, Andy Shevchenko wrote: > On Fri, Feb 23, 2018 at 5:36 PM, Arnd Bergmann wrote: > IIRC memcpy_toio() doesn't increment the destination address. > > lo_hi or hi_lo helpers sound better. Ah, sorry, I messed up with writesl() / etc. memcpy_toio()

Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq

2018-02-23 Thread Andy Shevchenko
phba->cfg_enable_dpp) > /* write to DPP aperture taking advatage of Combined Writes */ > - tmp = (uint8_t *)wqe; > - for (i = 0; i < q->entry_size; i += sizeof(uint64_t)) > - writeq(*((uint64_t *)(tmp + i)), q->

Re: [PATCH v1] scsi: mpt3sas: Use lo_hi_writeq() helper

2018-02-14 Thread Andy Shevchenko
On Wed, 2018-02-14 at 11:40 -0800, James Bottomley wrote: > On Wed, 2018-02-14 at 20:10 +0200, Andy Shevchenko wrote: > > Since we have a writeq() for 32-bit architectures as provided by IO > > non-atomic helpers, there is no need to open code it. > > > > Moreover

[PATCH v1] scsi: mpt3sas: Use lo_hi_writeq() helper

2018-02-14 Thread Andy Shevchenko
__le64 Fixing this by replacing custom writeq() with one provided by io-64-nonatomic-lo-hi.h header. Reported-by: kbuild test robot Signed-off-by: Andy Shevchenko --- drivers/scsi/mpt3sas/mpt3sas_base.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a

Re: [PATCH] mptfusion: use strlcpy() instead of strncpy()

2018-01-15 Thread Andy Shevchenko
On Fri, Jan 12, 2018 at 5:09 PM, Bart Van Assche wrote: > On Fri, 2018-01-12 at 15:45 +0200, Andy Shevchenko wrote: >> On Fri, Jan 12, 2018 at 1:46 PM, Wang wrote: >> This one is false positive. >> > + strlcpy (karg.name, ioc->name, MPT_MAX_NAME); >>

[PATCH v1] mptfusion: Use snprintf() instead of open coded divisions

2018-01-15 Thread Andy Shevchenko
Numbers up to 100 snprintf() prints without using a division. Besides that the code looks more readable. Signed-off-by: Andy Shevchenko --- drivers/message/fusion/mptctl.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/message/fusion

Re: [PATCH] mptfusion: use strlcpy() instead of strncpy()

2018-01-12 Thread Andy Shevchenko
> pdata->BoardTracerNumber, 24); > - karg.serial_number[24-1]='\0'; > + strlcpy(karg.serial_number, > + > pdata->BoardTracerNumber, 24); > } ...and here you don't need to touch anything. -- With Best Regards, Andy Shevchenko

Re: [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW

2017-12-19 Thread Andy Shevchenko
gt; +static DEVICE_ATTR_RW(wake_up_modem); > +static DEVICE_ATTR_RW(wake_up_lan); > +static DEVICE_ATTR_RW(wake_up_wlan); > +static DEVICE_ATTR_RW(wake_up_key); > +static DEVICE_ATTR_RW(wake_up_mouse); Acked-by: Andy Shevchenko for PDx86 bits. Have to say that while it doesn't change

[PATCH v1] libsas: remove private hex2bin() implementation

2017-12-19 Thread Andy Shevchenko
The function sas_parse_addr() could be easily substituted by hex2bin() which is in kernel library code. Cc: Christoph Hellwig Signed-off-by: Andy Shevchenko --- drivers/scsi/libsas/sas_scsi_host.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers

[PATCH v1] scsi: hpsa: Use vsnprintf extension %phN

2017-12-19 Thread Andy Shevchenko
Using this extension reduces the object size. Signed-off-by: Andy Shevchenko --- drivers/scsi/hpsa.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index b0aa5dc1d54c..4c018b653f18 100644 --- a/drivers/scsi/hpsa.c

Re: [trivial PATCH] treewide: Align function definition open/close braces

2017-12-18 Thread Andy Shevchenko
as a timer interrupt. > */ > static void tpd_led_update(struct work_struct *work) > - { > +{ > struct eeepc_laptop *eeepc; > > eeepc = container_of(work, struct eeepc_laptop, tpd_led_work); > diff --git a/drivers/rtc/rtc-ab-b5ze-s3.c b/drivers/rtc/rtc-ab-

Re: [PATCH 17/22] platform/x86: alienware-wmi: fix format string overflow warning

2017-07-14 Thread Andy Shevchenko
On Fri, Jul 14, 2017 at 10:37 PM, Arnd Bergmann wrote: > On Fri, Jul 14, 2017 at 9:18 PM, Andy Shevchenko > wrote: >> On Fri, Jul 14, 2017 at 3:07 PM, Arnd Bergmann wrote: >>> gcc points out a possible format string overflow for a large value of >>> '

Re: [PATCH 17/22] platform/x86: alienware-wmi: fix format string overflow warning

2017-07-14 Thread Andy Shevchenko
.c > +++ b/drivers/platform/x86/alienware-wmi.c > @@ -421,7 +421,7 @@ static DEVICE_ATTR(lighting_control_state, 0644, > show_control_state, > static int alienware_zone_init(struct platform_device *dev) > { > int i; > - char buffer[10]; > + char buffer[13]; > char *name; > > if (interface == WMAX) { > -- > 2.9.0 > -- With Best Regards, Andy Shevchenko

Re: [PATCH 18/22] gpio: acpi: fix string overflow for large pin numbers

2017-07-14 Thread Andy Shevchenko
acpi_gpiochip_request_interrupt(struct acpi_resource *ares, >   char ev_name[5]; >   sprintf(ev_name, "_%c%02X", >   agpio->triggering == ACPI_EDGE_SENSITIVE ? > 'E' : 'L', > - pin); > + (u8)pin); >   if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, > &evt_handle))) >   handler = acpi_gpio_irq_handler; >   } -- Andy Shevchenko Intel Finland Oy

[PATCH v3 5/6] scsi: replace custom approach to hexdump small buffers

2016-10-22 Thread Andy Shevchenko
In kernel we have defined specifier (%*ph[C]) to dump small buffers in a hex format. Replace custom approach by a generic one. Cc: Jon Mason Signed-off-by: Andy Shevchenko --- drivers/scsi/scsi_transport_srp.c | 11 +-- drivers/scsi/sd.c | 4 +--- 2 files changed, 2

[PATCH v3 4/6] [SCSI] ips: don't use custom hex_asc_upper[] table

2016-10-22 Thread Andy Shevchenko
From: Andy Shevchenko We have table of the HEX characters in the kernel. Replace custom by a generic one. Cc: Adaptec OEM Raid Solutions Signed-off-by: Andy Shevchenko --- drivers/scsi/ips.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/ips.c

[PATCH v3 6/6] cciss: replace custom function to hexdump

2016-10-22 Thread Andy Shevchenko
For small buffers we may use %*ph[N] specifier, for the bigger blocks print_hex_dump() call. Cc: Don Brace Cc: esc.storage...@microsemi.com Signed-off-by: Andy Shevchenko --- drivers/block/cciss_scsi.c | 72 +++--- 1 file changed, 10 insertions(+), 62

[PATCH v3 3/6] scsi: qla4xxx: print MAC and SID via %p[mM][R]

2016-10-22 Thread Andy Shevchenko
From: Oleksandr Khoshaba In the kernel we have nice specifier to print MAC by given pointer to the address in a binary form. Signed-off-by: Oleksandr Khoshaba Acked-by: Vikas Chaudhary Cc: qlogic-storage-upstr...@qlogic.com Signed-off-by: Andy Shevchenko --- drivers/scsi/qla4xxx/ql4_mbx.c

[PATCH v3 0/6] scsi: collection of clean ups

2016-10-22 Thread Andy Shevchenko
Just collection of clean ups against SCSI drivers. Some of them were Acked quite long ago, but didn't make upstream yet. Andy Shevchenko (5): scsi: fnic: use kernel's '%pM' format option to print MAC fusion: print lan address via %pMR [SCSI] ips: don't use cus

[PATCH v3 1/6] scsi: fnic: use kernel's '%pM' format option to print MAC

2016-10-22 Thread Andy Shevchenko
Instead of supplying each byte through stack let's use %pM specifier. Cc: Hiral Patel Cc: Suma Ramars Acked-by: Tom Tucker Signed-off-by: Andy Shevchenko --- drivers/scsi/fnic/vnic_dev.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/scsi

[PATCH v3 2/6] fusion: print lan address via %pMR

2016-10-22 Thread Andy Shevchenko
LAN MAC addresses can be printed directly using %pMR specifier. Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Signed-off-by: Andy Shevchenko --- drivers/message/fusion/mptbase.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers

Re: [PATCH v1 0/4] scsi: some (very) old clean ups

2016-06-20 Thread Andy Shevchenko
On Fri, 2016-05-06 at 19:23 +0300, Andy Shevchenko wrote: > This is a set of independent clean ups that didn't land upstream for > ages (some > are dated 2010!).  As agreed with Martin at some point I resend > them. > > I have more, but the rest is not yet ready for subm

Re: [PATCH v3 5/6] scsi_debug: uuid for lu name

2016-05-31 Thread Andy Shevchenko
md > (def=0x)"); > @@ -4787,6 +4821,12 @@ static ssize_t strict_store(struct device_driver *ddp, > const char *buf, > } > static DRIVER_ATTR_RW(strict); > > +static ssize_t uuid_ctl_show(struct device_driver *ddp, char *buf) > +{ > + return scnprintf(buf, PAGE_

[PATCH v1 1/1] cciss: replace custom function to hexdump

2016-05-06 Thread Andy Shevchenko
For small buffers we may use %*ph[N] specifier, for the bigger blocks print_hex_dump() call. Cc: Christoph Hellwig Signed-off-by: Andy Shevchenko --- drivers/block/cciss_scsi.c | 72 +++--- 1 file changed, 10 insertions(+), 62 deletions(-) diff --git a

[PATCH v1 1/1] scsi: replace custom approach to hexdump small buffers

2016-05-06 Thread Andy Shevchenko
In kernel we have defined specifier (%*ph[C]) to dump small buffers in a hex format. Replace custom approach by a generic one. Signed-off-by: Andy Shevchenko --- drivers/scsi/scsi_transport_srp.c | 11 +-- drivers/scsi/sd.c | 4 +--- 2 files changed, 2 insertions(+), 13

[PATCH v1 1/1] [SCSI] ips: don't use custom hex_asc_upper[] table

2016-05-06 Thread Andy Shevchenko
From: Andy Shevchenko We have table of the HEX characters in the kernel. Replace custom by a generic one. Cc: Adaptec OEM Raid Solutions Signed-off-by: Andy Shevchenko --- drivers/scsi/ips.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/ips.c

[PATCH v1 0/4] scsi: some (very) old clean ups

2016-05-06 Thread Andy Shevchenko
This is a set of independent clean ups that didn't land upstream for ages (some are dated 2010!). As agreed with Martin at some point I resend them. I have more, but the rest is not yet ready for submission. Andy Shevchenko (3): libsas: remove private hex2bin() implementation scsi:

[PATCH v1 4/4] scsi: qla4xxx: print MAC and SID via %p[mM][R]

2016-05-06 Thread Andy Shevchenko
From: Oleksandr Khoshaba In the kernel we have nice specifier to print MAC by given pointer to the address in a binary form. Signed-off-by: Oleksandr Khoshaba Acked-by: Vikas Chaudhary Cc: qlogic-storage-upstr...@qlogic.com Signed-off-by: Andy Shevchenko --- drivers/scsi/qla4xxx/ql4_mbx.c

[PATCH v1 3/4] fusion: print lan address via %pMR

2016-05-06 Thread Andy Shevchenko
LAN MAC addresses can be printed directly using %pMR specifier. Cc: Sathya Prakash Cc: mpt-fusionlinux@broadcom.com Signed-off-by: Andy Shevchenko --- drivers/message/fusion/mptbase.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/message/fusion

[PATCH v1 2/4] scsi: fnic: use kernel's '%pM' format option to print MAC

2016-05-06 Thread Andy Shevchenko
Instead of supplying each byte through stack let's use %pM specifier. Cc: Hiral Patel Cc: Suma Ramars Cc: Brian Uchino Signed-off-by: Andy Shevchenko --- drivers/scsi/fnic/vnic_dev.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/fnic/vnic_de

[PATCH v1 1/4] libsas: remove private hex2bin() implementation

2016-05-06 Thread Andy Shevchenko
The function sas_parse_addr() could be easily substituted by hex2bin() which is in kernel library code. Cc: Christoph Hellwig Signed-off-by: Andy Shevchenko --- drivers/scsi/libsas/sas_scsi_host.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a

Re: [PATCH v2] mvsas: Generalize Marvell 9485 in pci_device_id

2016-04-07 Thread Andy Shevchenko
IW: Reviewed-by: Andy Shevchenko > > Signed-off-by: Leonid Moiseichuk > --- Missed changelog vfrom v1 to v2. > drivers/scsi/mvsas/mv_init.c | 19 +-- > 1 file changed, 1 insertion(+), 18 deletions(-) > > diff --git a/drivers/scsi/mvsas/mv_init.c b/dri

Re: [PATCH 5/7] ahci: Convert driver to use modern PM hooks

2016-02-18 Thread Andy Shevchenko
int rc; > > - rc = ata_pci_device_do_resume(pdev); > - if (rc) > - return rc; > - > /* Apple BIOS helpfully mangles the registers on resume */ > if (is_mcp89_apple(pdev)) > ahci_mcp89_apple_enable(pdev); > --

Re: [PATCH] [SCSI] osd: fix signed char versus %02x issue

2015-12-10 Thread Andy Shevchenko
which was > Rasmus> created for such short hexdumps. > > Applied to 4.5/scsi-queue. How fast! Martin, I have several patches on SCSI subsytem like this one. Some of them didn't manage kernel (even having Ack!) for years already. Is it okay if I collect them together and send a bu

Re: [PATCH RESEND] scsi_debug: fix prevent_allow+verify regressions

2015-11-27 Thread Andy Shevchenko
On Thu, Nov 26, 2015 at 4:14 AM, Martin K. Petersen wrote: >>>>>> "Andy" == Andy Shevchenko writes: > > Andy, > > Andy> but can you pay a little attention to > Andy> http://www.spinics.net/lists/linux-scsi/msg81778.html ? It seems > Andy&g

[PATCH v1 1/1] scsi_debug: check for bigger value first

2015-11-26 Thread Andy Shevchenko
From: Andy Shevchenko Even for signed types we have to check for bigger positive value first. Otherwise it will be never happened. Acked-by: Douglas Gilbert Signed-off-by: Andy Shevchenko --- drivers/scsi/scsi_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

Re: [PATCH RESEND] scsi_debug: fix prevent_allow+verify regressions

2015-11-25 Thread Andy Shevchenko
Martin, sorry for offtopic, but can you pay a little attention to http://www.spinics.net/lists/linux-scsi/msg81778.html ? It seems it wasn't applied. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a me

Re: [PATCH V2 2/3] scsi: fix compiler warning for sg

2015-11-10 Thread Andy Shevchenko
, the matter is only to replace MULDIV() by mult_frac() which is already in kernel. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V2 2/3] scsi: fix compiler warning for sg

2015-11-09 Thread Andy Shevchenko
/* N.B. User receives timeout as return value > */ > -- > Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux > Foundation Collaborative Project > > -- > To unsubscribe from th

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
On Thu, Nov 5, 2015 at 9:31 PM, Andy Shevchenko wrote: > On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote: >> On 11/5/2015 1:07 PM, Andy Shevchenko wrote: > >> Let's try again. >> >> static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) { >>

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
On Thu, Nov 5, 2015 at 8:32 PM, Sinan Kaya wrote: > On 11/5/2015 1:07 PM, Andy Shevchenko wrote: > Let's try again. > > static inline u64 mult_frac64(u64 x, u32 numer, u32 denom) { > u64 rem = x % denom; > u64 quot = do_div(x, denom); >

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
On Thu, Nov 5, 2015 at 5:10 PM, Sinan Kaya wrote: > > > On 11/5/2015 3:48 AM, Andy Shevchenko wrote: >> >> On Thu, Nov 5, 2015 at 6:46 AM, Sinan Kaya wrote: >>> >>> The MULDIV macro has been designed for small >>> numbers. It emits an overflow

Re: [PATCH 3/4] scsi: fix compiler warning for sg

2015-11-05 Thread Andy Shevchenko
ux > Foundation Collaborative Project > > -- > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- With Best Regards, And

Re: [PATCH] scsi: fnic: use kernel's '%pM' format option to print MAC

2015-09-30 Thread Andy Shevchenko
On Thu, 2015-03-19 at 21:50 -0500, Tom Tucker wrote: > Hi Andy, > > On 3/19/15 12:54 PM, Andy Shevchenko wrote: > > On Tue, 2014-04-29 at 17:45 +0300, Andy Shevchenko wrote: > > > Instead of supplying each byte through stack let's use %pM > > > specifie

[PATCH 1/1] scsi: qla4xxx: print MAC and SID via %p[mM][R]

2015-09-30 Thread Andy Shevchenko
From: Oleksandr Khoshaba In the kernel we have nice specifier to print MAC by given pointer to the address in binary form. Signed-off-by: Oleksandr Khoshaba Acked-by: Vikas Chaudhary Signed-off-by: Andy Shevchenko --- drivers/scsi/qla4xxx/ql4_mbx.c | 5 + drivers/scsi/qla4xxx/ql4_nx.c

Re: [PATCH] scsi: fnic: use kernel's '%pM' format option to print MAC

2015-03-19 Thread Andy Shevchenko
On Tue, 2014-04-29 at 17:45 +0300, Andy Shevchenko wrote: > Instead of supplying each byte through stack let's use %pM specifier. Anyone to comment or apply this patch? > > Signed-off-by: Andy Shevchenko > Cc: Tom Tucker > Cc: Steve Wise > Cc: linux-r...@vger.kernel.or

Re: [PATCHv2 3/3] scsi: qla4xxx: print MAC and SID via %p[mM][R]

2015-03-18 Thread Andy Shevchenko
On Thu, Jul 25, 2013 at 12:10 PM, Andy Shevchenko wrote: > From: Oleksandr Khoshaba > > In the kernel we have nice specifier to print MAC by given pointer to the > address in binary form. > > Signed-off-by: Oleksandr Khoshaba > Acked-by: Vikas Chaudhary Could a

[PATCH] iscsi-target: use '%*ph' specifier to dump hex buffer

2015-01-15 Thread Andy Shevchenko
Instead of pushing each byte via stack the %*ph specifier allows to supply just a pointer and length of the buffer. The patch converts code to use the specifier. Signed-off-by: Andy Shevchenko --- drivers/target/iscsi/iscsi_target_configfs.c | 13 - 1 file changed, 4 insertions

[PATCH] scsi: qla2xxx: print port name via %*phC

2015-01-15 Thread Andy Shevchenko
Instead of pushing each byte via stack let's use custom specifier which allows to print small buffers as a hex string. Signed-off-by: Andy Shevchenko --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2

[PATCH] scsi_debug: check for bigger value first

2015-01-06 Thread Andy Shevchenko
Even for signed types we have to check for bigger positive value first. Otherwise it will be never happened. Signed-off-by: Andy Shevchenko --- drivers/scsi/scsi_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi

[PATCH] scsi: fnic: use kernel's '%pM' format option to print MAC

2014-04-29 Thread Andy Shevchenko
Instead of supplying each byte through stack let's use %pM specifier. Signed-off-by: Andy Shevchenko Cc: Tom Tucker Cc: Steve Wise Cc: linux-r...@vger.kernel.org --- drivers/scsi/fnic/vnic_dev.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/scsi

[PATCH] scsi: remove private hex2bin() implementation

2014-04-29 Thread Andy Shevchenko
The function sas_parse_addr() could be easily substituted by hex2bin() which is in kernel library code. Signed-off-by: Andy Shevchenko Cc: "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org --- drivers/scsi/libsas/sas_scsi_host.c | 23 +++ 1 file changed, 7

[PATCH] scsi: qla2xxx: print port name via %*phC

2014-04-29 Thread Andy Shevchenko
Instead of pushing each byte via stack let's use custom specifier which allows to print small buffers as a hex string. Signed-off-by: Andy Shevchenko --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2

[PATCHv2 2/3] scsi: qla2xxx: print MAC via %pMR

2013-07-25 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko --- drivers/scsi/qla2xxx/qla_attr.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index d7a99ae..f925f07 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi

[PATCHv2 3/3] scsi: qla4xxx: print MAC and SID via %p[mM][R]

2013-07-25 Thread Andy Shevchenko
From: Oleksandr Khoshaba In the kernel we have nice specifier to print MAC by given pointer to the address in binary form. Signed-off-by: Oleksandr Khoshaba Acked-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_mbx.c | 5 + drivers/scsi/qla4xxx/ql4_nx.c | 8 ++-- drivers/scsi/qla4

[PATCHv2 1/3] scsi: qla2xxx: print some variables via %*phC or %*phN format

2013-07-25 Thread Andy Shevchenko
From: Oleksandr Khoshaba The patch changes a specifier used to output some variables. Instead of using stack for each byte the '%*ph[CN]' allows to take a one pointer and prints entire buffer as a hexadecimal string with the separator ':' or ''. Signed-off-by: Oleksandr Khoshaba --- drivers/sc

[PATCHv2 0/3] qla2xxx, qla4xxx: re-use %p[hmM] specifiers to print variables

2013-07-25 Thread Andy Shevchenko
We have nice specifiers in the kernel that helps us to simplify printing of the small buffers (as hexstring) and MAC addresses. Since v1: - rewritten commit messages to reflect changes better - append patch 2/3 - apply ACK to patch 3/3 Andy Shevchenko (1): scsi: qla2xxx: print MAC via %pMR

Re: [PATCH 2/2] scsi: qla2xxx: change some variables to hexadecimal string via %*phN format

2013-07-10 Thread Andy Shevchenko
anks for the patch. In the below patch couple of lines exceed 80 characters. I think is quite okay to combine string literals to long lines since checkpatch.pl recommends to do so. What is your opinion? -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH V2] scsi: replace strict_strtoul() with kstrtoul()

2013-06-03 Thread Andy Shevchenko
On Mon, Jun 3, 2013 at 12:06 PM, Jingoo Han wrote: > The usage of strict_strtoul() is not preferred, because > strict_strtoul() is obsolete. Thus, kstrtoul() should be > used. > > Signed-off-by: Jingoo Han Reviewed-by: Andy Shevchenko > --- > Changes since v1: >

Re: [PATCH] scsi: replace strict_strtoul() with kstrtoul()

2013-06-02 Thread Andy Shevchenko
ueue_ramp_up_period(struct device *dev, > struct scsi_device *sdev = to_scsi_device(dev); > unsigned long period; > > - if (strict_strtoul(buf, 10, &period)) > + if (kstrtoul(buf, 10, &period)) > return -EINVAL; Ditto. -- With Be

Re: [PATCH] fusion: print lan address via %pMR

2013-05-28 Thread Andy Shevchenko
On Thu, 2012-07-12 at 10:55 +0300, Andy Shevchenko wrote: > Signed-off-by: Andy Shevchenko > --- > drivers/message/fusion/mptbase.c | 14 -- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/message/fusion/mptbase.c > b/drivers/mes

Re: [PATCH 2/2] scsi: qla2xxx: print MAC via %pMR

2013-05-28 Thread Andy Shevchenko
On Thu, 2012-07-26 at 08:23 -0400, Chad Dupuis wrote: > > On Thu, 12 Jul 2012, Andy Shevchenko wrote: > > > Signed-off-by: Andy Shevchenko > > --- > > drivers/scsi/qla2xxx/qla_attr.c |5 + > > 1 file changed, 1 insertion(+), 4 deletions(-) > >

[PATCH] fusion: print lan address via %pMR

2012-07-12 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko --- drivers/message/fusion/mptbase.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index d99db56..d202f25 100644 --- a/drivers/message/fusion/mptbase.c +++ b

[PATCH 1/2] scsi: use kernel's '%pM' format option to print MAC

2012-07-12 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko Cc: Tom Tucker Cc: Steve Wise Cc: linux-r...@vger.kernel.org --- drivers/scsi/fnic/vnic_dev.c | 10 ++ drivers/scsi/qla4xxx/ql4_nx.c |8 ++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers

[PATCH 2/2] scsi: qla2xxx: print MAC via %pMR

2012-07-12 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko --- drivers/scsi/qla2xxx/qla_attr.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 5ab9530..095ba85 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi

  1   2   >