staging: xgifb: fix multiple line dereference
PATCH 1/1 staging: xgifb: fix multiple line dereference
This patch fixes the checkpatch.pl warning:
WARNING: Avoid multiple line dereference - prefer'XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag'
--- drivers/staging/xgifb/vb_setmode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/xgifb/vb_setmode.c +1 -2
@@ -5479,8 +5479,7 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, ModeIdIndex))return 0 ; - pVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex]. - Ext_ModeFlag & ModeTypeMask; + pVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask; pVBInfo->SetFlag =0 ; pVBInfo->VBInfo = DisableCRT2Display;
Signature · 1 line
2.7.4
Quoted 14 lines · Aastha Gupta
This patch fixes the checkpatch.pl warning:
WARNING: Avoid multiple line dereference - prefer'XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag'
Signed-off-by Aastha Gupta <[email protected]>--- drivers/staging/xgifb/vb_setmode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/xgifb/vb_setmode.c +0
-0
drivers/staging/xgifb/vb_setmode.c unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, · line 5482
Quoted 6 lines
drivers/staging/xgifb/vb_setmode.c +1
-2@@ -5479,8 +5479,7 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, ModeIdIndex))return 0 ; - pVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex]. - Ext_ModeFlag & ModeTypeMask; + pVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask;
Put the right side of the = on a separate line, with one extra tab of indentation. Then the whole thing will fit in 80 characters.
julia
Quoted 13 lines
drivers/staging/xgifb/vb_setmode.c +0
-1pVBInfo->SetFlag =0 ; pVBInfo->VBInfo = DisableCRT2Display; --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505103575-5301-1-git-send-email-aastha.gupta4104%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 59 lines · On Mon, 11 Sep 2017, [email protected] wrote:
On Monday, September 11, 2017 at 12:22:27 PM UTC+5:30, Julia Lawall wrote:
On Mon, 11 Sep 2017, Aastha Gupta wrote: > This patch fixes the checkpatch.pl warning: > > WARNING: Avoid multiple line dereference - prefer'XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag' > > Signed-off-by: Aastha Gupta <[email protected]> > --- > ᅵdrivers/staging/xgifb/vb_setmode.c | 3 +-- > ᅵ1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c > index cea128b..bf69dc9 100644 > --- a/drivers/staging/xgifb/vb_setmode.c > +++ b/drivers/staging/xgifb/vb_setmode.c > @@ -5479,8 +5479,7 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info, > ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ ᅵ ModeIdIndex)) > ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵreturn 0; > > -ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵpVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex]. > -ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵExt_ModeFlag & ModeTypeMask; > +ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵpVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask; Put the right side of the = on a separate line, with one extra tab of indentation. ᅵThen the whole thing will fit in 80 characters. julia > > ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵpVBInfo->SetFlag = 0; > ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵpVBInfo->VBInfo = DisableCRT2Display; > -- > 2.7.4 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/1505103575-5301-1-git-se nd-email-aastha.gupta4104%40gmail.com. > For more options, visit https://groups.google.com/d/optout. >
Quoted 2 lines
Putting everything to the right of = to the next line still won't resolve the warning that the line is over 80 characters.
OK, maybe you can also put a newline before or after the &.
julia
Quoted 12 lines
--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/0bffa628-d26a-447f-9609- c6dd63b19567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Monday, September 11, 2017 at 4:20:04 PM UTC+5:30, Julia Lawall wrote:
Quoted 3 lines · On Mon, 11 Sep 2017, [email protected] <javascript:> wrote:
On Monday, September 11, 2017 at 12:22:27 PM UTC+5:30, Julia Lawall
Quoted 29 lines · wrote:
Quoted 3 lines · Aastha Gupta
This patch fixes the checkpatch.pl warning:
WARNING: Avoid multiple line dereference -
prefer'XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag'
Review
Quoted 7 lines
Signed-off-by Aastha Gupta <[email protected]>---
drivers/staging/xgifb/vb_setmode.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/staging/xgifb/vb_setmode.cdrivers/staging/xgifb/vb_setmode.c unsigned char XGISetModeNew(struct
Quoted 4 lines
index cea128b..bf69dc9 100644
drivers/staging/xgifb/vb_setmode.c +0
-0@@ -5479,8 +5479,7 @@ unsigned char XGISetModeNew(struct
xgifb_video_info*xgifb_info,Quoted 1 line
ModeIdIndex))
Quoted 3 lines
return 0;
-
pVBInfo->ModeType=XGI330_EModeIDTable[ModeIdIndex].
Quoted 1 line
-
Ext_ModeFlag& ModeTypeMask;
Quoted 9 lines
Quoted 1 line
+
pVBInfo->ModeType=XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask;
Put the right side of the = on a separate line, with one extra tab of
indentation. Then the whole thing will fit in 80 characters.julia
won't that hinder readability.
Quoted 6 lines
Quoted 6 lines
pVBInfo->SetFlag= 0;pVBInfo->VBInfo= DisableCRT2Display;Signature · 1 line
2.7.4
Quoted 8 lines
Quoted 2 lines
Signature · 1 line
You received this message because you are subscribed to theGoogle Groups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from
it, send an email to [email protected].
Quoted 1 line
To post to this group, send email to
Quoted 1 line
To view this discussion on the web visithttps://
groups.google.com/d/msgid/outreachy-kernel/1505103575-5301-1-git-se
Quoted 6 lines
nd-email-aastha.gupta4104%40gmail.com.
Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Putting everything to the right of = to the next line still won't resolve the warning that the line is over 80 characters.
OK, maybe you can also put a newline before or after the &.
julia
Quoted 7 lines
Signature · 6 lines
-- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <javascript:>. To post to this group, send email to [email protected]
<javascript:>.
Quoted 1 line
To view this discussion on the web visithttps://
groups.google.com/d/msgid/outreachy-kernel/0bffa628-d26a-447f-9609-
Quoted 4 lines
c6dd63b19567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.