git am 安装patch出现trailing whitespace错误--whitespace=fix解决

git am 安装patch 出现错误

rv1126_release$ git am  ~/rv1126_patch/0005-dev-Update-bcmdhd-and-bcmhd_wifi6-driver-code-sync-t.patch 
Applying: Update bcmdhd and bcmhd_wifi6 driver code sync to toybrick branch
.git/rebase-apply/patch:602: trailing whitespace.
        uint chip = dhd->conf->chip, chiprev = dhd->conf->chiprev; 
.git/rebase-apply/patch:1864: trailing whitespace.
        uint chip = dhd->conf->chip, chiprev = dhd->conf->chiprev; 
.git/rebase-apply/patch:4481: trailing whitespace.
                                        } else { 
.git/rebase-apply/patch:5051: trailing whitespace.
                        if (dhd_monitor_enabled(dhdp, ifidx)) 
.git/rebase-apply/patch:5143: trailing whitespace.
                        if (dhd_monitor_enabled(dhdp, ifidx)) 
error: patch failed: kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c:862
error: kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_config.c: patch does not apply
Patch failed at 0001 Update bcmdhd and bcmhd_wifi6 driver code sync to toybrick branch
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

信息提示有行尾空白错误,

增加参数

--whitespace=fix

自动解决

rv1126_release$ git am  ~/rv1126_patch/0005-dev-Update-bcmdhd-and-bcmhd_wifi6-driver-code-sync-t.patch  --whitespace=fix
Applying: Update bcmdhd and bcmhd_wifi6 driver code sync to toybrick branch
.git/rebase-apply/patch:602: trailing whitespace.
        uint chip = dhd->conf->chip, chiprev = dhd->conf->chiprev; 
.git/rebase-apply/patch:1864: trailing whitespace.
        uint chip = dhd->conf->chip, chiprev = dhd->conf->chiprev; 
.git/rebase-apply/patch:4481: trailing whitespace.
                                        } else { 
.git/rebase-apply/patch:5051: trailing whitespace.
                        if (dhd_monitor_enabled(dhdp, ifidx)) 
.git/rebase-apply/patch:5143: trailing whitespace.
                        if (dhd_monitor_enabled(dhdp, ifidx)) 
warning: squelched 31 whitespace errors
warning: 26 lines applied after fixing whitespace errors.

 

可正常安装

 

posted @ 2022-05-30 18:56  mcdull^0^  阅读(1183)  评论(0编辑  收藏  举报