All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
       [not found] <CGME20170828122625epcas2p33e3e912339c1e29051ad8e28251ea91b@epcas2p3.samsung.com>
@ 2017-08-28 12:19 ` Alim Akhtar
  2017-08-28 15:45   ` Bart Van Assche
  0 siblings, 1 reply; 7+ messages in thread
From: Alim Akhtar @ 2017-08-28 12:19 UTC (permalink / raw)
  To: linux-scsi, linux-kernel; +Cc: JBottomley, vinholikatti, martin.petersen

This entire file uses UFS_BIT macro for bits definition, expect for few
places. This patch convert those defines to use UFS_BIT macro to be aligned
with reset of the file.

Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
---
 drivers/scsi/ufs/ufshci.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h
index f60145d..588094a 100644
--- a/drivers/scsi/ufs/ufshci.h
+++ b/drivers/scsi/ufs/ufshci.h
@@ -186,9 +186,9 @@ enum {
 /* UECDL - Host UIC Error Code Data Link Layer 3Ch */
 #define UIC_DATA_LINK_LAYER_ERROR		UFS_BIT(31)
 #define UIC_DATA_LINK_LAYER_ERROR_CODE_MASK	0x7FFF
-#define UIC_DATA_LINK_LAYER_ERROR_PA_INIT	0x2000
-#define UIC_DATA_LINK_LAYER_ERROR_NAC_RECEIVED	0x0001
-#define UIC_DATA_LINK_LAYER_ERROR_TCx_REPLAY_TIMEOUT 0x0002
+#define UIC_DATA_LINK_LAYER_ERROR_PA_INIT	UFS_BIT(13)
+#define UIC_DATA_LINK_LAYER_ERROR_NAC_RECEIVED	UFS_BIT(1)
+#define UIC_DATA_LINK_LAYER_ERROR_TCx_REPLAY_TIMEOUT UFS_BIT(2)
 
 /* UECN - Host UIC Error Code Network Layer 40h */
 #define UIC_NETWORK_LAYER_ERROR			UFS_BIT(31)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
  2017-08-28 12:19 ` [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible Alim Akhtar
@ 2017-08-28 15:45   ` Bart Van Assche
  2017-08-29 11:05     ` Alim Akhtar
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2017-08-28 15:45 UTC (permalink / raw)
  To: linux-scsi, alim.akhtar, linux-kernel
  Cc: martin.petersen, JBottomley, vinholikatti

On Mon, 2017-08-28 at 17:49 +0530, Alim Akhtar wrote:
> This entire file uses UFS_BIT macro for bits definition, expect for few
> places. This patch convert those defines to use UFS_BIT macro to be aligned
> with reset of the file.

This is the definition of the UFS_BIT() macro I found in
drivers/scsi/ufs/ufshci.h:

#define UFS_BIT(x)	(1L << (x))

Using this macro makes code longer instead of shorter and does not improve
code readability. Is this macro really useful? Wouldn't it be better to
remove the UFS_BIT() macro instead of introducing more uses of it?

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
  2017-08-28 15:45   ` Bart Van Assche
@ 2017-08-29 11:05     ` Alim Akhtar
  2017-09-11  2:44       ` Alim Akhtar
  0 siblings, 1 reply; 7+ messages in thread
From: Alim Akhtar @ 2017-08-29 11:05 UTC (permalink / raw)
  To: Bart Van Assche, linux-scsi, linux-kernel
  Cc: martin.petersen, Arnd Bergmann, vinholikatti

Hi Bart,
Thanks for your review.

On 08/28/2017 09:15 PM, Bart Van Assche wrote:
> On Mon, 2017-08-28 at 17:49 +0530, Alim Akhtar wrote:
>> This entire file uses UFS_BIT macro for bits definition, expect for few
>> places. This patch convert those defines to use UFS_BIT macro to be aligned
>> with reset of the file.
> 
> This is the definition of the UFS_BIT() macro I found in
> drivers/scsi/ufs/ufshci.h:
> 
> #define UFS_BIT(x)	(1L << (x))
> 
> Using this macro makes code longer instead of shorter and does not improve
> code readability. Is this macro really useful? Wouldn't it be better to
> remove the UFS_BIT() macro instead of introducing more uses of it?
> 
Well, the intension of this patch is to make use of already existing 
UFS_BIT() macro.

I am not aware of the history why this macro was created at first place.

Well, it does improve code readability, for me at least, no need for one 
to do a calculation to see which bit it is, as we pass _bit_ number to 
UFS_BIT.

I am totally okay, if you or other reviewers suggests me to change 
UFS_BIT to actual bit position, something like the original case, which 
this patch is trying to change.

> Thanks,
> 
> Bart.
> 
Thanks!
Alim

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
  2017-08-29 11:05     ` Alim Akhtar
@ 2017-09-11  2:44       ` Alim Akhtar
  2017-09-25 19:31           ` Martin K. Petersen
  0 siblings, 1 reply; 7+ messages in thread
From: Alim Akhtar @ 2017-09-11  2:44 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: Bart Van Assche, linux-scsi, linux-kernel, martin.petersen,
	Arnd Bergmann, vinholikatti

Hi,

Ping!!!

Should I drop this patch and send another one which removes UFS_BIT() macro?

On Tue, Aug 29, 2017 at 4:35 PM, Alim Akhtar <alim.akhtar@samsung.com> wrote:
> Hi Bart,
> Thanks for your review.
>
> On 08/28/2017 09:15 PM, Bart Van Assche wrote:
>> On Mon, 2017-08-28 at 17:49 +0530, Alim Akhtar wrote:
>>> This entire file uses UFS_BIT macro for bits definition, expect for few
>>> places. This patch convert those defines to use UFS_BIT macro to be aligned
>>> with reset of the file.
>>
>> This is the definition of the UFS_BIT() macro I found in
>> drivers/scsi/ufs/ufshci.h:
>>
>> #define UFS_BIT(x)    (1L << (x))
>>
>> Using this macro makes code longer instead of shorter and does not improve
>> code readability. Is this macro really useful? Wouldn't it be better to
>> remove the UFS_BIT() macro instead of introducing more uses of it?
>>
> Well, the intension of this patch is to make use of already existing
> UFS_BIT() macro.
>
> I am not aware of the history why this macro was created at first place.
>
> Well, it does improve code readability, for me at least, no need for one
> to do a calculation to see which bit it is, as we pass _bit_ number to
> UFS_BIT.
>
> I am totally okay, if you or other reviewers suggests me to change
> UFS_BIT to actual bit position, something like the original case, which
> this patch is trying to change.
>
>> Thanks,
>>
>> Bart.
>>
> Thanks!
> Alim



-- 
Regards,
Alim

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
  2017-09-11  2:44       ` Alim Akhtar
@ 2017-09-25 19:31           ` Martin K. Petersen
  0 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2017-09-25 19:31 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: Alim Akhtar, Bart Van Assche, linux-scsi, linux-kernel,
	martin.petersen, Arnd Bergmann, vinholikatti


Alim,

> Should I drop this patch and send another one which removes UFS_BIT()
> macro?

I fail to see the point of UFS_BIT(). So yes.

Please make sure to CC: Subhash on ufs changes.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
@ 2017-09-25 19:31           ` Martin K. Petersen
  0 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2017-09-25 19:31 UTC (permalink / raw)
  To: Alim Akhtar
  Cc: Alim Akhtar, Bart Van Assche, linux-scsi, linux-kernel,
	martin.petersen, Arnd Bergmann, vinholikatti


Alim,

> Should I drop this patch and send another one which removes UFS_BIT()
> macro?

I fail to see the point of UFS_BIT(). So yes.

Please make sure to CC: Subhash on ufs changes.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible
  2017-09-25 19:31           ` Martin K. Petersen
  (?)
@ 2017-09-30  6:24           ` Alim Akhtar
  -1 siblings, 0 replies; 7+ messages in thread
From: Alim Akhtar @ 2017-09-30  6:24 UTC (permalink / raw)
  To: Martin K. Petersen, Alim Akhtar
  Cc: Bart Van Assche, linux-scsi, linux-kernel, Arnd Bergmann, vinholikatti

Hi Martin,

On 09/26/2017 01:01 AM, Martin K. Petersen wrote:
> 
> Alim,
> 
>> Should I drop this patch and send another one which removes UFS_BIT()
>> macro?
> 
> I fail to see the point of UFS_BIT(). So yes.
> 
> Please make sure to CC: Subhash on ufs changes.
> 
Thanks for looking into this patch.
I have just posted https://lkml.org/lkml/2017/9/30/41 (a series of 3 
patches)
Please take a look.

Regards,
Alim

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-30  6:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170828122625epcas2p33e3e912339c1e29051ad8e28251ea91b@epcas2p3.samsung.com>
2017-08-28 12:19 ` [PATCH] scsi: ufs: Make use of UFS_BIT macro wherever possible Alim Akhtar
2017-08-28 15:45   ` Bart Van Assche
2017-08-29 11:05     ` Alim Akhtar
2017-09-11  2:44       ` Alim Akhtar
2017-09-25 19:31         ` Martin K. Petersen
2017-09-25 19:31           ` Martin K. Petersen
2017-09-30  6:24           ` Alim Akhtar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.