Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: bcm: fix checkpatch error 'assignment in if condition'

clean up checkpatch errors and bClassificationSucceed is set to "TRUE"
proper location.

If protocal is not TCP or UDP, when it checks protocal, bClassificationSucceed
must be set to TRUE.
Also the end of do-while(0) loop, bClassificationSucceed is set to TRUE.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Daeseok Youn and committed by
Greg Kroah-Hartman
4a467a43 24e3b16b

+14 -18
+14 -18
drivers/staging/bcm/Qos.c
··· 230 230 231 231 //**************Checking IP header parameter**************************// 232 232 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Trying to match Source IP Address"); 233 - if (false == (bClassificationSucceed = 234 - MatchSrcIpAddress(pstClassifierRule, iphd->saddr))) 233 + if (!MatchSrcIpAddress(pstClassifierRule, iphd->saddr)) 235 234 break; 236 235 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Source IP Address Matched"); 237 236 238 - if (false == (bClassificationSucceed = 239 - MatchDestIpAddress(pstClassifierRule, iphd->daddr))) 237 + if (!MatchDestIpAddress(pstClassifierRule, iphd->daddr)) 240 238 break; 241 239 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Destination IP Address Matched"); 242 240 243 - if (false == (bClassificationSucceed = 244 - MatchTos(pstClassifierRule, iphd->tos))) 245 - { 241 + if (!MatchTos(pstClassifierRule, iphd->tos)) { 246 242 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "TOS Match failed\n"); 247 243 break; 248 244 } 249 245 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "TOS Matched"); 250 246 251 - if (false == (bClassificationSucceed = 252 - MatchProtocol(pstClassifierRule, iphd->protocol))) 247 + if (!MatchProtocol(pstClassifierRule, iphd->protocol)) 253 248 break; 254 249 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Protocol Matched"); 255 250 256 251 //if protocol is not TCP or UDP then no need of comparing source port and destination port 257 - if (iphd->protocol != TCP && iphd->protocol != UDP) 252 + if (iphd->protocol != TCP && iphd->protocol != UDP) { 253 + bClassificationSucceed = TRUE; 258 254 break; 255 + } 259 256 //******************Checking Transport Layer Header field if present *****************// 260 257 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Source Port %04x", 261 258 (iphd->protocol == UDP) ? xprt_hdr->uhdr.source : xprt_hdr->thdr.source); 262 259 263 - if (false == (bClassificationSucceed = 264 - MatchSrcPort(pstClassifierRule, 265 - ntohs((iphd->protocol == UDP) ? 266 - xprt_hdr->uhdr.source : xprt_hdr->thdr.source)))) 260 + if (!MatchSrcPort(pstClassifierRule, 261 + ntohs((iphd->protocol == UDP) ? 262 + xprt_hdr->uhdr.source : xprt_hdr->thdr.source))) 267 263 break; 268 264 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Src Port Matched"); 269 265 270 266 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Destination Port %04x", 271 267 (iphd->protocol == UDP) ? xprt_hdr->uhdr.dest : 272 268 xprt_hdr->thdr.dest); 273 - if (false == (bClassificationSucceed = 274 - MatchDestPort(pstClassifierRule, 275 - ntohs((iphd->protocol == UDP) ? 276 - xprt_hdr->uhdr.dest : xprt_hdr->thdr.dest)))) 269 + if (!MatchDestPort(pstClassifierRule, 270 + ntohs((iphd->protocol == UDP) ? 271 + xprt_hdr->uhdr.dest : xprt_hdr->thdr.dest))) 277 272 break; 273 + bClassificationSucceed = TRUE; 278 274 } while (0); 279 275 280 276 if (TRUE == bClassificationSucceed)